diff --git a/cmd/sealer/cmd/cluster/apply.go b/cmd/sealer/cmd/cluster/apply.go index 261127f8a80..c246132bcd7 100644 --- a/cmd/sealer/cmd/cluster/apply.go +++ b/cmd/sealer/cmd/cluster/apply.go @@ -134,6 +134,7 @@ func NewApplyCmd() *cobra.Command { RunMode: applyMode, SkipPrepareAppMaterials: skipPrepareAppMaterials, IgnoreCache: applyFlags.IgnoreCache, + Configs: cf.GetConfigs(), }) }, } diff --git a/cmd/sealer/cmd/cluster/installer.go b/cmd/sealer/cmd/cluster/installer.go index 295463b36b2..aa371912fc8 100644 --- a/cmd/sealer/cmd/cluster/installer.go +++ b/cmd/sealer/cmd/cluster/installer.go @@ -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 { @@ -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 } } @@ -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 { @@ -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 { diff --git a/cmd/sealer/cmd/cluster/run.go b/cmd/sealer/cmd/cluster/run.go index f96460b2b43..c43608c2915 100644 --- a/cmd/sealer/cmd/cluster/run.go +++ b/cmd/sealer/cmd/cluster/run.go @@ -171,6 +171,7 @@ func runWithClusterfile(clusterFile string, runFlags *types.RunFlags) error { Envs: runFlags.CustomEnv, RunMode: runFlags.Mode, IgnoreCache: runFlags.IgnoreCache, + Configs: cf.GetConfigs(), }) } @@ -218,6 +219,7 @@ func runWithArgs(imageName string, runFlags *types.RunFlags) error { Envs: runFlags.CustomEnv, RunMode: runFlags.Mode, IgnoreCache: runFlags.IgnoreCache, + Configs: nil, }) }