only merge configs, if there is one referenced

This commit is contained in:
iwilltry42 2021-01-18 15:45:21 +01:00
parent 267e520fce
commit f0486a388b
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110

View File

@ -188,8 +188,14 @@ func ClusterPrep(ctx context.Context, runtime k3drt.Runtime, clusterConfig *conf
if err != nil { if err != nil {
return fmt.Errorf("Failed to generate registry config file for k3s: %+v", err) return fmt.Errorf("Failed to generate registry config file for k3s: %+v", err)
} }
RegistryMergeConfig(ctx, regConf, clusterConfig.ClusterCreateOpts.Registries.Config)
log.Tracef("Merged registry config: %+v", regConf) // merge with pre-existing, referenced registries.yaml
if clusterConfig.ClusterCreateOpts.Registries.Config != nil {
if err := RegistryMergeConfig(ctx, regConf, clusterConfig.ClusterCreateOpts.Registries.Config); err != nil {
return err
}
log.Tracef("Merged registry config: %+v", regConf)
}
regConfBytes, err := yaml.Marshal(&regConf) regConfBytes, err := yaml.Marshal(&regConf)
if err != nil { if err != nil {
return fmt.Errorf("Failed to marshal registry configuration: %+v", err) return fmt.Errorf("Failed to marshal registry configuration: %+v", err)