Skip to content

Commit

Permalink
Add velero and kubeLB images to the list of mirrored images (#13192) (#…
Browse files Browse the repository at this point in the history
…13198)

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>
  • Loading branch information
ahmedwaleedmalik committed Mar 21, 2024
1 parent 9653c6d commit 26354a5
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/install/images/images.go
Expand Up @@ -473,6 +473,13 @@ func getImagesFromReconcilers(log logrus.FieldLogger, templateData *resources.Te
images = append(images, getImagesFromPodSpec(daemonset.Spec.Template.Spec)...)
}

// Add images for Enterprise Edition addons/components.
additionalImages, err := getAdditionalImagesFromReconcilers(templateData)
if err != nil {
return nil, err
}

images = append(images, additionalImages...)
return images, nil
}

Expand Down Expand Up @@ -628,6 +635,8 @@ func getTemplateData(config *kubermaticv1.KubermaticConfiguration, clusterVersio
resources.OperatingSystemManagerWebhookServingCertSecretName,
resources.KubeVirtCSISecretName,
resources.KubeVirtInfraSecretName,
resources.KubeLBCCMKubeconfigSecretName,
resources.KubeLBManagerKubeconfigSecretName,
})
datacenter := &kubermaticv1.Datacenter{
Spec: kubermaticv1.DatacenterSpec{
Expand Down
29 changes: 29 additions & 0 deletions pkg/install/images/wrappers_ce.go
@@ -0,0 +1,29 @@
//go:build !ee

/*
Copyright 2024 The Kubermatic Kubernetes Platform contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package images

import (
"k8c.io/kubermatic/v2/pkg/resources"
)

// getAdditionalImagesFromReconcilers returns the images used by the reconcilers for Enterprise Edition addons/components.
// Since this is the Community Edition, this function is no-op and would always return nil,nil.
func getAdditionalImagesFromReconcilers(_ *resources.TemplateData) ([]string, error) {
return nil, nil
}
38 changes: 38 additions & 0 deletions pkg/install/images/wrappers_ee.go
@@ -0,0 +1,38 @@
//go:build ee

/*
Copyright 2024 The Kubermatic Kubernetes Platform contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package images

import (
kubelb "k8c.io/kubermatic/v2/pkg/ee/kubelb/resources/seed-cluster"
"k8c.io/kubermatic/v2/pkg/resources"

appsv1 "k8s.io/api/apps/v1"
)

// getAdditionalImagesFromReconcilers returns the images used by the reconcilers for Enterprise Edition addons/components.
func getAdditionalImagesFromReconcilers(templateData *resources.TemplateData) (images []string, err error) {
_, creator := kubelb.DeploymentReconciler(templateData)()
deployment, err := creator(&appsv1.Deployment{})
if err != nil {
return nil, err
}
images = append(images, getImagesFromPodSpec(deployment.Spec.Template.Spec)...)

return images, err
}

0 comments on commit 26354a5

Please sign in to comment.