art: Refactor out config sections

Now there is a `install` section in the config that has the fields that previously where in `c3os` but
were actually only used during install phase.

Also the k3s and c3os config were moved to the provider instead that in the global config.
This commit is contained in:
Ettore Di Giacinto
2022-07-16 20:47:55 +00:00
committed by Itxaka
parent 5bb5ff9253
commit 1a03c96235
4 changed files with 49 additions and 36 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/c3os-io/c3os/internal/bus"
cmd "github.com/c3os-io/c3os/internal/cmd"
machine "github.com/c3os-io/c3os/internal/machine"
providerConfig "github.com/c3os-io/c3os/internal/provider/config"
"github.com/c3os-io/c3os/internal/github"
config "github.com/c3os-io/c3os/pkg/config"
@@ -198,7 +199,14 @@ $ c3os rotate --network-token XXX
if err != nil {
return err
}
fmt.Print(cc.C3OS.NetworkToken)
providerCfg := &providerConfig.Config{}
err = cc.Unmarshal(providerCfg)
if err != nil {
return err
}
fmt.Print(providerCfg.C3OS.NetworkToken)
return nil
},
},