diff --git a/charts/clabernetes/templates/configmap.yaml b/charts/clabernetes/templates/configmap.yaml index 94305f00..8458559b 100644 --- a/charts/clabernetes/templates/configmap.yaml +++ b/charts/clabernetes/templates/configmap.yaml @@ -41,4 +41,10 @@ data: launcherImage: {{ .Values.globalConfig.deployment.launcherImage }} launcherImagePullPolicy: {{ .Values.globalConfig.deployment.launcherImagePullPolicy }} launcherLogLevel: {{ .Values.globalConfig.deployment.launcherLogLevel }} + {{- if .Values.globalConfig.imagePull.criSockOverride }} + criSockOverride: {{ .Values.globalConfig.imagePull.criSockOverride }} + {{- end }} + {{- if .Values.globalConfig.imagePull.criKindOverride }} + criKindOverride: {{ .Values.globalConfig.imagePull.criKindOverride }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/config/bootstrap.go b/config/bootstrap.go index 371c0dad..a06b4cdc 100644 --- a/config/bootstrap.go +++ b/config/bootstrap.go @@ -27,6 +27,8 @@ type bootstrapConfig struct { launcherImage string launcherImagePullPolicy string launcherLogLevel string + criSockOverride string + criKindOverride string } func bootstrapFromConfigMap( //nolint:gocyclo,funlen @@ -119,6 +121,16 @@ func bootstrapFromConfigMap( //nolint:gocyclo,funlen bc.launcherLogLevel = launcherLogLevel } + criSockOverride, criSockOverrideOk := inMap["criSockOverride"] + if criSockOverrideOk { + bc.criSockOverride = criSockOverride + } + + criKindOverride, criKindOverrideOk := inMap["criKindOverride"] + if criKindOverrideOk { + bc.criKindOverride = criKindOverride + } + var err error if len(outErrors) > 0 { @@ -211,6 +223,14 @@ func mergeFromBootstrapConfigMerge( if config.Spec.Deployment.LauncherLogLevel == "" { config.Spec.Deployment.LauncherLogLevel = bootstrap.launcherLogLevel } + + if config.Spec.ImagePull.CRISockOverride == "" { + config.Spec.ImagePull.CRISockOverride = bootstrap.criSockOverride + } + + if config.Spec.ImagePull.CRIKindOverride == "" { + config.Spec.ImagePull.CRIKindOverride = bootstrap.criKindOverride + } } func mergeFromBootstrapConfigReplace( @@ -225,6 +245,8 @@ func mergeFromBootstrapConfigReplace( InClusterDNSSuffix: bootstrap.inClusterDNSSuffix, ImagePull: clabernetesapisv1alpha1.ConfigImagePull{ PullThroughOverride: bootstrap.imagePullThroughMode, + CRISockOverride: bootstrap.criSockOverride, + CRIKindOverride: bootstrap.criKindOverride, }, Deployment: clabernetesapisv1alpha1.ConfigDeployment{ ResourcesDefault: bootstrap.resourcesDefault,