Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configs not getting updated after install #2341

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading