Skip to content

Commit

Permalink
configs not getting updated after install
Browse files Browse the repository at this point in the history
Signed-off-by: Maxwell <144507225+maxwell-can-not-fly@users.noreply.github.com>
  • Loading branch information
maxwell-can-not-fly committed Dec 26, 2023
1 parent f07e804 commit 1e465ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/sealer/cmd/cluster/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func NewApplyCmd() *cobra.Command {
RunMode: applyMode,
SkipPrepareAppMaterials: skipPrepareAppMaterials,
IgnoreCache: applyFlags.IgnoreCache,
Configs: cf.GetConfigs(),
})
},
}
Expand Down
7 changes: 4 additions & 3 deletions cmd/sealer/cmd/cluster/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type AppInstallOptions struct {
RunMode string
SkipPrepareAppMaterials bool
IgnoreCache bool
Configs []v1.Config
}

func (i AppInstaller) Install(imageName string, options AppInstallOptions) error {
Expand All @@ -60,7 +61,7 @@ func (i AppInstaller) Install(imageName string, options AppInstallOptions) error
i.infraDriver.AddClusterEnv(options.Envs)

if !options.SkipPrepareAppMaterials {
if err := i.prepareMaterials(imageName, options.RunMode, options.IgnoreCache); err != nil {
if err := i.prepareMaterials(imageName, options.RunMode, options.IgnoreCache, options.Configs); err != nil {
return err
}
}
Expand All @@ -87,7 +88,7 @@ func (i AppInstaller) Install(imageName string, options AppInstallOptions) error
return nil
}

func (i AppInstaller) prepareMaterials(appImageName string, mode string, ignoreCache bool) error {
func (i AppInstaller) prepareMaterials(appImageName string, mode string, ignoreCache bool, configs []v1.Config) error {
clusterHosts := i.infraDriver.GetHostIPList()
clusterHostsPlatform, err := i.infraDriver.GetHostsPlatform(clusterHosts)
if err != nil {
Expand Down Expand Up @@ -118,7 +119,7 @@ func (i AppInstaller) prepareMaterials(appImageName string, mode string, ignoreC
}
}

distributor, err := imagedistributor.NewScpDistributor(imageMountInfo, i.infraDriver, nil, imagedistributor.DistributeOption{
distributor, err := imagedistributor.NewScpDistributor(imageMountInfo, i.infraDriver, configs, imagedistributor.DistributeOption{
IgnoreCache: ignoreCache,
})
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions cmd/sealer/cmd/cluster/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func runWithClusterfile(clusterFile string, runFlags *types.RunFlags) error {
Envs: runFlags.CustomEnv,
RunMode: runFlags.Mode,
IgnoreCache: runFlags.IgnoreCache,
Configs: cf.GetConfigs(),
})
}

Expand Down Expand Up @@ -218,6 +219,7 @@ func runWithArgs(imageName string, runFlags *types.RunFlags) error {
Envs: runFlags.CustomEnv,
RunMode: runFlags.Mode,
IgnoreCache: runFlags.IgnoreCache,
Configs: nil,
})
}

Expand Down

0 comments on commit 1e465ea

Please sign in to comment.