From 3b253da66bd0f0e92b89a44cb75415e4cbb0dc08 Mon Sep 17 00:00:00 2001 From: Andrea Fasano Date: Thu, 11 Jun 2026 06:38:13 -0400 Subject: [PATCH] bump InternalReleaseImage from v1alpha1 to v1 --- cmd/machine-config-controller/start.go | 8 +- cmd/machine-config-daemon/start.go | 2 +- cmd/machine-config-operator/start.go | 2 +- go.mod | 4 + go.sum | 8 +- ...etion-guard-validatingadmissionpolicy.yaml | 2 +- pkg/controller/bootstrap/bootstrap.go | 9 +- .../certrotation/certrotation_controller.go | 2 +- pkg/controller/certrotation/helpers_test.go | 6 +- pkg/controller/common/iri_secret_merger.go | 8 +- .../common/iri_secret_merger_test.go | 30 +- .../internalreleaseimage/aggregation.go | 37 +- .../internalreleaseimage_bootstrap.go | 3 +- .../internalreleaseimage_bootstrap_test.go | 4 +- .../internalreleaseimage_controller.go | 59 ++- .../internalreleaseimage_controller_test.go | 57 ++- .../internalreleaseimage_helpers_test.go | 15 +- .../internalreleaseimage_renderer.go | 5 +- .../template/template_controller.go | 3 +- .../template/template_controller_test.go | 8 +- .../internalreleaseimage_helpers_test.go | 13 +- .../internalreleaseimage_manager.go | 37 +- .../internalreleaseimage_manager_test.go | 11 +- pkg/operator/operator.go | 6 +- test/e2e-bootstrap/bootstrap_test.go | 2 +- test/e2e-iri/iri_test.go | 29 +- .../openshift/api/.ci-operator.yaml | 2 +- .../github.com/openshift/api/Dockerfile.ocp | 4 +- ...rastructures-TechPreviewNoUpgrade.crd.yaml | 12 +- .../v1alpha1/types_cluster_monitoring.go | 157 ++++++ ...ig-operator_01_clustermonitorings.crd.yaml | 446 ++++++++++++++++++ .../config/v1alpha1/zz_generated.deepcopy.go | 73 +++ .../zz_generated.swagger_doc_generated.go | 24 + vendor/github.com/openshift/api/features.md | 3 +- .../openshift/api/features/features.go | 34 +- .../api/machineconfiguration/v1/register.go | 2 + .../api/machineconfiguration/v1/types.go | 7 + .../v1/types_internalreleaseimage.go | 159 +++++++ ...ollerconfigs-TechPreviewNoUpgrade.crd.yaml | 15 +- ..._internalreleaseimages-Hypershift.crd.yaml | 294 ++++++++++++ ...ternalreleaseimages-SelfManagedHA.crd.yaml | 294 ++++++++++++ .../v1/zz_generated.deepcopy.go | 151 ++++++ ..._generated.featuregated-crd-manifests.yaml | 24 + .../v1/zz_generated.swagger_doc_generated.go | 59 +++ .../openshift/api/operator/v1/types_etcd.go | 4 +- ..._12_etcd_01_etcds-CustomNoUpgrade.crd.yaml | 4 +- ...etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml | 4 +- ...tcd_01_etcds-TechPreviewNoUpgrade.crd.yaml | 4 +- .../v1/zz_generated.swagger_doc_generated.go | 2 +- .../config/v1alpha1/clustermonitoringspec.go | 13 + .../config/v1alpha1/kubestatemetricsconfig.go | 145 ++++++ .../kubestatemetricsresourcelabels.go | 53 +++ .../applyconfigurations/internal/internal.go | 55 +++ .../config/applyconfigurations/utils.go | 4 + .../applyconfigurations/internal/internal.go | 10 + .../v1/internalreleaseimage.go | 280 +++++++++++ .../v1/internalreleaseimagebundlestatus.go | 70 +++ .../v1/internalreleaseimageref.go | 28 ++ .../v1/internalreleaseimagespec.go | 34 ++ .../v1/internalreleaseimagestatus.go | 58 +++ .../applyconfigurations/utils.go | 10 + .../v1/fake/fake_internalreleaseimage.go | 37 ++ .../fake/fake_machineconfiguration_client.go | 4 + .../v1/generated_expansion.go | 2 + .../v1/internalreleaseimage.go | 62 +++ .../v1/machineconfiguration_client.go | 5 + .../informers/externalversions/generic.go | 2 + .../machineconfiguration/v1/interface.go | 7 + .../v1/internalreleaseimage.go | 85 ++++ .../v1/expansion_generated.go | 4 + .../v1/internalreleaseimage.go | 32 ++ vendor/modules.txt | 6 +- 72 files changed, 2923 insertions(+), 231 deletions(-) create mode 100644 vendor/github.com/openshift/api/machineconfiguration/v1/types_internalreleaseimage.go create mode 100644 vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-Hypershift.crd.yaml create mode 100644 vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-SelfManagedHA.crd.yaml create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsconfig.go create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsresourcelabels.go create mode 100644 vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimage.go create mode 100644 vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagebundlestatus.go create mode 100644 vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimageref.go create mode 100644 vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagespec.go create mode 100644 vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagestatus.go create mode 100644 vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_internalreleaseimage.go create mode 100644 vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/internalreleaseimage.go create mode 100644 vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1/internalreleaseimage.go create mode 100644 vendor/github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1/internalreleaseimage.go diff --git a/cmd/machine-config-controller/start.go b/cmd/machine-config-controller/start.go index 4f0ad29019..cf09fa0ae3 100644 --- a/cmd/machine-config-controller/start.go +++ b/cmd/machine-config-controller/start.go @@ -7,7 +7,7 @@ import ( "os" features "github.com/openshift/api/features" - mcfginformersv1alpha1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1alpha1" + mcfginformersv1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1" "github.com/openshift/machine-config-operator/cmd/common" "github.com/openshift/machine-config-operator/internal/clients" bootimagecontroller "github.com/openshift/machine-config-operator/pkg/controller/bootimage" @@ -138,7 +138,7 @@ func runStartCmd(_ *cobra.Command, _ []string) { if ctrlctx.FeatureGatesHandler.Enabled(features.FeatureGateNoRegistryClusterInstall) { iriController := internalreleaseimage.New( - ctrlctx.InformerFactory.Machineconfiguration().V1alpha1().InternalReleaseImages(), + ctrlctx.InformerFactory.Machineconfiguration().V1().InternalReleaseImages(), ctrlctx.InformerFactory.Machineconfiguration().V1().ControllerConfigs(), ctrlctx.InformerFactory.Machineconfiguration().V1().MachineConfigs(), ctrlctx.ConfigInformerFactory.Config().V1().ClusterVersions(), @@ -213,10 +213,10 @@ func createControllers(ctx *ctrlcommon.ControllerContext) []ctrlcommon.Controlle // off, so the informer list call would fail and WaitForCacheSync in the // template controller would block forever. var iriSecretsInformer coreinformersv1.SecretInformer - var iriInformer mcfginformersv1alpha1.InternalReleaseImageInformer + var iriInformer mcfginformersv1.InternalReleaseImageInformer if ctx.FeatureGatesHandler.Enabled(features.FeatureGateNoRegistryClusterInstall) { iriSecretsInformer = ctx.KubeInformerFactory.Core().V1().Secrets() - iriInformer = ctx.InformerFactory.Machineconfiguration().V1alpha1().InternalReleaseImages() + iriInformer = ctx.InformerFactory.Machineconfiguration().V1().InternalReleaseImages() } var controllers []ctrlcommon.Controller diff --git a/cmd/machine-config-daemon/start.go b/cmd/machine-config-daemon/start.go index 60c50fcf01..110fac82d4 100644 --- a/cmd/machine-config-daemon/start.go +++ b/cmd/machine-config-daemon/start.go @@ -240,7 +240,7 @@ func runStartCmd(_ *cobra.Command, _ []string) { internalReleaseImageManager := internalreleaseimage.New( startOpts.nodeName, ctrlctx.ClientBuilder.MachineConfigClientOrDie(componentName), - ctrlctx.InformerFactory.Machineconfiguration().V1alpha1().InternalReleaseImages(), + ctrlctx.InformerFactory.Machineconfiguration().V1().InternalReleaseImages(), ctrlctx.InformerFactory.Machineconfiguration().V1().MachineConfigNodes(), ) go internalReleaseImageManager.Run(1, stopCh) diff --git a/cmd/machine-config-operator/start.go b/cmd/machine-config-operator/start.go index bdf9a5adb5..bdd3b45905 100644 --- a/cmd/machine-config-operator/start.go +++ b/cmd/machine-config-operator/start.go @@ -69,7 +69,7 @@ func runStartCmd(_ *cobra.Command, _ []string) { // Only pass IRI informer when the feature gate is enabled to avoid // watching for a CRD that may not exist - var iriInformer = ctrlctx.InformerFactory.Machineconfiguration().V1alpha1().InternalReleaseImages() + var iriInformer = ctrlctx.InformerFactory.Machineconfiguration().V1().InternalReleaseImages() if !ctrlctx.FeatureGatesHandler.Enabled(features.FeatureGateNoRegistryClusterInstall) { iriInformer = nil } diff --git a/go.mod b/go.mod index 1a98e574c0..0ec014da07 100644 --- a/go.mod +++ b/go.mod @@ -454,3 +454,7 @@ replace ( k8s.io/sample-cli-plugin => github.com/openshift/kubernetes/staging/src/k8s.io/sample-cli-plugin v0.0.0-20260305123649-d18f3f005eaa k8s.io/sample-controller => github.com/openshift/kubernetes/staging/src/k8s.io/sample-controller v0.0.0-20260305123649-d18f3f005eaa ) + +replace github.com/openshift/api => github.com/pawanpinjarkar/api v0.0.0-20260611132132-df7836b66b8f + +replace github.com/openshift/client-go => github.com/andfasano/client-go v0.0.0-20260612090900-fc2da8892827 diff --git a/go.sum b/go.sum index 3ad86611c5..8c6cf6a48b 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,8 @@ github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pO github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= +github.com/andfasano/client-go v0.0.0-20260612090900-fc2da8892827 h1:SCr5UeA/JWWpvWi/qwuZksGS1AIq0get+CRdPuTKJUM= +github.com/andfasano/client-go v0.0.0-20260612090900-fc2da8892827/go.mod h1:rdJfET4sprQrDA4H8/pCnuEtZRaTLKfLFqGySyd5tEc= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= @@ -623,10 +625,6 @@ github.com/opencontainers/selinux v1.13.0 h1:Zza88GWezyT7RLql12URvoxsbLfjFx988+L github.com/opencontainers/selinux v1.13.0/go.mod h1:XxWTed+A/s5NNq4GmYScVy+9jzXhGBVEOAyucdRUY8s= github.com/openshift-eng/openshift-tests-extension v0.0.0-20260127124016-0fed2b824818 h1:jJLE/aCAqDf8U4wc3bE1IEKgIxbb0ICjCNVFA49x/8s= github.com/openshift-eng/openshift-tests-extension v0.0.0-20260127124016-0fed2b824818/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M= -github.com/openshift/api v0.0.0-20260603130340-1ad2ac3eb53d h1:V5l//7MwowilGuUojdEf0VWvqd7iBe4J1U6W9Q7McD4= -github.com/openshift/api v0.0.0-20260603130340-1ad2ac3eb53d/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo= -github.com/openshift/client-go v0.0.0-20260603140539-6892dc3e1ffc h1:yCLc/pmoZ4YZbMWlAnvYZ2YWkLZoPCilO4Fk/oAu2/E= -github.com/openshift/client-go v0.0.0-20260603140539-6892dc3e1ffc/go.mod h1:eqfaEX/V7xHMZ8Mpf72J03RnnY/kEqoZVLpkpjy5p6s= github.com/openshift/kubernetes v1.30.1-0.20260305123649-d18f3f005eaa h1:/gPMWR7fdCC3S4wHALD6Em+vztl1q9/cOpdMkFZwDus= github.com/openshift/kubernetes v1.30.1-0.20260305123649-d18f3f005eaa/go.mod h1:1r2FIoYrPU0110cjYlWAwNcbiqRPLWAgmZK4d0YeEZw= github.com/openshift/kubernetes/staging/src/k8s.io/api v0.0.0-20260305123649-d18f3f005eaa h1:ifOqAFthJWnT1HS6Sq2AcLQWNSJ1+XEiyA9eo+PIcR0= @@ -688,6 +686,8 @@ github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJ github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pawanpinjarkar/api v0.0.0-20260611132132-df7836b66b8f h1:bwjDh4ucX1B+OV+vqoHY52l3abPyIb+Ir+kOUmrmGz8= +github.com/pawanpinjarkar/api v0.0.0-20260611132132-df7836b66b8f/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= diff --git a/manifests/machineconfigcontroller/internalreleaseimage-deletion-guard-validatingadmissionpolicy.yaml b/manifests/machineconfigcontroller/internalreleaseimage-deletion-guard-validatingadmissionpolicy.yaml index 34a46a6326..709dc0cac8 100644 --- a/manifests/machineconfigcontroller/internalreleaseimage-deletion-guard-validatingadmissionpolicy.yaml +++ b/manifests/machineconfigcontroller/internalreleaseimage-deletion-guard-validatingadmissionpolicy.yaml @@ -13,7 +13,7 @@ spec: objectSelector: {} resourceRules: - apiGroups: ["machineconfiguration.openshift.io"] - apiVersions: ["v1alpha1"] + apiVersions: ["v1"] operations: ["DELETE"] resources: ["internalreleaseimages"] scope: "*" diff --git a/pkg/controller/bootstrap/bootstrap.go b/pkg/controller/bootstrap/bootstrap.go index 83fbaec174..b710f1edc0 100644 --- a/pkg/controller/bootstrap/bootstrap.go +++ b/pkg/controller/bootstrap/bootstrap.go @@ -30,7 +30,6 @@ import ( "github.com/openshift/api/features" imagev1 "github.com/openshift/api/image/v1" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" apioperatorsv1alpha1 "github.com/openshift/api/operator/v1alpha1" "github.com/openshift/machine-config-operator/pkg/apihelpers" buildconstants "github.com/openshift/machine-config-operator/pkg/controller/build/constants" @@ -85,7 +84,6 @@ func (b *Bootstrap) Run(destDir string) error { scheme := runtime.NewScheme() mcfgv1.Install(scheme) - mcfgv1alpha1.Install(scheme) apioperatorsv1alpha1.Install(scheme) apicfgv1.Install(scheme) apicfgv1alpha1.Install(scheme) @@ -95,8 +93,7 @@ func (b *Bootstrap) Run(destDir string) error { decoder := codecFactory.UniversalDecoder( mcfgv1.GroupVersion, apioperatorsv1alpha1.GroupVersion, apicfgv1.GroupVersion, apicfgv1alpha1.GroupVersion, - corev1.SchemeGroupVersion, mcfgv1alpha1.GroupVersion, - imagev1.SchemeGroupVersion) + corev1.SchemeGroupVersion, imagev1.SchemeGroupVersion) var ( cconfig *mcfgv1.ControllerConfig @@ -115,7 +112,7 @@ func (b *Bootstrap) Run(destDir string) error { imgCfg *apicfgv1.Image apiServer *apicfgv1.APIServer imageStream *imagev1.ImageStream - iri *mcfgv1alpha1.InternalReleaseImage + iri *mcfgv1.InternalReleaseImage iriTLSCert *corev1.Secret osImageStream *mcfgv1.OSImageStream iriCredentialsSecret *corev1.Secret @@ -184,7 +181,7 @@ func (b *Bootstrap) Run(destDir string) error { if obj.GetName() == ctrlcommon.APIServerInstanceName { apiServer = obj } - case *mcfgv1alpha1.InternalReleaseImage: + case *mcfgv1.InternalReleaseImage: if obj.GetName() == ctrlcommon.InternalReleaseImageInstanceName { iri = obj } diff --git a/pkg/controller/certrotation/certrotation_controller.go b/pkg/controller/certrotation/certrotation_controller.go index a8137849de..1856f92c38 100644 --- a/pkg/controller/certrotation/certrotation_controller.go +++ b/pkg/controller/certrotation/certrotation_controller.go @@ -494,7 +494,7 @@ func (c *CertRotationController) reconcileIRICertificate() { } // Check that the IRI cluster resource exists to confirm the feature is actually enabled - if _, err := c.mcfgClient.MachineconfigurationV1alpha1().InternalReleaseImages().Get(context.TODO(), ctrlcommon.InternalReleaseImageInstanceName, metav1.GetOptions{}); err != nil { + if _, err := c.mcfgClient.MachineconfigurationV1().InternalReleaseImages().Get(context.TODO(), ctrlcommon.InternalReleaseImageInstanceName, metav1.GetOptions{}); err != nil { if k8serrors.IsNotFound(err) { klog.V(4).Infof("Skipping IRI certificate reconciliation: InternalReleaseImage %q not found", ctrlcommon.InternalReleaseImageInstanceName) } else { diff --git a/pkg/controller/certrotation/helpers_test.go b/pkg/controller/certrotation/helpers_test.go index 509e69c818..ef3875db41 100644 --- a/pkg/controller/certrotation/helpers_test.go +++ b/pkg/controller/certrotation/helpers_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" machinev1beta1 "github.com/openshift/api/machine/v1beta1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" + mcfgv1 "github.com/openshift/api/machineconfiguration/v1" ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -55,8 +55,8 @@ func getAROCluster(apiIntIP string) *arov1alpha1.Cluster { } } -func getIRIClusterResource() *mcfgv1alpha1.InternalReleaseImage { - return &mcfgv1alpha1.InternalReleaseImage{ +func getIRIClusterResource() *mcfgv1.InternalReleaseImage { + return &mcfgv1.InternalReleaseImage{ ObjectMeta: metav1.ObjectMeta{ Name: ctrlcommon.InternalReleaseImageInstanceName, }, diff --git a/pkg/controller/common/iri_secret_merger.go b/pkg/controller/common/iri_secret_merger.go index 87de063a35..8c0573406f 100644 --- a/pkg/controller/common/iri_secret_merger.go +++ b/pkg/controller/common/iri_secret_merger.go @@ -9,13 +9,11 @@ import ( features "github.com/openshift/api/features" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" mcfglistersv1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1" - mcfglistersv1alpha1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1alpha1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/klog/v2" corelistersv1 "k8s.io/client-go/listers/core/v1" + "k8s.io/klog/v2" ) // errIRIDisabled is returned by resolve when the NoRegistryClusterInstall @@ -39,7 +37,7 @@ type IRISecretMerger struct { func NewIRISecretMerger( secretLister corelistersv1.SecretLister, ccLister mcfglistersv1.ControllerConfigLister, - iriLister mcfglistersv1alpha1.InternalReleaseImageLister, + iriLister mcfglistersv1.InternalReleaseImageLister, fgHandler FeatureGatesHandler, ) *IRISecretMerger { return &IRISecretMerger{ @@ -75,7 +73,7 @@ func NewIRISecretMergerFromObjects( secret *corev1.Secret, cconfig *mcfgv1.ControllerConfig, fgHandler FeatureGatesHandler, - iri *mcfgv1alpha1.InternalReleaseImage, + iri *mcfgv1.InternalReleaseImage, ) *IRISecretMerger { return &IRISecretMerger{ resolve: func() (string, string, error) { diff --git a/pkg/controller/common/iri_secret_merger_test.go b/pkg/controller/common/iri_secret_merger_test.go index b575a20eb2..a34db7e300 100644 --- a/pkg/controller/common/iri_secret_merger_test.go +++ b/pkg/controller/common/iri_secret_merger_test.go @@ -9,15 +9,13 @@ import ( configv1 "github.com/openshift/api/config/v1" features "github.com/openshift/api/features" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" mcfglistersv1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1" - mcfglistersv1alpha1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1alpha1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/cache" corelistersv1 "k8s.io/client-go/listers/core/v1" + "k8s.io/client-go/tools/cache" ) // --- test helpers --- @@ -47,8 +45,8 @@ func cconfigWithDNS(baseDomain string) *mcfgv1.ControllerConfig { } } -func newIRIObject() *mcfgv1alpha1.InternalReleaseImage { - return &mcfgv1alpha1.InternalReleaseImage{ +func newIRIObject() *mcfgv1.InternalReleaseImage { + return &mcfgv1.InternalReleaseImage{ ObjectMeta: metav1.ObjectMeta{Name: InternalReleaseImageInstanceName}, } } @@ -77,12 +75,12 @@ func newCCLister(cconfigs ...*mcfgv1.ControllerConfig) mcfglistersv1.ControllerC return mcfglistersv1.NewControllerConfigLister(indexer) } -func newIRILister(iris ...*mcfgv1alpha1.InternalReleaseImage) mcfglistersv1alpha1.InternalReleaseImageLister { +func newIRILister(iris ...*mcfgv1.InternalReleaseImage) mcfglistersv1.InternalReleaseImageLister { indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) for _, iri := range iris { indexer.Add(iri) } - return mcfglistersv1alpha1.NewInternalReleaseImageLister(indexer) + return mcfglistersv1.NewInternalReleaseImageLister(indexer) } // --- object-based constructor tests --- @@ -101,7 +99,7 @@ func TestIRISecretMergerFromObjects(t *testing.T) { secret *corev1.Secret cconfig *mcfgv1.ControllerConfig fgHandler FeatureGatesHandler - iri *mcfgv1alpha1.InternalReleaseImage + iri *mcfgv1.InternalReleaseImage expectUnchanged bool expectError bool verifyAuthHost string @@ -237,7 +235,7 @@ func TestIRISecretMergerFromListers(t *testing.T) { pullSecret string secrets []*corev1.Secret cconfigs []*mcfgv1.ControllerConfig - iris []*mcfgv1alpha1.InternalReleaseImage + iris []*mcfgv1.InternalReleaseImage fgHandler FeatureGatesHandler expectUnchanged bool expectError bool @@ -248,7 +246,7 @@ func TestIRISecretMergerFromListers(t *testing.T) { pullSecret: basePullSecret, secrets: []*corev1.Secret{secret}, cconfigs: []*mcfgv1.ControllerConfig{cconfig}, - iris: []*mcfgv1alpha1.InternalReleaseImage{iri}, + iris: []*mcfgv1.InternalReleaseImage{iri}, fgHandler: fgEnabled(), verifyAuthHost: "api-int.example.com:22625", }, @@ -257,7 +255,7 @@ func TestIRISecretMergerFromListers(t *testing.T) { pullSecret: basePullSecret, secrets: []*corev1.Secret{secret}, cconfigs: []*mcfgv1.ControllerConfig{cconfig}, - iris: []*mcfgv1alpha1.InternalReleaseImage{iri}, + iris: []*mcfgv1.InternalReleaseImage{iri}, fgHandler: fgDisabled(), expectUnchanged: true, }, @@ -275,7 +273,7 @@ func TestIRISecretMergerFromListers(t *testing.T) { pullSecret: basePullSecret, secrets: nil, cconfigs: []*mcfgv1.ControllerConfig{cconfig}, - iris: []*mcfgv1alpha1.InternalReleaseImage{iri}, + iris: []*mcfgv1.InternalReleaseImage{iri}, fgHandler: fgEnabled(), expectError: true, }, @@ -284,7 +282,7 @@ func TestIRISecretMergerFromListers(t *testing.T) { pullSecret: pullSecretWithIRIRegistryCredentials("example.com", "testpassword"), secrets: []*corev1.Secret{secret}, cconfigs: []*mcfgv1.ControllerConfig{cconfig}, - iris: []*mcfgv1alpha1.InternalReleaseImage{iri}, + iris: []*mcfgv1.InternalReleaseImage{iri}, fgHandler: fgEnabled(), expectUnchanged: true, }, @@ -293,7 +291,7 @@ func TestIRISecretMergerFromListers(t *testing.T) { pullSecret: pullSecretWithIRIRegistryCredentials("example.com", "oldpassword"), secrets: []*corev1.Secret{newIRIRegistryCredentialsSecret("newpassword")}, cconfigs: []*mcfgv1.ControllerConfig{cconfig}, - iris: []*mcfgv1alpha1.InternalReleaseImage{iri}, + iris: []*mcfgv1.InternalReleaseImage{iri}, fgHandler: fgEnabled(), verifyAuthHost: "api-int.example.com:22625", }, @@ -302,7 +300,7 @@ func TestIRISecretMergerFromListers(t *testing.T) { pullSecret: basePullSecret, secrets: []*corev1.Secret{secret}, cconfigs: []*mcfgv1.ControllerConfig{{ObjectMeta: metav1.ObjectMeta{Name: ControllerConfigName}}}, - iris: []*mcfgv1alpha1.InternalReleaseImage{iri}, + iris: []*mcfgv1.InternalReleaseImage{iri}, fgHandler: fgEnabled(), expectError: true, }, @@ -311,7 +309,7 @@ func TestIRISecretMergerFromListers(t *testing.T) { pullSecret: basePullSecret, secrets: []*corev1.Secret{newIRIRegistryCredentialsSecret("")}, cconfigs: []*mcfgv1.ControllerConfig{cconfig}, - iris: []*mcfgv1alpha1.InternalReleaseImage{iri}, + iris: []*mcfgv1.InternalReleaseImage{iri}, fgHandler: fgEnabled(), expectError: true, }, diff --git a/pkg/controller/internalreleaseimage/aggregation.go b/pkg/controller/internalreleaseimage/aggregation.go index fddaa3711e..e65a73e2f1 100644 --- a/pkg/controller/internalreleaseimage/aggregation.go +++ b/pkg/controller/internalreleaseimage/aggregation.go @@ -10,7 +10,6 @@ import ( "time" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -32,7 +31,7 @@ const ( // aggregateMCNIRIStatus aggregates the IRI status from all control plane MachineConfigNodes // and returns the cluster-wide status for each release bundle, the overall IRI status, // and lists of degraded/not ready nodes. -func (ctrl *Controller) aggregateMCNIRIStatus(iri *mcfgv1alpha1.InternalReleaseImage) ([]mcfgv1alpha1.InternalReleaseImageBundleStatus, string, []string, []string, error) { +func (ctrl *Controller) aggregateMCNIRIStatus(iri *mcfgv1.InternalReleaseImage) ([]mcfgv1.InternalReleaseImageBundleStatus, string, []string, []string, error) { mcns, err := ctrl.mcnLister.List(labels.Everything()) if err != nil { return nil, "", nil, nil, fmt.Errorf("failed to list MachineConfigNodes: %w", err) @@ -122,7 +121,7 @@ func (ctrl *Controller) checkAPIIntRegistryAvailability() (string, string, bool, // mcnReleaseProcessingResult contains the results of processing MCN releases. type mcnReleaseProcessingResult struct { - releaseMap map[string]mcfgv1alpha1.InternalReleaseImageBundleStatus + releaseMap map[string]mcfgv1.InternalReleaseImageBundleStatus iriStatus string degradedNodes []string notReadyNodes []string @@ -130,7 +129,7 @@ type mcnReleaseProcessingResult struct { // processMCNReleases scans through MCNs and builds a release map with node health tracking. func (ctrl *Controller) processMCNReleases(controlPlaneMCNs []*mcfgv1.MachineConfigNode, clusterDomain string) mcnReleaseProcessingResult { - releaseMap := make(map[string]mcfgv1alpha1.InternalReleaseImageBundleStatus) + releaseMap := make(map[string]mcfgv1.InternalReleaseImageBundleStatus) var notReadyNodes []string var degradedNodes []string iriStatus := IRIStatusAllReleasesAvailable @@ -158,7 +157,7 @@ func (ctrl *Controller) processMCNReleases(controlPlaneMCNs []*mcfgv1.MachineCon apiIntImage := transformToAPIIntURL(release.Image, clusterDomain) if _, exists := releaseMap[release.Name]; !exists { - releaseMap[release.Name] = mcfgv1alpha1.InternalReleaseImageBundleStatus{ + releaseMap[release.Name] = mcfgv1.InternalReleaseImageBundleStatus{ Name: release.Name, Image: apiIntImage, Conditions: release.Conditions, @@ -166,7 +165,7 @@ func (ctrl *Controller) processMCNReleases(controlPlaneMCNs []*mcfgv1.MachineCon } else if nodeHealthy { // Prefer healthy node's conditions (overwrite with healthy status) klog.V(4).Infof("Overwriting release %s status with healthy version from node %s", release.Name, mcn.Name) - releaseMap[release.Name] = mcfgv1alpha1.InternalReleaseImageBundleStatus{ + releaseMap[release.Name] = mcfgv1.InternalReleaseImageBundleStatus{ Name: release.Name, Image: apiIntImage, Conditions: release.Conditions, @@ -185,13 +184,13 @@ func (ctrl *Controller) processMCNReleases(controlPlaneMCNs []*mcfgv1.MachineCon // buildAggregatedReleases builds the final aggregated releases list from the release map. func buildAggregatedReleases( - iri *mcfgv1alpha1.InternalReleaseImage, - releaseMap map[string]mcfgv1alpha1.InternalReleaseImageBundleStatus, + iri *mcfgv1.InternalReleaseImage, + releaseMap map[string]mcfgv1.InternalReleaseImageBundleStatus, iriStatus string, degradedNodes, notReadyNodes []string, apiIntRegistryHost string, -) []mcfgv1alpha1.InternalReleaseImageBundleStatus { - aggregatedReleases := []mcfgv1alpha1.InternalReleaseImageBundleStatus{} +) []mcfgv1.InternalReleaseImageBundleStatus { + aggregatedReleases := []mcfgv1.InternalReleaseImageBundleStatus{} for _, specRelease := range iri.Spec.Releases { if releaseStatus, exists := releaseMap[specRelease.Name]; exists { @@ -219,19 +218,19 @@ func buildAggregatedReleases( imageRef := fmt.Sprintf("%s%s@sha256:%s", apiIntRegistryHost, iriRegistryPath, unavailableImageDigest) - aggregatedReleases = append(aggregatedReleases, mcfgv1alpha1.InternalReleaseImageBundleStatus{ + aggregatedReleases = append(aggregatedReleases, mcfgv1.InternalReleaseImageBundleStatus{ Name: specRelease.Name, Image: imageRef, Conditions: []metav1.Condition{ { - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), + Type: string(mcfgv1.InternalReleaseImageConditionTypeAvailable), Status: metav1.ConditionFalse, Reason: "ReleaseImageNotAvailable", Message: "The specified release image is not available", LastTransitionTime: metav1.Now(), }, { - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageConditionTypeDegraded), Status: metav1.ConditionTrue, Reason: degradedReason, Message: degradedMessage, @@ -252,26 +251,26 @@ const ( ) // buildAPIIntUnavailableReleases creates release statuses when api-int is not available -func buildAPIIntUnavailableReleases(specReleases []mcfgv1alpha1.InternalReleaseImageRef, apiIntRegistry string) []mcfgv1alpha1.InternalReleaseImageBundleStatus { - releases := []mcfgv1alpha1.InternalReleaseImageBundleStatus{} +func buildAPIIntUnavailableReleases(specReleases []mcfgv1.InternalReleaseImageRef, apiIntRegistry string) []mcfgv1.InternalReleaseImageBundleStatus { + releases := []mcfgv1.InternalReleaseImageBundleStatus{} for _, specRelease := range specReleases { // Construct a valid OCI image reference (even though registry is unreachable) imageRef := fmt.Sprintf("%s%s@sha256:%s", apiIntRegistry, iriRegistryPath, unavailableImageDigest) - releases = append(releases, mcfgv1alpha1.InternalReleaseImageBundleStatus{ + releases = append(releases, mcfgv1.InternalReleaseImageBundleStatus{ Name: specRelease.Name, Image: imageRef, Conditions: []metav1.Condition{ { - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), + Type: string(mcfgv1.InternalReleaseImageConditionTypeAvailable), Status: metav1.ConditionFalse, Reason: IRIStatusAPIIntNotAvailable, Message: "The specified release image is not available", LastTransitionTime: metav1.Now(), }, { - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageConditionTypeDegraded), Status: metav1.ConditionTrue, Reason: IRIStatusAPIIntNotAvailable, Message: IRIStatusAPIIntNotAvailable, @@ -364,7 +363,7 @@ func updateDegradedCondition(conditions []metav1.Condition, iriStatus string, de copy(updatedConditions, conditions) degradedCondition := metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageConditionTypeDegraded), Status: metav1.ConditionTrue, Reason: reason, Message: message, diff --git a/pkg/controller/internalreleaseimage/internalreleaseimage_bootstrap.go b/pkg/controller/internalreleaseimage/internalreleaseimage_bootstrap.go index 773dd6d7c5..2b73fcc9ae 100644 --- a/pkg/controller/internalreleaseimage/internalreleaseimage_bootstrap.go +++ b/pkg/controller/internalreleaseimage/internalreleaseimage_bootstrap.go @@ -4,11 +4,10 @@ import ( corev1 "k8s.io/api/core/v1" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" ) // RunInternalReleaseImageBootstrap generates the MachineConfig objects for InternalReleaseImage that would have been generated by syncInternalReleaseImage. -func RunInternalReleaseImageBootstrap(iri *mcfgv1alpha1.InternalReleaseImage, iriSecret, iriRegistryCredentialsSecret *corev1.Secret, cconfig *mcfgv1.ControllerConfig) ([]*mcfgv1.MachineConfig, error) { +func RunInternalReleaseImageBootstrap(iri *mcfgv1.InternalReleaseImage, iriSecret, iriRegistryCredentialsSecret *corev1.Secret, cconfig *mcfgv1.ControllerConfig) ([]*mcfgv1.MachineConfig, error) { configs := []*mcfgv1.MachineConfig{} for _, role := range SupportedRoles { diff --git a/pkg/controller/internalreleaseimage/internalreleaseimage_bootstrap_test.go b/pkg/controller/internalreleaseimage/internalreleaseimage_bootstrap_test.go index 62eb1d8826..e0c82a2bb5 100644 --- a/pkg/controller/internalreleaseimage/internalreleaseimage_bootstrap_test.go +++ b/pkg/controller/internalreleaseimage/internalreleaseimage_bootstrap_test.go @@ -3,12 +3,12 @@ package internalreleaseimage import ( "testing" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" + mcfgv1 "github.com/openshift/api/machineconfiguration/v1" "github.com/stretchr/testify/assert" ) func TestRunInternalReleaseImageBootstrap(t *testing.T) { - configs, err := RunInternalReleaseImageBootstrap(&mcfgv1alpha1.InternalReleaseImage{}, iriCertSecret().obj, iriRegistryCredentialsSecret().obj, cconfig().withDNS("example.com").obj) + configs, err := RunInternalReleaseImageBootstrap(&mcfgv1.InternalReleaseImage{}, iriCertSecret().obj, iriRegistryCredentialsSecret().obj, cconfig().withDNS("example.com").obj) assert.NoError(t, err) assert.Len(t, configs, 2) verifyInternalReleaseMasterMachineConfig(t, configs[0]) diff --git a/pkg/controller/internalreleaseimage/internalreleaseimage_controller.go b/pkg/controller/internalreleaseimage/internalreleaseimage_controller.go index 9dd5742be6..1868a15647 100644 --- a/pkg/controller/internalreleaseimage/internalreleaseimage_controller.go +++ b/pkg/controller/internalreleaseimage/internalreleaseimage_controller.go @@ -21,15 +21,12 @@ import ( "k8s.io/klog/v2" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" configinformersv1 "github.com/openshift/client-go/config/informers/externalversions/config/v1" configlistersv1 "github.com/openshift/client-go/config/listers/config/v1" mcfgclientset "github.com/openshift/client-go/machineconfiguration/clientset/versioned" "github.com/openshift/client-go/machineconfiguration/clientset/versioned/scheme" mcfginformersv1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1" - mcfginformersv1alpha1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1alpha1" mcfglistersv1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1" - mcfglistersv1alpha1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1alpha1" ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common" templatectrl "github.com/openshift/machine-config-operator/pkg/controller/template" "github.com/openshift/machine-config-operator/pkg/osimagestream" @@ -60,7 +57,7 @@ type Controller struct { syncHandler func(mcp string) error - iriLister mcfglistersv1alpha1.InternalReleaseImageLister + iriLister mcfglistersv1.InternalReleaseImageLister iriListerSynced cache.InformerSynced ccLister mcfglistersv1.ControllerConfigLister @@ -89,7 +86,7 @@ type Controller struct { // New returns a new InternalReleaseImage controller. func New( - iriInformer mcfginformersv1alpha1.InternalReleaseImageInformer, + iriInformer mcfginformersv1.InternalReleaseImageInformer, ccInformer mcfginformersv1.ControllerConfigInformer, mcInformer mcfginformersv1.MachineConfigInformer, clusterVersionInformer configinformersv1.ClusterVersionInformer, @@ -232,22 +229,22 @@ func (ctrl *Controller) handleErr(err error, key string) { } func (ctrl *Controller) addInternalReleaseImage(obj interface{}) { - iri := obj.(*mcfgv1alpha1.InternalReleaseImage) + iri := obj.(*mcfgv1.InternalReleaseImage) klog.V(4).Infof("Adding InternalReleaseImage %s", iri.Name) ctrl.enqueueInternalReleaseImage() } func (ctrl *Controller) updateInternalReleaseImage(old, cur interface{}) { - oldInternalReleaseImage := old.(*mcfgv1alpha1.InternalReleaseImage) - newInternalReleaseImage := cur.(*mcfgv1alpha1.InternalReleaseImage) + oldInternalReleaseImage := old.(*mcfgv1.InternalReleaseImage) + newInternalReleaseImage := cur.(*mcfgv1.InternalReleaseImage) if ctrl.internalReleaseImageChanged(oldInternalReleaseImage, newInternalReleaseImage) { - klog.V(4).Infof("mcfgv1alpha1.InternalReleaseImage %s updated", newInternalReleaseImage.Name) + klog.V(4).Infof("mcfgv1.InternalReleaseImage %s updated", newInternalReleaseImage.Name) ctrl.enqueueInternalReleaseImage() } } -func (ctrl *Controller) internalReleaseImageChanged(old, newIRI *mcfgv1alpha1.InternalReleaseImage) bool { +func (ctrl *Controller) internalReleaseImageChanged(old, newIRI *mcfgv1.InternalReleaseImage) bool { if old.DeletionTimestamp != newIRI.DeletionTimestamp { return true } @@ -258,14 +255,14 @@ func (ctrl *Controller) internalReleaseImageChanged(old, newIRI *mcfgv1alpha1.In } func (ctrl *Controller) deleteInternalReleaseImage(obj interface{}) { - iri, ok := obj.(*mcfgv1alpha1.InternalReleaseImage) + iri, ok := obj.(*mcfgv1.InternalReleaseImage) if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { utilruntime.HandleError(fmt.Errorf("failed to get object from tombstone %#v", obj)) return } - iri, ok = tombstone.Obj.(*mcfgv1alpha1.InternalReleaseImage) + iri, ok = tombstone.Obj.(*mcfgv1.InternalReleaseImage) if !ok { utilruntime.HandleError(fmt.Errorf("tombstone contained object that is not a InternalReleaseImage %#v", obj)) return @@ -448,7 +445,7 @@ func (ctrl *Controller) enqueueInternalReleaseImage() { ctrl.queue.Add(ctrlcommon.InternalReleaseImageInstanceName) } -func (ctrl *Controller) enqueue(iri *mcfgv1alpha1.InternalReleaseImage) { +func (ctrl *Controller) enqueue(iri *mcfgv1.InternalReleaseImage) { key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(iri) if err != nil { utilruntime.HandleError(fmt.Errorf("couldn't get key for object %#v: %w", iri, err)) @@ -563,7 +560,7 @@ func (ctrl *Controller) syncInternalReleaseImage(key string) (syncErr error) { // initializeInternalReleaseImageStatus initializes the status of an InternalReleaseImage // if it is empty. It populates the status with release bundle entries from the spec, // setting the Image field from the current ClusterVersion and adding initial conditions. -func (ctrl *Controller) initializeInternalReleaseImageStatus(iri *mcfgv1alpha1.InternalReleaseImage) error { +func (ctrl *Controller) initializeInternalReleaseImageStatus(iri *mcfgv1.InternalReleaseImage) error { // Only initialize if status is empty and spec has releases if len(iri.Status.Releases) != 0 || len(iri.Spec.Releases) == 0 { return nil @@ -582,14 +579,14 @@ func (ctrl *Controller) initializeInternalReleaseImageStatus(iri *mcfgv1alpha1.I } // Build status releases from spec releases - statusReleases := make([]mcfgv1alpha1.InternalReleaseImageBundleStatus, 0, len(iri.Spec.Releases)) + statusReleases := make([]mcfgv1.InternalReleaseImageBundleStatus, 0, len(iri.Spec.Releases)) for _, specRelease := range iri.Spec.Releases { - statusRelease := mcfgv1alpha1.InternalReleaseImageBundleStatus{ + statusRelease := mcfgv1.InternalReleaseImageBundleStatus{ Name: specRelease.Name, Image: releaseImage, Conditions: []metav1.Condition{ { - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), + Type: string(mcfgv1.InternalReleaseImageConditionTypeAvailable), Status: metav1.ConditionTrue, LastTransitionTime: metav1.Now(), Reason: "Installed", @@ -604,7 +601,7 @@ func (ctrl *Controller) initializeInternalReleaseImageStatus(iri *mcfgv1alpha1.I // Update the status subresource if err := retry.RetryOnConflict(updateBackoff, func() error { - _, err := ctrl.client.MachineconfigurationV1alpha1().InternalReleaseImages().UpdateStatus(context.TODO(), iri, metav1.UpdateOptions{}) + _, err := ctrl.client.MachineconfigurationV1().InternalReleaseImages().UpdateStatus(context.TODO(), iri, metav1.UpdateOptions{}) return err }); err != nil { return fmt.Errorf("failed to update InternalReleaseImage status: %w", err) @@ -619,7 +616,7 @@ func (ctrl *Controller) initializeInternalReleaseImageStatus(iri *mcfgv1alpha1.I // If err is nil, it sets Degraded=False, otherwise Degraded=True. // This method also aggregates MCN IRI status to centralize all status update logic. func (ctrl *Controller) updateInternalReleaseImageStatusWithReleases( - iri *mcfgv1alpha1.InternalReleaseImage, + iri *mcfgv1.InternalReleaseImage, err error, ) error { // Aggregate MCN IRI status before entering retry loop @@ -630,7 +627,7 @@ func (ctrl *Controller) updateInternalReleaseImageStatusWithReleases( return retry.RetryOnConflict(updateBackoff, func() error { // Get the latest version of the IRI directly from the API server to avoid conflicts - latestIRI, getErr := ctrl.client.MachineconfigurationV1alpha1().InternalReleaseImages().Get(context.TODO(), iri.Name, metav1.GetOptions{}) + latestIRI, getErr := ctrl.client.MachineconfigurationV1().InternalReleaseImages().Get(context.TODO(), iri.Name, metav1.GetOptions{}) if getErr != nil { return getErr } @@ -641,7 +638,7 @@ func (ctrl *Controller) updateInternalReleaseImageStatusWithReleases( if err != nil { // Set Degraded=True when there's a sync error condition = metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), Status: metav1.ConditionTrue, Reason: "SyncError", Message: fmt.Sprintf("Error syncing InternalReleaseImage: %v", err), @@ -652,7 +649,7 @@ func (ctrl *Controller) updateInternalReleaseImageStatusWithReleases( switch iriStatus { case IRIStatusAllReleasesAvailable: condition = metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), Status: metav1.ConditionFalse, Reason: IRIStatusAllReleasesAvailable, Message: "All the release images are available", @@ -670,7 +667,7 @@ func (ctrl *Controller) updateInternalReleaseImageStatusWithReleases( } } condition = metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), Status: metav1.ConditionTrue, Reason: IRIStatusAPIIntNotAvailable, Message: fmt.Sprintf("Unable to reach any registry via %s", apiIntURL), @@ -678,7 +675,7 @@ func (ctrl *Controller) updateInternalReleaseImageStatusWithReleases( } case IRIStatusSomeNodesNotAvailable: condition = metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), Status: metav1.ConditionTrue, Reason: IRIStatusSomeNodesNotAvailable, Message: fmt.Sprintf("The following nodes are not ready: [%s]. See the related Node resource status for more details.", strings.Join(notReadyNodes, ", ")), @@ -686,7 +683,7 @@ func (ctrl *Controller) updateInternalReleaseImageStatusWithReleases( } case IRIStatusSomeRegistriesUnavailable: condition = metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), Status: metav1.ConditionTrue, Reason: IRIStatusSomeRegistriesUnavailable, Message: fmt.Sprintf("The following nodes are degraded: [%s]. See the related MachineConfigNode resource status for more details.", strings.Join(degradedNodes, ", ")), @@ -694,7 +691,7 @@ func (ctrl *Controller) updateInternalReleaseImageStatusWithReleases( } default: condition = metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), Status: metav1.ConditionFalse, Reason: IRIStatusAllReleasesAvailable, Message: "All the release images are available", @@ -720,7 +717,7 @@ func (ctrl *Controller) updateInternalReleaseImageStatusWithReleases( } // Update the status subresource only if something changed - _, updateErr := ctrl.client.MachineconfigurationV1alpha1().InternalReleaseImages().UpdateStatus(context.TODO(), newIRI, metav1.UpdateOptions{}) + _, updateErr := ctrl.client.MachineconfigurationV1().InternalReleaseImages().UpdateStatus(context.TODO(), newIRI, metav1.UpdateOptions{}) return updateErr }) } @@ -737,13 +734,13 @@ func (ctrl *Controller) createOrUpdateMachineConfig(isNotFound bool, mc *mcfgv1. }) } -func (ctrl *Controller) addFinalizerToInternalReleaseImage(iri *mcfgv1alpha1.InternalReleaseImage) error { +func (ctrl *Controller) addFinalizerToInternalReleaseImage(iri *mcfgv1.InternalReleaseImage) error { if ctrlcommon.InSlice(iriFinalizerName, iri.Finalizers) { return nil } iri.Finalizers = append(iri.Finalizers, iriFinalizerName) - _, err := ctrl.client.MachineconfigurationV1alpha1().InternalReleaseImages().Update(context.TODO(), iri, metav1.UpdateOptions{}) + _, err := ctrl.client.MachineconfigurationV1().InternalReleaseImages().Update(context.TODO(), iri, metav1.UpdateOptions{}) return err } @@ -753,7 +750,7 @@ func (ctrl *Controller) addFinalizerToInternalReleaseImage(iri *mcfgv1alpha1.Int // iri-registry service runs exclusively on control-plane nodes. The MCD picks // up the updated MC through its normal sync cycle: NDP fires DaemonReload+Restart, // which stops the old podman container and starts the no-op service. -func (ctrl *Controller) disableAndRemoveFinalizer(iri *mcfgv1alpha1.InternalReleaseImage) error { +func (ctrl *Controller) disableAndRemoveFinalizer(iri *mcfgv1.InternalReleaseImage) error { r := NewSimpleRenderer("master") mc, err := ctrl.mcLister.Get(r.GetMachineConfigName()) @@ -771,6 +768,6 @@ func (ctrl *Controller) disableAndRemoveFinalizer(iri *mcfgv1alpha1.InternalRele } iri.Finalizers = []string{} - _, err = ctrl.client.MachineconfigurationV1alpha1().InternalReleaseImages().Update(context.TODO(), iri, metav1.UpdateOptions{}) + _, err = ctrl.client.MachineconfigurationV1().InternalReleaseImages().Update(context.TODO(), iri, metav1.UpdateOptions{}) return err } diff --git a/pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go b/pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go index ee0d8a79f9..6430437a43 100644 --- a/pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go +++ b/pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go @@ -7,7 +7,6 @@ import ( configv1 "github.com/openshift/api/config/v1" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" configinformers "github.com/openshift/client-go/config/informers/externalversions" "github.com/openshift/client-go/machineconfiguration/clientset/versioned/fake" mcfginformers "github.com/openshift/client-go/machineconfiguration/informers/externalversions" @@ -30,12 +29,12 @@ func TestInternalReleaseImageCreate(t *testing.T) { cases := []struct { name string initialObjects func() []runtime.Object - verify func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) + verify func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) }{ { name: "feature inactive", initialObjects: objs(), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { assert.Nil(t, actualIRI) assert.Nil(t, actualMasterMC) assert.Nil(t, actualWorkerMC) @@ -44,7 +43,7 @@ func TestInternalReleaseImageCreate(t *testing.T) { { name: "add finalizer if not present", initialObjects: objs(iri(), clusterVersion(), cconfig().withDNS("example.com"), iriCertSecret(), iriRegistryCredentialsSecret(), pullSecret()), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { assert.Len(t, actualIRI.Finalizers, 1) assert.Contains(t, actualIRI.Finalizers, iriFinalizerName) }, @@ -54,11 +53,11 @@ func TestInternalReleaseImageCreate(t *testing.T) { initialObjects: objs( iri().finalizer(iriFinalizerName), clusterVersion(), cconfig().withDNS("example.com"), iriCertSecret(), iriRegistryCredentialsSecret(), pullSecret()), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { assert.Len(t, actualIRI.Status.Releases, 1) assert.Equal(t, actualIRI.Status.Releases[0].Name, "ocp-release-bundle-4.21.5-x86_64") assert.Equal(t, actualIRI.Status.Releases[0].Image, "ocp-4.21-release-pullspec") - assert.Equal(t, actualIRI.Status.Releases[0].Conditions[0].Type, string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable)) + assert.Equal(t, actualIRI.Status.Releases[0].Conditions[0].Type, string(mcfgv1.InternalReleaseImageConditionTypeAvailable)) assert.Equal(t, actualIRI.Status.Releases[0].Conditions[0].Status, metav1.ConditionTrue) assert.Equal(t, actualIRI.Status.Releases[0].Conditions[0].Message, "Release bundle is available") }, @@ -66,7 +65,7 @@ func TestInternalReleaseImageCreate(t *testing.T) { { name: "generate iri machine-config if not present", initialObjects: objs(iri(), clusterVersion(), cconfig().withDNS("example.com"), iriCertSecret(), iriRegistryCredentialsSecret(), pullSecret()), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { verifyInternalReleaseMasterMachineConfig(t, actualMasterMC) verifyInternalReleaseWorkerMachineConfig(t, actualWorkerMC) }, @@ -78,7 +77,7 @@ func TestInternalReleaseImageCreate(t *testing.T) { clusterVersion(), cconfig().withDNS("example.com"), iriCertSecret(), iriRegistryCredentialsSecret(), pullSecret(), machineconfigmaster().ignition("some garbage"), machineconfigworker().ignition("other garbage")), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { verifyInternalReleaseMasterMachineConfig(t, actualMasterMC) verifyInternalReleaseWorkerMachineConfig(t, actualWorkerMC) }, @@ -89,7 +88,7 @@ func TestInternalReleaseImageCreate(t *testing.T) { iri().finalizer(iriFinalizerName), clusterVersion(), cconfig().dockerRegistryImage("a-new-docker-registry-image-pullspec").withDNS("example.com"), iriCertSecret(), iriRegistryCredentialsSecret(), pullSecret(), machineconfigmaster(), machineconfigworker()), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { verifyInternalReleaseMasterMachineConfig(t, actualMasterMC) verifyInternalReleaseWorkerMachineConfig(t, actualWorkerMC) }, @@ -100,7 +99,7 @@ func TestInternalReleaseImageCreate(t *testing.T) { iri().finalizer(iriFinalizerName).setDeletionTimestamp(), clusterVersion(), cconfig(), iriCertSecret(), machineconfigmaster(), machineconfigworker()), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { assert.NotNil(t, actualIRI) assert.Empty(t, actualIRI.Finalizers) verifyDisabledMasterMachineConfig(t, actualMasterMC) @@ -112,10 +111,10 @@ func TestInternalReleaseImageCreate(t *testing.T) { iri().finalizer(iriFinalizerName), clusterVersion(), cconfig().withDNS("example.com"), iriCertSecret(), iriRegistryCredentialsSecret(), pullSecret(), machineconfigmaster(), machineconfigworker()), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage, actualMasterMC *mcfgv1.MachineConfig, actualWorkerMC *mcfgv1.MachineConfig) { assert.NotNil(t, actualIRI) assert.Len(t, actualIRI.Status.Conditions, 1) - assert.Equal(t, string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) + assert.Equal(t, string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) assert.Equal(t, metav1.ConditionFalse, actualIRI.Status.Conditions[0].Status) assert.Equal(t, "AllReleasesAvailable", actualIRI.Status.Conditions[0].Reason) assert.Equal(t, "All the release images are available", actualIRI.Status.Conditions[0].Message) @@ -129,7 +128,7 @@ func TestInternalReleaseImageCreate(t *testing.T) { f.run(ctrlcommon.InternalReleaseImageInstanceName) if tc.verify != nil { - actualIRI, err := f.client.MachineconfigurationV1alpha1().InternalReleaseImages().Get(context.TODO(), ctrlcommon.InternalReleaseImageInstanceName, v1.GetOptions{}) + actualIRI, err := f.client.MachineconfigurationV1().InternalReleaseImages().Get(context.TODO(), ctrlcommon.InternalReleaseImageInstanceName, v1.GetOptions{}) if err != nil { if !errors.IsNotFound(err) { t.Errorf("Error while running sync step: %v", err) @@ -164,17 +163,17 @@ func TestInternalReleaseImageStatusOnError(t *testing.T) { cases := []struct { name string initialObjects func() []runtime.Object - verify func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage) + verify func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage) }{ { name: "status condition Degraded=True when ControllerConfig is missing", initialObjects: objs( iri(), clusterVersion(), iriCertSecret()), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage) { assert.NotNil(t, actualIRI) assert.Len(t, actualIRI.Status.Conditions, 1) - assert.Equal(t, string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) + assert.Equal(t, string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) assert.Equal(t, metav1.ConditionTrue, actualIRI.Status.Conditions[0].Status) assert.Equal(t, "SyncError", actualIRI.Status.Conditions[0].Reason) assert.Contains(t, actualIRI.Status.Conditions[0].Message, "could not get ControllerConfig") @@ -185,10 +184,10 @@ func TestInternalReleaseImageStatusOnError(t *testing.T) { initialObjects: objs( iri(), clusterVersion(), cconfig()), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage) { assert.NotNil(t, actualIRI) assert.Len(t, actualIRI.Status.Conditions, 1) - assert.Equal(t, string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) + assert.Equal(t, string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) assert.Equal(t, metav1.ConditionTrue, actualIRI.Status.Conditions[0].Status) assert.Equal(t, "SyncError", actualIRI.Status.Conditions[0].Reason) assert.Contains(t, actualIRI.Status.Conditions[0].Message, "could not get Secret") @@ -204,7 +203,7 @@ func TestInternalReleaseImageStatusOnError(t *testing.T) { f.runController(ctrlcommon.InternalReleaseImageInstanceName, true) if tc.verify != nil { - actualIRI, err := f.client.MachineconfigurationV1alpha1().InternalReleaseImages().Get(context.TODO(), ctrlcommon.InternalReleaseImageInstanceName, v1.GetOptions{}) + actualIRI, err := f.client.MachineconfigurationV1().InternalReleaseImages().Get(context.TODO(), ctrlcommon.InternalReleaseImageInstanceName, v1.GetOptions{}) if err != nil { if !errors.IsNotFound(err) { t.Errorf("Error getting IRI: %v", err) @@ -226,7 +225,7 @@ type fixture struct { k8sClient *k8sfake.Clientset configClient *fakeconfigv1client.Clientset - iriLister []*mcfgv1alpha1.InternalReleaseImage + iriLister []*mcfgv1.InternalReleaseImage ccLister []*mcfgv1.ControllerConfig mcLister []*mcfgv1.MachineConfig mcnLister []*mcfgv1.MachineConfigNode @@ -270,7 +269,7 @@ func (f *fixture) setupObjects(objs []runtime.Object) { default: f.objects = append(f.objects, obj) switch o := obj.(type) { - case *mcfgv1alpha1.InternalReleaseImage: + case *mcfgv1.InternalReleaseImage: f.iriLister = append(f.iriLister, o) case *mcfgv1.ControllerConfig: f.ccLister = append(f.ccLister, o) @@ -293,7 +292,7 @@ func (f *fixture) newController() *Controller { ci := configinformers.NewSharedInformerFactory(f.configClient, func() time.Duration { return 0 }()) c := New( - i.Machineconfiguration().V1alpha1().InternalReleaseImages(), + i.Machineconfiguration().V1().InternalReleaseImages(), i.Machineconfiguration().V1().ControllerConfigs(), i.Machineconfiguration().V1().MachineConfigs(), ci.Config().V1().ClusterVersions(), @@ -327,7 +326,7 @@ func (f *fixture) newController() *Controller { ci.WaitForCacheSync(stopCh) for _, c := range f.iriLister { - i.Machineconfiguration().V1alpha1().InternalReleaseImages().Informer().GetIndexer().Add(c) + i.Machineconfiguration().V1().InternalReleaseImages().Informer().GetIndexer().Add(c) } for _, c := range f.ccLister { i.Machineconfiguration().V1().ControllerConfigs().Informer().GetIndexer().Add(c) @@ -371,7 +370,7 @@ func TestAggregateIRIStatus(t *testing.T) { cases := []struct { name string initialObjects func() []runtime.Object - verify func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage) + verify func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage) }{ { name: "nodes-not-ready: some nodes not ready produces SomeNodesUnavailable", @@ -392,10 +391,10 @@ func TestAggregateIRIStatus(t *testing.T) { node("master-2"), infrastructure(), ), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage) { assert.NotNil(t, actualIRI) assert.Len(t, actualIRI.Status.Conditions, 1) - assert.Equal(t, string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) + assert.Equal(t, string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) assert.Equal(t, metav1.ConditionTrue, actualIRI.Status.Conditions[0].Status) // Note: api-int ping will fail in unit tests, so may get ApiIntNotAvailable @@ -427,10 +426,10 @@ func TestAggregateIRIStatus(t *testing.T) { node("master-2"), infrastructure(), ), - verify: func(t *testing.T, actualIRI *mcfgv1alpha1.InternalReleaseImage) { + verify: func(t *testing.T, actualIRI *mcfgv1.InternalReleaseImage) { assert.NotNil(t, actualIRI) assert.Len(t, actualIRI.Status.Conditions, 1) - assert.Equal(t, string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) + assert.Equal(t, string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), actualIRI.Status.Conditions[0].Type) assert.Equal(t, metav1.ConditionTrue, actualIRI.Status.Conditions[0].Status) assert.NotEmpty(t, actualIRI.Status.Conditions[0].Reason) @@ -448,7 +447,7 @@ func TestAggregateIRIStatus(t *testing.T) { f.run(ctrlcommon.InternalReleaseImageInstanceName) if tc.verify != nil { - actualIRI, err := f.client.MachineconfigurationV1alpha1().InternalReleaseImages().Get(context.TODO(), ctrlcommon.InternalReleaseImageInstanceName, v1.GetOptions{}) + actualIRI, err := f.client.MachineconfigurationV1().InternalReleaseImages().Get(context.TODO(), ctrlcommon.InternalReleaseImageInstanceName, v1.GetOptions{}) if err != nil { if !errors.IsNotFound(err) { t.Errorf("Error while running sync step: %v", err) diff --git a/pkg/controller/internalreleaseimage/internalreleaseimage_helpers_test.go b/pkg/controller/internalreleaseimage/internalreleaseimage_helpers_test.go index f03d9856b5..f27e69eb99 100644 --- a/pkg/controller/internalreleaseimage/internalreleaseimage_helpers_test.go +++ b/pkg/controller/internalreleaseimage/internalreleaseimage_helpers_test.go @@ -10,7 +10,6 @@ import ( ign3types "github.com/coreos/ignition/v2/config/v3_5/types" configv1 "github.com/openshift/api/config/v1" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common" templatectrl "github.com/openshift/machine-config-operator/pkg/controller/template" "github.com/stretchr/testify/assert" @@ -97,17 +96,17 @@ type objBuilder interface { // iriBuilder simplifies the creation of an InternalReleaseImage resource in the test. type iriBuilder struct { - obj *mcfgv1alpha1.InternalReleaseImage + obj *mcfgv1.InternalReleaseImage } func iri() *iriBuilder { return &iriBuilder{ - obj: &mcfgv1alpha1.InternalReleaseImage{ + obj: &mcfgv1.InternalReleaseImage{ ObjectMeta: v1.ObjectMeta{ Name: ctrlcommon.InternalReleaseImageInstanceName, }, - Spec: mcfgv1alpha1.InternalReleaseImageSpec{ - Releases: []mcfgv1alpha1.InternalReleaseImageRef{ + Spec: mcfgv1.InternalReleaseImageSpec{ + Releases: []mcfgv1.InternalReleaseImageRef{ { Name: "ocp-release-bundle-4.21.5-x86_64", }, @@ -313,12 +312,12 @@ func mcn(name string) *machineConfigNodeBuilder { Image: "localhost:22625/openshift/release-images@sha256:abc123", Conditions: []v1.Condition{ { - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), + Type: string(mcfgv1.InternalReleaseImageConditionTypeAvailable), Status: v1.ConditionTrue, Reason: "ReleaseImageAvailable", }, { - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageConditionTypeDegraded), Status: v1.ConditionFalse, Reason: "ReleaseImageAvailable", }, @@ -349,7 +348,7 @@ func (mb *machineConfigNodeBuilder) degraded() *machineConfigNodeBuilder { // Mark release as degraded for i := range mb.obj.Status.InternalReleaseImage.Releases { for j := range mb.obj.Status.InternalReleaseImage.Releases[i].Conditions { - if mb.obj.Status.InternalReleaseImage.Releases[i].Conditions[j].Type == string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded) { + if mb.obj.Status.InternalReleaseImage.Releases[i].Conditions[j].Type == string(mcfgv1.InternalReleaseImageConditionTypeDegraded) { mb.obj.Status.InternalReleaseImage.Releases[i].Conditions[j].Status = v1.ConditionTrue mb.obj.Status.InternalReleaseImage.Releases[i].Conditions[j].Reason = "RegistryUnreachable" } diff --git a/pkg/controller/internalreleaseimage/internalreleaseimage_renderer.go b/pkg/controller/internalreleaseimage/internalreleaseimage_renderer.go index b1052a009f..47f40bf283 100644 --- a/pkg/controller/internalreleaseimage/internalreleaseimage_renderer.go +++ b/pkg/controller/internalreleaseimage/internalreleaseimage_renderer.go @@ -13,7 +13,6 @@ import ( corev1 "k8s.io/api/core/v1" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common" templatectrl "github.com/openshift/machine-config-operator/pkg/controller/template" "github.com/openshift/machine-config-operator/pkg/version" @@ -38,7 +37,7 @@ var ( // a MachineConfig instance when required. type Renderer struct { role string - iri *mcfgv1alpha1.InternalReleaseImage + iri *mcfgv1.InternalReleaseImage iriSecret *corev1.Secret iriRegistryCredentialsSecret *corev1.Secret cconfig *mcfgv1.ControllerConfig @@ -46,7 +45,7 @@ type Renderer struct { // NewRendererByRole creates a new Renderer instance for generating // the machine config for the given role. -func NewRendererByRole(role string, iri *mcfgv1alpha1.InternalReleaseImage, iriSecret, iriRegistryCredentialsSecret *corev1.Secret, cconfig *mcfgv1.ControllerConfig) *Renderer { +func NewRendererByRole(role string, iri *mcfgv1.InternalReleaseImage, iriSecret, iriRegistryCredentialsSecret *corev1.Secret, cconfig *mcfgv1.ControllerConfig) *Renderer { return &Renderer{ role: role, iri: iri, diff --git a/pkg/controller/template/template_controller.go b/pkg/controller/template/template_controller.go index c7e2b68e25..4df13cdef9 100644 --- a/pkg/controller/template/template_controller.go +++ b/pkg/controller/template/template_controller.go @@ -20,7 +20,6 @@ import ( mcfgclientset "github.com/openshift/client-go/machineconfiguration/clientset/versioned" "github.com/openshift/client-go/machineconfiguration/clientset/versioned/scheme" mcfginformersv1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1" - mcfginformersv1alpha1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1alpha1" mcfglistersv1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1" mcoResourceApply "github.com/openshift/machine-config-operator/lib/resourceapply" ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common" @@ -89,7 +88,7 @@ func New( ccInformer mcfginformersv1.ControllerConfigInformer, secretsInformer coreinformersv1.SecretInformer, iriSecretsInformer coreinformersv1.SecretInformer, - iriInformer mcfginformersv1alpha1.InternalReleaseImageInformer, + iriInformer mcfginformersv1.InternalReleaseImageInformer, apiserverInformer configinformersv1.APIServerInformer, kubeClient clientset.Interface, mcfgClient mcfgclientset.Interface, diff --git a/pkg/controller/template/template_controller_test.go b/pkg/controller/template/template_controller_test.go index 662cdc7322..b642013bca 100644 --- a/pkg/controller/template/template_controller_test.go +++ b/pkg/controller/template/template_controller_test.go @@ -30,7 +30,6 @@ import ( features "github.com/openshift/api/features" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common" "github.com/openshift/client-go/machineconfiguration/clientset/versioned/fake" @@ -133,7 +132,7 @@ func (f *fixture) newController() *Controller { i.Machineconfiguration().V1().ControllerConfigs(), cinformer.Core().V1().Secrets(), cinformer.Core().V1().Secrets(), // iriSecretsInformer: reuse same factory in tests; not exercised here - iriInformers.Machineconfiguration().V1alpha1().InternalReleaseImages(), + iriInformers.Machineconfiguration().V1().InternalReleaseImages(), apiserverinformer.Config().V1().APIServers(), f.kubeclient, f.client, f.fgHandler) @@ -306,7 +305,6 @@ func (f *fixture) expectGetSecretAction(secret *corev1.Secret) { f.kubeactions = append(f.kubeactions, core.NewGetAction(schema.GroupVersionResource{Resource: "secrets"}, secret.Namespace, secret.Name)) } - func (f *fixture) expectUpdateControllerConfigStatus(status *mcfgv1.ControllerConfig) { f.actions = append(f.actions, core.NewRootUpdateSubresourceAction(schema.GroupVersionResource{Resource: "controllerconfigs"}, "status", status)) } @@ -570,7 +568,7 @@ func TestMergesIRIRegistryCredentialsIntoPullSecret(t *testing.T) { f.ccLister = append(f.ccLister, cc) f.objects = append(f.objects, cc) f.kubeobjects = append(f.kubeobjects, ps, iriRegistryCredentialsSecret) - f.iriObjects = append(f.iriObjects, &mcfgv1alpha1.InternalReleaseImage{ + f.iriObjects = append(f.iriObjects, &mcfgv1.InternalReleaseImage{ ObjectMeta: metav1.ObjectMeta{Name: ctrlcommon.InternalReleaseImageInstanceName}, }) f.fgHandler = ctrlcommon.NewFeatureGatesHardcodedHandler( @@ -633,4 +631,4 @@ func TestMergesIRIRegistryCredentialsIntoPullSecret(t *testing.T) { if _, found := auths["quay.io"]; !found { t.Error("original quay.io auth entry was dropped from pull secret") } -} \ No newline at end of file +} diff --git a/pkg/daemon/internalreleaseimage/internalreleaseimage_helpers_test.go b/pkg/daemon/internalreleaseimage/internalreleaseimage_helpers_test.go index d1fe7d20ec..94c64eb962 100644 --- a/pkg/daemon/internalreleaseimage/internalreleaseimage_helpers_test.go +++ b/pkg/daemon/internalreleaseimage/internalreleaseimage_helpers_test.go @@ -2,7 +2,6 @@ package internalreleaseimage import ( mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" "github.com/openshift/machine-config-operator/pkg/controller/common" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -11,17 +10,17 @@ import ( // iriBuilder simplifies the creation of an InternalReleaseImage resource in the test. type iriBuilder struct { - obj *mcfgv1alpha1.InternalReleaseImage + obj *mcfgv1.InternalReleaseImage } func iri() *iriBuilder { return &iriBuilder{ - obj: &mcfgv1alpha1.InternalReleaseImage{ + obj: &mcfgv1.InternalReleaseImage{ ObjectMeta: v1.ObjectMeta{ Name: common.InternalReleaseImageInstanceName, }, - Spec: mcfgv1alpha1.InternalReleaseImageSpec{ - Releases: []mcfgv1alpha1.InternalReleaseImageRef{ + Spec: mcfgv1.InternalReleaseImageSpec{ + Releases: []mcfgv1.InternalReleaseImageRef{ { Name: "ocp-release-bundle-4.21.5-x86_64", }, @@ -71,11 +70,11 @@ func (mb *mcnBuilder) withIRIBundle(bundleName string, image string) *mcnBuilder Image: image, Conditions: []v1.Condition{ { - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageConditionTypeDegraded), Status: metav1.ConditionFalse, }, { - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), + Type: string(mcfgv1.InternalReleaseImageConditionTypeAvailable), Status: metav1.ConditionTrue, }, }, diff --git a/pkg/daemon/internalreleaseimage/internalreleaseimage_manager.go b/pkg/daemon/internalreleaseimage/internalreleaseimage_manager.go index ca03feaaf7..a3f740ac85 100644 --- a/pkg/daemon/internalreleaseimage/internalreleaseimage_manager.go +++ b/pkg/daemon/internalreleaseimage/internalreleaseimage_manager.go @@ -23,12 +23,9 @@ import ( "k8s.io/klog/v2" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" mcfgclientset "github.com/openshift/client-go/machineconfiguration/clientset/versioned" mcfginformersv1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1" - mcfginformersv1alpha1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1alpha1" mcfglistersv1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1" - mcfglistersv1alpha1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1alpha1" "github.com/openshift/machine-config-operator/pkg/controller/common" "github.com/openshift/machine-config-operator/pkg/daemon/constants" ) @@ -52,10 +49,10 @@ type Manager struct { registryDataPath string syncHandler func(iri string) error - enqueueInternalReleaseImage func(*mcfgv1alpha1.InternalReleaseImage) + enqueueInternalReleaseImage func(*mcfgv1.InternalReleaseImage) queue workqueue.TypedRateLimitingInterface[string] - iriLister mcfglistersv1alpha1.InternalReleaseImageLister + iriLister mcfglistersv1.InternalReleaseImageLister iriListerSynced cache.InformerSynced mcnLister mcfglistersv1.MachineConfigNodeLister @@ -66,7 +63,7 @@ type Manager struct { func New( nodeName string, mcfgClient mcfgclientset.Interface, - iriInformer mcfginformersv1alpha1.InternalReleaseImageInformer, + iriInformer mcfginformersv1.InternalReleaseImageInformer, mcnInformer mcfginformersv1.MachineConfigNodeInformer, ) *Manager { i := &Manager{ @@ -127,7 +124,7 @@ func (i *Manager) Run(workers int, stopCh <-chan struct{}) { <-stopCh } -func (i *Manager) enqueue(iri *mcfgv1alpha1.InternalReleaseImage) { +func (i *Manager) enqueue(iri *mcfgv1.InternalReleaseImage) { key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(iri) if err != nil { utilruntime.HandleError(fmt.Errorf("couldn't get key for object %#v: %w", iri, err)) @@ -174,22 +171,22 @@ func (i *Manager) handleErr(err error, key string) { } func (i *Manager) addInternalReleaseImage(obj interface{}) { - iri := obj.(*mcfgv1alpha1.InternalReleaseImage) + iri := obj.(*mcfgv1.InternalReleaseImage) klog.V(4).Infof("Adding InternalReleaseImage %s", iri.Name) i.enqueueInternalReleaseImage(iri) } func (i *Manager) updateInternalReleaseImage(old, cur interface{}) { - oldInternalReleaseImage := old.(*mcfgv1alpha1.InternalReleaseImage) - newInternalReleaseImage := cur.(*mcfgv1alpha1.InternalReleaseImage) + oldInternalReleaseImage := old.(*mcfgv1.InternalReleaseImage) + newInternalReleaseImage := cur.(*mcfgv1.InternalReleaseImage) if i.internalReleaseImageChanged(oldInternalReleaseImage, newInternalReleaseImage) { - klog.V(4).Infof("mcfgv1alpha1.InternalReleaseImage %s updated", newInternalReleaseImage.Name) + klog.V(4).Infof("mcfgv1.InternalReleaseImage %s updated", newInternalReleaseImage.Name) i.enqueueInternalReleaseImage(newInternalReleaseImage) } } -func (i *Manager) internalReleaseImageChanged(old, newIRI *mcfgv1alpha1.InternalReleaseImage) bool { +func (i *Manager) internalReleaseImageChanged(old, newIRI *mcfgv1.InternalReleaseImage) bool { if old.DeletionTimestamp != newIRI.DeletionTimestamp { return true } @@ -200,14 +197,14 @@ func (i *Manager) internalReleaseImageChanged(old, newIRI *mcfgv1alpha1.Internal } func (i *Manager) deleteInternalReleaseImage(obj interface{}) { - iri, ok := obj.(*mcfgv1alpha1.InternalReleaseImage) + iri, ok := obj.(*mcfgv1.InternalReleaseImage) if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { utilruntime.HandleError(fmt.Errorf("failed to get object from tombstone %#v", obj)) return } - iri, ok = tombstone.Obj.(*mcfgv1alpha1.InternalReleaseImage) + iri, ok = tombstone.Obj.(*mcfgv1.InternalReleaseImage) if !ok { utilruntime.HandleError(fmt.Errorf("tombstone contained object that is not a InternalReleaseImage %#v", obj)) return @@ -291,13 +288,13 @@ func (i *Manager) refreshMachineConfigNodeStatus(mcn *mcfgv1.MachineConfigNode, err := iriReg.CheckImageAvailability(r.Image) if err == nil { meta.SetStatusCondition(&r.Conditions, metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageConditionTypeDegraded), Status: metav1.ConditionFalse, Reason: "ReleaseImageAvailable", Message: "ReleaseImageAvailable", }) meta.SetStatusCondition(&r.Conditions, metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), + Type: string(mcfgv1.InternalReleaseImageConditionTypeAvailable), Status: metav1.ConditionTrue, Reason: "ReleaseImageAvailable", Message: "The specified release image is available", @@ -306,13 +303,13 @@ func (i *Manager) refreshMachineConfigNodeStatus(mcn *mcfgv1.MachineConfigNode, mcnDegraded = true klog.Errorf("Release image %s not available for bundle %s. Error: %v", r.Image, r.Name, err) meta.SetStatusCondition(&r.Conditions, metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageConditionTypeDegraded), Status: metav1.ConditionTrue, Reason: "ReleaseImageNotFound", Message: err.Error(), }) meta.SetStatusCondition(&r.Conditions, metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), + Type: string(mcfgv1.InternalReleaseImageConditionTypeAvailable), Status: metav1.ConditionFalse, Reason: "ReleaseImageNotFound", Message: "The specified release image was not found in the registry", @@ -354,13 +351,13 @@ func (i *Manager) setMachineConfigNodeAsDegraded(mcn *mcfgv1.MachineConfigNode, r := &mcnUpdated.Status.InternalReleaseImage.Releases[n] meta.SetStatusCondition(&r.Conditions, metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), + Type: string(mcfgv1.InternalReleaseImageConditionTypeDegraded), Status: metav1.ConditionTrue, Reason: reason, Message: registryErr.Error(), }) meta.SetStatusCondition(&r.Conditions, metav1.Condition{ - Type: string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), + Type: string(mcfgv1.InternalReleaseImageConditionTypeAvailable), Status: metav1.ConditionFalse, Reason: reason, Message: "Release bundle is unavailable: failed to reach the registry", diff --git a/pkg/daemon/internalreleaseimage/internalreleaseimage_manager_test.go b/pkg/daemon/internalreleaseimage/internalreleaseimage_manager_test.go index 49689f2094..8721845031 100644 --- a/pkg/daemon/internalreleaseimage/internalreleaseimage_manager_test.go +++ b/pkg/daemon/internalreleaseimage/internalreleaseimage_manager_test.go @@ -14,7 +14,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" "github.com/openshift/client-go/machineconfiguration/clientset/versioned/fake" mcfginformers "github.com/openshift/client-go/machineconfiguration/informers/externalversions" "github.com/openshift/machine-config-operator/pkg/controller/common" @@ -65,8 +64,8 @@ func TestInternalReleaseImageManager(t *testing.T) { r := mcn.Status.InternalReleaseImage.Releases[0] assert.Equal(t, "ocp-release-bundle-4.22.0-0.ci-2026-04-01-050515", r.Name) assert.Equal(t, "localhost:22625/openshift/release-images@sha256:68bdf24405449be5c78a1f27a7b64fc9ee980e4bc3c9b169e8b3da08e50e0389", r.Image) - verifyCondition(t, r.Conditions, string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), metav1.ConditionTrue) - verifyCondition(t, r.Conditions, string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), metav1.ConditionFalse) + verifyCondition(t, r.Conditions, string(mcfgv1.InternalReleaseImageConditionTypeAvailable), metav1.ConditionTrue) + verifyCondition(t, r.Conditions, string(mcfgv1.InternalReleaseImageConditionTypeDegraded), metav1.ConditionFalse) }, }, { @@ -102,8 +101,8 @@ func TestInternalReleaseImageManager(t *testing.T) { r := mcn.Status.InternalReleaseImage.Releases[0] assert.Equal(t, "ocp-release-bundle-4.22.0-0.ci-2026-04-01-050515", r.Name) assert.Equal(t, "localhost:22625/openshift/release-images@sha256:68bdf24405449be5c78a1f27a7b64fc9ee980e4bc3c9b169e8b3da08e50e0389", r.Image) - verifyCondition(t, r.Conditions, string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), metav1.ConditionFalse) - verifyCondition(t, r.Conditions, string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), metav1.ConditionTrue) + verifyCondition(t, r.Conditions, string(mcfgv1.InternalReleaseImageConditionTypeAvailable), metav1.ConditionFalse) + verifyCondition(t, r.Conditions, string(mcfgv1.InternalReleaseImageConditionTypeDegraded), metav1.ConditionTrue) }, }, { @@ -170,7 +169,7 @@ func TestInternalReleaseImageManager(t *testing.T) { fakeMCClient := fake.NewClientset(tc.mcn.obj) mcInformerFactory := mcfginformers.NewSharedInformerFactory(fakeMCClient, func() time.Duration { return 0 }()) - iriInformer := mcInformerFactory.Machineconfiguration().V1alpha1().InternalReleaseImages() + iriInformer := mcInformerFactory.Machineconfiguration().V1().InternalReleaseImages() mcnInformer := mcInformerFactory.Machineconfiguration().V1().MachineConfigNodes() mcInformerFactory.Start(ctx.Done()) diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index d512cbd8d3..a5e554c967 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -48,10 +48,8 @@ import ( mcfgclientset "github.com/openshift/client-go/machineconfiguration/clientset/versioned" "github.com/openshift/client-go/machineconfiguration/clientset/versioned/scheme" mcfginformersv1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1" - mcfginformersv1alpha1 "github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1alpha1" mcfglistersv1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1" - mcfglistersv1alpha1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1alpha1" mcopclientset "github.com/openshift/client-go/operator/clientset/versioned" mcopinformersv1 "github.com/openshift/client-go/operator/informers/externalversions/operator/v1" @@ -127,7 +125,7 @@ type Operator struct { apiserverLister configlistersv1.APIServerLister clusterVersionLister configlistersv1.ClusterVersionLister osImageStreamLister mcfglistersv1.OSImageStreamLister - iriLister mcfglistersv1alpha1.InternalReleaseImageLister + iriLister mcfglistersv1.InternalReleaseImageLister provisioningLister dynamiclister.Lister provisioningListerSynced cache.InformerSynced @@ -228,7 +226,7 @@ func New( moscInformer mcfginformersv1.MachineOSConfigInformer, clusterVersionInformer configinformersv1.ClusterVersionInformer, osImageStreamInformer mcfginformersv1.OSImageStreamInformer, - iriInformer mcfginformersv1alpha1.InternalReleaseImageInformer, + iriInformer mcfginformersv1.InternalReleaseImageInformer, ctrlctx *ctrlcommon.ControllerContext, ) *Operator { eventBroadcaster := record.NewBroadcaster() diff --git a/test/e2e-bootstrap/bootstrap_test.go b/test/e2e-bootstrap/bootstrap_test.go index ac0c85d200..7bb7996d3a 100644 --- a/test/e2e-bootstrap/bootstrap_test.go +++ b/test/e2e-bootstrap/bootstrap_test.go @@ -567,7 +567,7 @@ func createControllers(ctx *ctrlcommon.ControllerContext) []ctrlcommon.Controlle ctx.InformerFactory.Machineconfiguration().V1().ControllerConfigs(), ctx.OpenShiftConfigKubeNamespacedInformerFactory.Core().V1().Secrets(), ctx.KubeInformerFactory.Core().V1().Secrets(), - ctx.InformerFactory.Machineconfiguration().V1alpha1().InternalReleaseImages(), + ctx.InformerFactory.Machineconfiguration().V1().InternalReleaseImages(), ctx.ConfigInformerFactory.Config().V1().APIServers(), ctx.ClientBuilder.KubeClientOrDie("template-controller"), ctx.ClientBuilder.MachineConfigClientOrDie("template-controller"), diff --git a/test/e2e-iri/iri_test.go b/test/e2e-iri/iri_test.go index d03e2867ff..88647cafd8 100644 --- a/test/e2e-iri/iri_test.go +++ b/test/e2e-iri/iri_test.go @@ -22,7 +22,6 @@ import ( "k8s.io/apimachinery/pkg/util/wait" mcfgv1 "github.com/openshift/api/machineconfiguration/v1" - mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1" ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common" "github.com/openshift/machine-config-operator/pkg/daemon/constants" "github.com/openshift/machine-config-operator/test/framework" @@ -38,7 +37,7 @@ func TestIRIResource_Available(t *testing.T) { ctx := context.Background() // Check that the initial InternalReleaseImage resource has been installed. - _, err := cs.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) + _, err := cs.MachineconfigurationV1Interface.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) require.NoError(t, err) // Verify that the expected MachineConfigs have been created. @@ -74,8 +73,8 @@ func TestMachineConfigNodesStatus(t *testing.T) { require.Equal(t, expectedVersion, r.Name) require.NotEmpty(t, r.Image, "OCP release pullspec cannot be empty") - requireCondition(t, r.Conditions, string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable), v1.ConditionTrue) - requireCondition(t, r.Conditions, string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded), v1.ConditionFalse) + requireCondition(t, r.Conditions, string(mcfgv1.InternalReleaseImageConditionTypeAvailable), v1.ConditionTrue) + requireCondition(t, r.Conditions, string(mcfgv1.InternalReleaseImageConditionTypeDegraded), v1.ConditionFalse) } } @@ -85,7 +84,7 @@ func TestInternalReleaseImageAggregatedStatusHappyPath(t *testing.T) { cs := framework.NewClientSet("") ctx := context.Background() - iri, err := cs.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) + iri, err := cs.MachineconfigurationV1Interface.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) require.NoError(t, err) require.NotEmpty(t, iri.Status.Releases, "Cluster-level IRI should have aggregated releases") @@ -100,11 +99,11 @@ func TestInternalReleaseImageAggregatedStatusHappyPath(t *testing.T) { require.NotEmpty(t, release.Conditions, "Release should have conditions") } - requireCondition(t, iri.Status.Conditions, string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded), v1.ConditionFalse) + requireCondition(t, iri.Status.Conditions, string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded), v1.ConditionFalse) // The reason should be AllReleasesAvailable in a healthy cluster for _, cond := range iri.Status.Conditions { - if cond.Type == string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded) { + if cond.Type == string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded) { require.Equal(t, "AllReleasesAvailable", cond.Reason, "In a healthy cluster, reason should be AllReleasesAvailable") } } @@ -122,7 +121,7 @@ func TestInternalReleaseImageAggregatesFromMCNs(t *testing.T) { ctx := context.Background() // Get the cluster-level IRI - iri, err := cs.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) + iri, err := cs.MachineconfigurationV1Interface.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) require.NoError(t, err) require.NotEmpty(t, iri.Status.Releases, "Cluster IRI should have releases") @@ -198,7 +197,7 @@ func TestInternalReleaseImageStatusConditions(t *testing.T) { cs := framework.NewClientSet("") ctx := context.Background() - iri, err := cs.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) + iri, err := cs.MachineconfigurationV1Interface.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) require.NoError(t, err) // Verify cluster-level IRI has Degraded condition @@ -206,7 +205,7 @@ func TestInternalReleaseImageStatusConditions(t *testing.T) { foundDegraded := false for _, cond := range iri.Status.Conditions { - if cond.Type == string(mcfgv1alpha1.InternalReleaseImageStatusConditionTypeDegraded) { + if cond.Type == string(mcfgv1.InternalReleaseImageStatusConditionTypeDegraded) { foundDegraded = true // Verify condition has reason and message @@ -242,12 +241,12 @@ func TestInternalReleaseImageStatusConditions(t *testing.T) { "Condition in release %s should have LastTransitionTime", release.Name) switch cond.Type { - case string(mcfgv1alpha1.InternalReleaseImageConditionTypeAvailable): + case string(mcfgv1.InternalReleaseImageConditionTypeAvailable): foundAvailable = true // In healthy cluster, Available should be True require.Equal(t, v1.ConditionTrue, cond.Status, "Available condition should be True for release %s in healthy cluster", release.Name) - case string(mcfgv1alpha1.InternalReleaseImageConditionTypeDegraded): + case string(mcfgv1.InternalReleaseImageConditionTypeDegraded): foundReleaseDegraded = true // In healthy cluster, Degraded should be False require.Equal(t, v1.ConditionFalse, cond.Status, @@ -375,7 +374,7 @@ func TestIRIController_ShouldPreventDeletionWhenInUse(t *testing.T) { ctx := context.Background() // Get the InternalReleaseImage resource - iri, err := cs.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) + iri, err := cs.MachineconfigurationV1Interface.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) require.NoError(t, err) // Verify the IRI has releases in its status @@ -403,7 +402,7 @@ func TestIRIController_ShouldPreventDeletionWhenInUse(t *testing.T) { require.True(t, matchFound, "IRI should contain a release matching the current cluster version (digest: %s)", cvDigest) // Attempt to delete the InternalReleaseImage - this should fail - err = cs.InternalReleaseImages().Delete(ctx, "cluster", v1.DeleteOptions{}) + err = cs.MachineconfigurationV1Interface.InternalReleaseImages().Delete(ctx, "cluster", v1.DeleteOptions{}) require.Error(t, err, "Deleting IRI while in use should fail") // Verify the error is an Invalid error from the ValidatingAdmissionPolicy @@ -413,7 +412,7 @@ func TestIRIController_ShouldPreventDeletionWhenInUse(t *testing.T) { "Error message should indicate the IRI is in use") // Verify the IRI still exists - iri, err = cs.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) + iri, err = cs.MachineconfigurationV1Interface.InternalReleaseImages().Get(ctx, "cluster", v1.GetOptions{}) require.NoError(t, err, "IRI should still exist after failed deletion attempt") require.NotNil(t, iri, "IRI should not be nil") } diff --git a/vendor/github.com/openshift/api/.ci-operator.yaml b/vendor/github.com/openshift/api/.ci-operator.yaml index a3628cf240..1d88a59fdf 100644 --- a/vendor/github.com/openshift/api/.ci-operator.yaml +++ b/vendor/github.com/openshift/api/.ci-operator.yaml @@ -1,4 +1,4 @@ build_root_image: name: release namespace: openshift - tag: rhel-9-release-golang-1.25-openshift-4.22 + tag: rhel-9-release-golang-1.26-openshift-5.0 diff --git a/vendor/github.com/openshift/api/Dockerfile.ocp b/vendor/github.com/openshift/api/Dockerfile.ocp index e04ec9fbc1..98870518c2 100644 --- a/vendor/github.com/openshift/api/Dockerfile.ocp +++ b/vendor/github.com/openshift/api/Dockerfile.ocp @@ -1,10 +1,10 @@ -FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder WORKDIR /go/src/github.com/openshift/api COPY . . ENV GO_PACKAGE github.com/openshift/api RUN make build --warn-undefined-variables -FROM registry.ci.openshift.org/ocp/4.22:base-rhel9 +FROM registry.ci.openshift.org/ocp/5.0:base-rhel9 # copy the built binaries to /usr/bin COPY --from=builder /go/src/github.com/openshift/api/render /usr/bin/ diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml index 7980f7d212..197bf2706f 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml @@ -1084,6 +1084,12 @@ spec: type: array x-kubernetes-list-type: atomic x-kubernetes-validations: + - message: Cannot add and remove vCenters at the same time + rule: 'size(self) >= size(oldSelf) ? oldSelf.all(x, self.exists(y, + y.server == x.server)) : true' + - message: Cannot add and remove vCenters at the same time + rule: 'size(self) < size(oldSelf) ? self.all(x, oldSelf.exists(y, + y.server == x.server)) : true' - message: vcenters must have unique server values rule: self.all(x, self.exists_one(y, y.server == x.server)) type: object @@ -1094,9 +1100,9 @@ spec: rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)' type: object x-kubernetes-validations: - - message: vcenters can have at most 1 item when configured post-install - rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? (has(self.vsphere.vcenters) - && size(self.vsphere.vcenters) < 2) : true' + - message: vcenters is required once set and cannot be removed + rule: 'oldSelf.?vsphere.vcenters.hasValue() ? self.?vsphere.vcenters.hasValue() + : true' type: object status: description: status holds observed values from the cluster. They may not diff --git a/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go b/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go index 4c0d23b9ee..cc2a3cb3bb 100644 --- a/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go +++ b/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go @@ -158,6 +158,12 @@ type ClusterMonitoringSpec struct { // When set, at least one field must be specified within monitoringPluginConfig. // +optional MonitoringPluginConfig MonitoringPluginConfig `json:"monitoringPluginConfig,omitempty,omitzero"` + // kubeStateMetricsConfig is an optional field that can be used to configure the kube-state-metrics + // agent that runs in the openshift-monitoring namespace. kube-state-metrics generates metrics about + // the state of Kubernetes objects such as Deployments, Nodes, and Pods. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + // +optional + KubeStateMetricsConfig KubeStateMetricsConfig `json:"kubeStateMetricsConfig,omitempty,omitzero"` } // OpenShiftStateMetricsConfig provides configuration options for the openshift-state-metrics agent @@ -2605,3 +2611,154 @@ type Audit struct { // +required Profile AuditProfile `json:"profile,omitempty"` } + +// KubeStateMetricsConfig provides configuration options for the kube-state-metrics agent +// that runs in the `openshift-monitoring` namespace. kube-state-metrics generates metrics +// about the state of Kubernetes objects such as Deployments, Nodes, and Pods. +// +kubebuilder:validation:MinProperties=1 +type KubeStateMetricsConfig struct { + // nodeSelector defines the nodes on which the Pods are scheduled. + // nodeSelector is optional. + // + // When omitted, this means the user has no opinion and the platform is left + // to choose reasonable defaults. These defaults are subject to change over time. + // The current default value is `kubernetes.io/os: linux`. + // When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries. + // +optional + // +kubebuilder:validation:MinProperties=1 + // +kubebuilder:validation:MaxProperties=10 + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + // resources defines the compute resource requests and limits for the kube-state-metrics container. + // This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. + // When not specified, defaults are used by the platform. Requests cannot exceed limits. + // This field is optional. + // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + // This is a simplified API that maps to Kubernetes ResourceRequirements. + // The current default values are: + // resources: + // - name: cpu + // request: 4m + // limit: null + // - name: memory + // request: 40Mi + // limit: null + // Maximum length for this list is 5. + // Minimum length for this list is 1. + // Each resource name must be unique within this list. + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=5 + // +kubebuilder:validation:MinItems=1 + Resources []ContainerResource `json:"resources,omitempty"` + // tolerations defines tolerations for the pods. + // tolerations is optional. + // + // When omitted, no tolerations are applied. This default is subject to change over time. + // When specified, tolerations must contain at least 1 entry and must not contain more than 10 entries. + // Each toleration's operator, when specified, must be either "Exists" or "Equal". + // Each toleration's effect, when specified, must be one of "NoSchedule", "PreferNoSchedule", or "NoExecute". + // An empty or unset effect means match all effects. + // +kubebuilder:validation:MaxItems=10 + // +kubebuilder:validation:MinItems=1 + // +listType=atomic + // +kubebuilder:validation:XValidation:rule="self.all(t, !has(t.operator) || t.operator == 'Exists' || t.operator == 'Equal')",message="operator must be either Exists or Equal" + // +kubebuilder:validation:XValidation:rule="self.all(t, !has(t.effect) || t.effect == 'NoSchedule' || t.effect == 'PreferNoSchedule' || t.effect == 'NoExecute' || t.effect == '')",message="effect must be NoSchedule, PreferNoSchedule, NoExecute, or empty" + // +optional + Tolerations []v1.Toleration `json:"tolerations,omitempty"` + // topologySpreadConstraints defines rules for how kube-state-metrics Pods should be distributed + // across topology domains such as zones, nodes, or other user-defined labels. + // topologySpreadConstraints is optional. + // This helps improve high availability and resource efficiency by avoiding placing + // too many replicas in the same failure domain. + // + // This field maps directly to the `topologySpreadConstraints` field in the Pod spec. + // When omitted, no topology spread constraints are applied. This default is subject to change over time. + // When specified, topologySpreadConstraints must contain at least 1 entry and must not contain more than 10 entries. + // Entries must have unique topologyKey and whenUnsatisfiable pairs. + // Each entry's whenUnsatisfiable must be either "DoNotSchedule" or "ScheduleAnyway". + // Each entry's maxSkew must be at least 1. + // When minDomains is specified, it must be at least 1 and whenUnsatisfiable must be "DoNotSchedule". + // +kubebuilder:validation:MaxItems=10 + // +kubebuilder:validation:MinItems=1 + // +listType=map + // +listMapKey=topologyKey + // +listMapKey=whenUnsatisfiable + // +kubebuilder:validation:XValidation:rule="self.all(c, c.whenUnsatisfiable == 'DoNotSchedule' || c.whenUnsatisfiable == 'ScheduleAnyway')",message="whenUnsatisfiable must be either DoNotSchedule or ScheduleAnyway" + // +kubebuilder:validation:XValidation:rule="self.all(c, c.maxSkew >= 1)",message="maxSkew must be at least 1" + // +kubebuilder:validation:XValidation:rule="self.all(c, !has(c.minDomains) || c.minDomains >= 1)",message="minDomains must be at least 1" + // +kubebuilder:validation:XValidation:rule="self.all(c, !has(c.minDomains) || c.whenUnsatisfiable == 'DoNotSchedule')",message="minDomains can only be used when whenUnsatisfiable is DoNotSchedule" + // +optional + TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` + // additionalResourceLabels defines additional Kubernetes resource labels to expose as metrics + // in kube-state-metrics. + // Currently, only "Job" and "CronJob" resources are supported due to cardinality concerns. + // Each entry specifies a resource name and a list of Kubernetes label names to expose. + // Use "*" in the labels list to expose all labels for a given resource. + // additionalResourceLabels is optional. + // When omitted, no additional Kubernetes object labels are exposed as metrics + // by kube-state-metrics beyond its built-in metric labels (e.g. namespace, job_name). + // Use this field to opt in to exposing specific Kubernetes labels as metric labels + // for the supported resource types. + // Minimum length for this list is 1. + // Maximum length for this list is 2. + // Each resource name must be unique within this list. + // +optional + // +kubebuilder:validation:MaxItems=2 + // +kubebuilder:validation:MinItems=1 + // +listType=map + // +listMapKey=resource + AdditionalResourceLabels []KubeStateMetricsResourceLabels `json:"additionalResourceLabels,omitempty"` +} + +// KubeStateMetricsResourceName is the name of a Kubernetes resource whose labels can be exposed +// as metrics by kube-state-metrics. Currently, only "Job" and "CronJob" are supported +// due to cardinality concerns. +// Valid values are "Job" and "CronJob". +// +kubebuilder:validation:Enum=Job;CronJob +type KubeStateMetricsResourceName string + +const ( + // KubeStateMetricsResourceJob indicates the Kubernetes Job resource. + KubeStateMetricsResourceJob KubeStateMetricsResourceName = "Job" + // KubeStateMetricsResourceCronJob indicates the Kubernetes CronJob resource. + KubeStateMetricsResourceCronJob KubeStateMetricsResourceName = "CronJob" +) + +// KubeStateMetricsLabelName is the name of a Kubernetes label to expose as a metric +// via kube-state-metrics. Use "*" to expose all labels for a resource. +// Must be either the wildcard "*" or a valid Kubernetes label key. +// A valid label key has an optional DNS subdomain prefix followed by a "/" and a name segment, +// or just a name segment without a prefix. The name segment must be 63 characters or fewer, +// beginning and ending with an alphanumeric character, with dashes, underscores, dots, and +// alphanumerics in between. +// Must be at least 1 character and at most 253 characters in length. +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=253 +// +kubebuilder:validation:XValidation:rule="self == '*' || !format.qualifiedName().validate(self).hasValue()",message="must be a valid Kubernetes label key or the wildcard '*'" +type KubeStateMetricsLabelName string + +// KubeStateMetricsResourceLabels defines which Kubernetes labels to expose as metrics +// for a given resource type in kube-state-metrics. +type KubeStateMetricsResourceLabels struct { + // resource is the Kubernetes resource name whose labels should be exposed as metrics. + // Currently, only "Job" and "CronJob" are supported due to cardinality concerns. + // Valid values are "Job" and "CronJob". + // This field is required. + // +required + Resource KubeStateMetricsResourceName `json:"resource,omitempty"` + // labels is the list of Kubernetes label names to expose as metrics for this resource. + // Use "*" to expose all labels for the specified resource. + // When "*" is specified, it must be the only entry in the list; mixing "*" with + // specific label names is not allowed. + // This field is required. + // Each label name must be unique within this list. + // Minimum length for this list is 1. + // Maximum length for this list is 50. + // +required + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=50 + // +listType=set + // +kubebuilder:validation:XValidation:rule="!self.exists(l, l == '*') || self.size() == 1",message="when '*' is specified, no other labels may be listed" + Labels []KubeStateMetricsLabelName `json:"labels,omitempty"` +} diff --git a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml index 61a7ba6e37..b226cec1ce 100644 --- a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml @@ -915,6 +915,452 @@ spec: and forbidden otherwise rule: 'self.deploymentMode == ''CustomConfig'' ? has(self.customConfig) : !has(self.customConfig)' + kubeStateMetricsConfig: + description: |- + kubeStateMetricsConfig is an optional field that can be used to configure the kube-state-metrics + agent that runs in the openshift-monitoring namespace. kube-state-metrics generates metrics about + the state of Kubernetes objects such as Deployments, Nodes, and Pods. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + minProperties: 1 + properties: + additionalResourceLabels: + description: |- + additionalResourceLabels defines additional Kubernetes resource labels to expose as metrics + in kube-state-metrics. + Currently, only "Job" and "CronJob" resources are supported due to cardinality concerns. + Each entry specifies a resource name and a list of Kubernetes label names to expose. + Use "*" in the labels list to expose all labels for a given resource. + additionalResourceLabels is optional. + When omitted, no additional Kubernetes object labels are exposed as metrics + by kube-state-metrics beyond its built-in metric labels (e.g. namespace, job_name). + Use this field to opt in to exposing specific Kubernetes labels as metric labels + for the supported resource types. + Minimum length for this list is 1. + Maximum length for this list is 2. + Each resource name must be unique within this list. + items: + description: |- + KubeStateMetricsResourceLabels defines which Kubernetes labels to expose as metrics + for a given resource type in kube-state-metrics. + properties: + labels: + description: |- + labels is the list of Kubernetes label names to expose as metrics for this resource. + Use "*" to expose all labels for the specified resource. + When "*" is specified, it must be the only entry in the list; mixing "*" with + specific label names is not allowed. + This field is required. + Each label name must be unique within this list. + Minimum length for this list is 1. + Maximum length for this list is 50. + items: + description: |- + KubeStateMetricsLabelName is the name of a Kubernetes label to expose as a metric + via kube-state-metrics. Use "*" to expose all labels for a resource. + Must be either the wildcard "*" or a valid Kubernetes label key. + A valid label key has an optional DNS subdomain prefix followed by a "/" and a name segment, + or just a name segment without a prefix. The name segment must be 63 characters or fewer, + beginning and ending with an alphanumeric character, with dashes, underscores, dots, and + alphanumerics in between. + Must be at least 1 character and at most 253 characters in length. + maxLength: 253 + minLength: 1 + type: string + x-kubernetes-validations: + - message: must be a valid Kubernetes label key or the + wildcard '*' + rule: self == '*' || !format.qualifiedName().validate(self).hasValue() + maxItems: 50 + minItems: 1 + type: array + x-kubernetes-list-type: set + x-kubernetes-validations: + - message: when '*' is specified, no other labels may be + listed + rule: '!self.exists(l, l == ''*'') || self.size() == 1' + resource: + description: |- + resource is the Kubernetes resource name whose labels should be exposed as metrics. + Currently, only "Job" and "CronJob" are supported due to cardinality concerns. + Valid values are "Job" and "CronJob". + This field is required. + enum: + - Job + - CronJob + type: string + required: + - labels + - resource + type: object + maxItems: 2 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - resource + x-kubernetes-list-type: map + nodeSelector: + additionalProperties: + type: string + description: |- + nodeSelector defines the nodes on which the Pods are scheduled. + nodeSelector is optional. + + When omitted, this means the user has no opinion and the platform is left + to choose reasonable defaults. These defaults are subject to change over time. + The current default value is `kubernetes.io/os: linux`. + When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries. + maxProperties: 10 + minProperties: 1 + type: object + resources: + description: |- + resources defines the compute resource requests and limits for the kube-state-metrics container. + This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. + When not specified, defaults are used by the platform. Requests cannot exceed limits. + This field is optional. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + This is a simplified API that maps to Kubernetes ResourceRequirements. + The current default values are: + resources: + - name: cpu + request: 4m + limit: null + - name: memory + request: 40Mi + limit: null + Maximum length for this list is 5. + Minimum length for this list is 1. + Each resource name must be unique within this list. + items: + description: ContainerResource defines a single resource requirement + for a container. + properties: + limit: + anyOf: + - type: integer + - type: string + description: |- + limit is the maximum amount of the resource allowed (e.g. "2Mi", "1Gi"). + This field is optional. + When request is specified, limit cannot be less than request. + The value must be greater than 0 when specified. + maxLength: 20 + minLength: 1 + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: limit must be a positive, non-zero quantity + rule: quantity(self).isGreaterThan(quantity('0')) + name: + description: |- + name of the resource (e.g. "cpu", "memory", "hugepages-2Mi"). + This field is required. + name must consist only of alphanumeric characters, `-`, `_` and `.` and must start and end with an alphanumeric character. + maxLength: 253 + minLength: 1 + type: string + x-kubernetes-validations: + - message: name must consist only of alphanumeric characters, + `-`, `_` and `.` and must start and end with an alphanumeric + character + rule: '!format.qualifiedName().validate(self).hasValue()' + request: + anyOf: + - type: integer + - type: string + description: |- + request is the minimum amount of the resource required (e.g. "2Mi", "1Gi"). + This field is optional. + When limit is specified, request cannot be greater than limit. + The value must be greater than 0 when specified. + maxLength: 20 + minLength: 1 + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + x-kubernetes-validations: + - message: request must be a positive, non-zero quantity + rule: quantity(self).isGreaterThan(quantity('0')) + required: + - name + type: object + x-kubernetes-validations: + - message: at least one of request or limit must be set + rule: has(self.request) || has(self.limit) + - message: limit must be greater than or equal to request + rule: '!(has(self.request) && has(self.limit)) || quantity(self.limit).compareTo(quantity(self.request)) + >= 0' + maxItems: 5 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + tolerations: + description: |- + tolerations defines tolerations for the pods. + tolerations is optional. + + When omitted, no tolerations are applied. This default is subject to change over time. + When specified, tolerations must contain at least 1 entry and must not contain more than 10 entries. + Each toleration's operator, when specified, must be either "Exists" or "Equal". + Each toleration's effect, when specified, must be one of "NoSchedule", "PreferNoSchedule", or "NoExecute". + An empty or unset effect means match all effects. + items: + description: |- + The pod this Toleration is attached to tolerates any taint that matches + the triple using the matching operator . + properties: + effect: + description: |- + Effect indicates the taint effect to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: |- + Key is the taint key that the toleration applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; this combination means to match all values and all keys. + type: string + operator: + description: |- + Operator represents a key's relationship to the value. + Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal. + Exists is equivalent to wildcard for value, so that a pod can + tolerate all taints of a particular category. + Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators). + type: string + tolerationSeconds: + description: |- + TolerationSeconds represents the period of time the toleration (which must be + of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do not evict). Zero and + negative values will be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: |- + Value is the taint value the toleration matches to. + If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + type: object + maxItems: 10 + minItems: 1 + type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: operator must be either Exists or Equal + rule: self.all(t, !has(t.operator) || t.operator == 'Exists' + || t.operator == 'Equal') + - message: effect must be NoSchedule, PreferNoSchedule, NoExecute, + or empty + rule: self.all(t, !has(t.effect) || t.effect == 'NoSchedule' + || t.effect == 'PreferNoSchedule' || t.effect == 'NoExecute' + || t.effect == '') + topologySpreadConstraints: + description: |- + topologySpreadConstraints defines rules for how kube-state-metrics Pods should be distributed + across topology domains such as zones, nodes, or other user-defined labels. + topologySpreadConstraints is optional. + This helps improve high availability and resource efficiency by avoiding placing + too many replicas in the same failure domain. + + This field maps directly to the `topologySpreadConstraints` field in the Pod spec. + When omitted, no topology spread constraints are applied. This default is subject to change over time. + When specified, topologySpreadConstraints must contain at least 1 entry and must not contain more than 10 entries. + Entries must have unique topologyKey and whenUnsatisfiable pairs. + Each entry's whenUnsatisfiable must be either "DoNotSchedule" or "ScheduleAnyway". + Each entry's maxSkew must be at least 1. + When minDomains is specified, it must be at least 1 and whenUnsatisfiable must be "DoNotSchedule". + items: + description: TopologySpreadConstraint specifies how to spread + matching pods among the given topology. + properties: + labelSelector: + description: |- + LabelSelector is used to find matching pods. + Pods that match this label selector are counted to determine the number of pods + in their corresponding topology domain. + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + description: |- + MatchLabelKeys is a set of pod label keys to select the pods over which + spreading will be calculated. The keys are used to lookup values from the + incoming pod labels, those key-value labels are ANDed with labelSelector + to select the group of existing pods over which spreading will be calculated + for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. + MatchLabelKeys cannot be set when LabelSelector isn't set. + Keys that don't exist in the incoming pod labels will + be ignored. A null or empty list means only match against labelSelector. + + This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default). + items: + type: string + type: array + x-kubernetes-list-type: atomic + maxSkew: + description: |- + MaxSkew describes the degree to which pods may be unevenly distributed. + When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference + between the number of matching pods in the target topology and the global minimum. + The global minimum is the minimum number of matching pods in an eligible domain + or zero if the number of eligible domains is less than MinDomains. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 2/2/1: + In this case, the global minimum is 1. + | zone1 | zone2 | zone3 | + | P P | P P | P | + - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; + scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) + violate MaxSkew(1). + - if MaxSkew is 2, incoming pod can be scheduled onto any zone. + When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence + to topologies that satisfy it. + It's a required field. Default value is 1 and 0 is not allowed. + format: int32 + type: integer + minDomains: + description: |- + MinDomains indicates a minimum number of eligible domains. + When the number of eligible domains with matching topology keys is less than minDomains, + Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. + And when the number of eligible domains with matching topology keys equals or greater than minDomains, + this value has no effect on scheduling. + As a result, when the number of eligible domains is less than minDomains, + scheduler won't schedule more than maxSkew Pods to those domains. + If value is nil, the constraint behaves as if MinDomains is equal to 1. + Valid values are integers greater than 0. + When value is not nil, WhenUnsatisfiable must be DoNotSchedule. + + For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same + labelSelector spread as 2/2/2: + | zone1 | zone2 | zone3 | + | P P | P P | P P | + The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. + In this situation, new pod with the same labelSelector cannot be scheduled, + because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, + it will violate MaxSkew. + format: int32 + type: integer + nodeAffinityPolicy: + description: |- + NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector + when calculating pod topology spread skew. Options are: + - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. + - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. + + If this value is nil, the behavior is equivalent to the Honor policy. + type: string + nodeTaintsPolicy: + description: |- + NodeTaintsPolicy indicates how we will treat node taints when calculating + pod topology spread skew. Options are: + - Honor: nodes without taints, along with tainted nodes for which the incoming pod + has a toleration, are included. + - Ignore: node taints are ignored. All nodes are included. + + If this value is nil, the behavior is equivalent to the Ignore policy. + type: string + topologyKey: + description: |- + TopologyKey is the key of node labels. Nodes that have a label with this key + and identical values are considered to be in the same topology. + We consider each as a "bucket", and try to put balanced number + of pods into each bucket. + We define a domain as a particular instance of a topology. + Also, we define an eligible domain as a domain whose nodes meet the requirements of + nodeAffinityPolicy and nodeTaintsPolicy. + e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. + And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. + It's a required field. + type: string + whenUnsatisfiable: + description: |- + WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy + the spread constraint. + - DoNotSchedule (default) tells the scheduler not to schedule it. + - ScheduleAnyway tells the scheduler to schedule the pod in any location, + but giving higher precedence to topologies that would help reduce the + skew. + A constraint is considered "Unsatisfiable" for an incoming pod + if and only if every possible node assignment for that pod would violate + "MaxSkew" on some topology. + For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same + labelSelector spread as 3/1/1: + | zone1 | zone2 | zone3 | + | P P P | P | P | + If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled + to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies + MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler + won't make it *more* imbalanced. + It's a required field. + type: string + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + type: object + maxItems: 10 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - topologyKey + - whenUnsatisfiable + x-kubernetes-list-type: map + x-kubernetes-validations: + - message: whenUnsatisfiable must be either DoNotSchedule or ScheduleAnyway + rule: self.all(c, c.whenUnsatisfiable == 'DoNotSchedule' || + c.whenUnsatisfiable == 'ScheduleAnyway') + - message: maxSkew must be at least 1 + rule: self.all(c, c.maxSkew >= 1) + - message: minDomains must be at least 1 + rule: self.all(c, !has(c.minDomains) || c.minDomains >= 1) + - message: minDomains can only be used when whenUnsatisfiable + is DoNotSchedule + rule: self.all(c, !has(c.minDomains) || c.whenUnsatisfiable + == 'DoNotSchedule') + type: object metricsServerConfig: description: |- metricsServerConfig is an optional field that can be used to configure the Kubernetes Metrics Server that runs in the openshift-monitoring namespace. diff --git a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go index a481b6b4c6..7313338a3b 100644 --- a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go @@ -451,6 +451,7 @@ func (in *ClusterMonitoringSpec) DeepCopyInto(out *ClusterMonitoringSpec) { in.ThanosQuerierConfig.DeepCopyInto(&out.ThanosQuerierConfig) in.NodeExporterConfig.DeepCopyInto(&out.NodeExporterConfig) in.MonitoringPluginConfig.DeepCopyInto(&out.MonitoringPluginConfig) + in.KubeStateMetricsConfig.DeepCopyInto(&out.KubeStateMetricsConfig) return } @@ -751,6 +752,78 @@ func (in *KeyConfig) DeepCopy() *KeyConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubeStateMetricsConfig) DeepCopyInto(out *KubeStateMetricsConfig) { + *out = *in + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]ContainerResource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TopologySpreadConstraints != nil { + in, out := &in.TopologySpreadConstraints, &out.TopologySpreadConstraints + *out = make([]v1.TopologySpreadConstraint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AdditionalResourceLabels != nil { + in, out := &in.AdditionalResourceLabels, &out.AdditionalResourceLabels + *out = make([]KubeStateMetricsResourceLabels, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeStateMetricsConfig. +func (in *KubeStateMetricsConfig) DeepCopy() *KubeStateMetricsConfig { + if in == nil { + return nil + } + out := new(KubeStateMetricsConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubeStateMetricsResourceLabels) DeepCopyInto(out *KubeStateMetricsResourceLabels) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make([]KubeStateMetricsLabelName, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeStateMetricsResourceLabels. +func (in *KubeStateMetricsResourceLabels) DeepCopy() *KubeStateMetricsResourceLabels { + if in == nil { + return nil + } + out := new(KubeStateMetricsResourceLabels) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Label) DeepCopyInto(out *Label) { *out = *in diff --git a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go index 63f833a0fc..44db6eb6a9 100644 --- a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -184,6 +184,7 @@ var map_ClusterMonitoringSpec = map[string]string{ "thanosQuerierConfig": "thanosQuerierConfig is an optional field that can be used to configure the Thanos Querier component that runs in the openshift-monitoring namespace. The Thanos Querier provides a global query view by aggregating and deduplicating metrics from multiple Prometheus instances. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default deploys the Thanos Querier on linux nodes with 5m CPU and 12Mi memory requests, and no custom tolerations or topology spread constraints. When set, at least one field must be specified within thanosQuerierConfig.", "nodeExporterConfig": "nodeExporterConfig is an optional field that can be used to configure the node-exporter agent that runs as a DaemonSet in the openshift-monitoring namespace. The node-exporter agent collects hardware and OS-level metrics from every node in the cluster. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.", "monitoringPluginConfig": "monitoringPluginConfig is an optional field that can be used to configure the monitoring plugin that runs as a dynamic plugin of the OpenShift web console. The monitoring plugin provides the monitoring UI in the OpenShift web console for visualizing metrics, alerts, and dashboards. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default deploys the monitoring-plugin as a single-replica Deployment on linux nodes with 10m CPU and 50Mi memory requests, and no custom tolerations or topology spread constraints. When set, at least one field must be specified within monitoringPluginConfig.", + "kubeStateMetricsConfig": "kubeStateMetricsConfig is an optional field that can be used to configure the kube-state-metrics agent that runs in the openshift-monitoring namespace. kube-state-metrics generates metrics about the state of Kubernetes objects such as Deployments, Nodes, and Pods. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.", } func (ClusterMonitoringSpec) SwaggerDoc() map[string]string { @@ -237,6 +238,29 @@ func (KeepEqualActionConfig) SwaggerDoc() map[string]string { return map_KeepEqualActionConfig } +var map_KubeStateMetricsConfig = map[string]string{ + "": "KubeStateMetricsConfig provides configuration options for the kube-state-metrics agent that runs in the `openshift-monitoring` namespace. kube-state-metrics generates metrics about the state of Kubernetes objects such as Deployments, Nodes, and Pods.", + "nodeSelector": "nodeSelector defines the nodes on which the Pods are scheduled. nodeSelector is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default value is `kubernetes.io/os: linux`. When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries.", + "resources": "resources defines the compute resource requests and limits for the kube-state-metrics container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ This is a simplified API that maps to Kubernetes ResourceRequirements. The current default values are:\n resources:\n - name: cpu\n request: 4m\n limit: null\n - name: memory\n request: 40Mi\n limit: null\nMaximum length for this list is 5. Minimum length for this list is 1. Each resource name must be unique within this list.", + "tolerations": "tolerations defines tolerations for the pods. tolerations is optional.\n\nWhen omitted, no tolerations are applied. This default is subject to change over time. When specified, tolerations must contain at least 1 entry and must not contain more than 10 entries. Each toleration's operator, when specified, must be either \"Exists\" or \"Equal\". Each toleration's effect, when specified, must be one of \"NoSchedule\", \"PreferNoSchedule\", or \"NoExecute\". An empty or unset effect means match all effects.", + "topologySpreadConstraints": "topologySpreadConstraints defines rules for how kube-state-metrics Pods should be distributed across topology domains such as zones, nodes, or other user-defined labels. topologySpreadConstraints is optional. This helps improve high availability and resource efficiency by avoiding placing too many replicas in the same failure domain.\n\nThis field maps directly to the `topologySpreadConstraints` field in the Pod spec. When omitted, no topology spread constraints are applied. This default is subject to change over time. When specified, topologySpreadConstraints must contain at least 1 entry and must not contain more than 10 entries. Entries must have unique topologyKey and whenUnsatisfiable pairs. Each entry's whenUnsatisfiable must be either \"DoNotSchedule\" or \"ScheduleAnyway\". Each entry's maxSkew must be at least 1. When minDomains is specified, it must be at least 1 and whenUnsatisfiable must be \"DoNotSchedule\".", + "additionalResourceLabels": "additionalResourceLabels defines additional Kubernetes resource labels to expose as metrics in kube-state-metrics. Currently, only \"Job\" and \"CronJob\" resources are supported due to cardinality concerns. Each entry specifies a resource name and a list of Kubernetes label names to expose. Use \"*\" in the labels list to expose all labels for a given resource. additionalResourceLabels is optional. When omitted, no additional Kubernetes object labels are exposed as metrics by kube-state-metrics beyond its built-in metric labels (e.g. namespace, job_name). Use this field to opt in to exposing specific Kubernetes labels as metric labels for the supported resource types. Minimum length for this list is 1. Maximum length for this list is 2. Each resource name must be unique within this list.", +} + +func (KubeStateMetricsConfig) SwaggerDoc() map[string]string { + return map_KubeStateMetricsConfig +} + +var map_KubeStateMetricsResourceLabels = map[string]string{ + "": "KubeStateMetricsResourceLabels defines which Kubernetes labels to expose as metrics for a given resource type in kube-state-metrics.", + "resource": "resource is the Kubernetes resource name whose labels should be exposed as metrics. Currently, only \"Job\" and \"CronJob\" are supported due to cardinality concerns. Valid values are \"Job\" and \"CronJob\". This field is required.", + "labels": "labels is the list of Kubernetes label names to expose as metrics for this resource. Use \"*\" to expose all labels for the specified resource. When \"*\" is specified, it must be the only entry in the list; mixing \"*\" with specific label names is not allowed. This field is required. Each label name must be unique within this list. Minimum length for this list is 1. Maximum length for this list is 50.", +} + +func (KubeStateMetricsResourceLabels) SwaggerDoc() map[string]string { + return map_KubeStateMetricsResourceLabels +} + var map_Label = map[string]string{ "": "Label represents a key/value pair for external labels.", "key": "key is the name of the label. Prometheus supports UTF-8 label names, so any valid UTF-8 string is allowed. Must be between 1 and 128 characters in length.", diff --git a/vendor/github.com/openshift/api/features.md b/vendor/github.com/openshift/api/features.md index b8816c2b13..0212bf61c5 100644 --- a/vendor/github.com/openshift/api/features.md +++ b/vendor/github.com/openshift/api/features.md @@ -6,6 +6,7 @@ | MachineAPIOperatorDisableMachineHealthCheckController| | | | | | | | | | MultiArchInstallAzure| | | | | | | | | | ShortCertRotation| | | | | | | | | +| MutableTopology| | | | Enabled | | | | | | ClusterAPIComputeInstall| | | Enabled | Enabled | | | | | | ClusterAPIControlPlaneInstall| | | Enabled | Enabled | | | | | | ClusterUpdatePreflight| | | Enabled | Enabled | | | | | @@ -23,7 +24,6 @@ | NoRegistryClusterInstall| | | | Enabled | | | | Enabled | | OLMLifecycleAndCompatibility| | | | Enabled | | | | Enabled | | ProvisioningRequestAvailable| | | Enabled | Enabled | | | | | -| VSphereMultiVCenterDay2| | | Enabled | Enabled | | | | | | AWSClusterHostedDNS| | | Enabled | Enabled | | | Enabled | Enabled | | AWSClusterHostedDNSInstall| | | Enabled | Enabled | | | Enabled | Enabled | | AWSDedicatedHosts| | | Enabled | Enabled | | | Enabled | Enabled | @@ -86,6 +86,7 @@ | TLSGroupPreferences| | | Enabled | Enabled | | | Enabled | Enabled | | VSphereConfigurableMaxAllowedBlockVolumesPerNode| | | Enabled | Enabled | | | Enabled | Enabled | | VSphereMixedNodeEnv| | | Enabled | Enabled | | | Enabled | Enabled | +| VSphereMultiVCenterDay2| | | Enabled | Enabled | | | Enabled | Enabled | | VolumeGroupSnapshot| | | Enabled | Enabled | | | Enabled | Enabled | | AWSServiceLBNetworkSecurityGroup| | Enabled | Enabled | Enabled | | Enabled | Enabled | Enabled | | AzureClusterHostedDNSInstall| Enabled | Enabled | Enabled | Enabled | Enabled | Enabled | Enabled | Enabled | diff --git a/vendor/github.com/openshift/api/features/features.go b/vendor/github.com/openshift/api/features/features.go index 3c7391cc7c..33fdd7d3a5 100644 --- a/vendor/github.com/openshift/api/features/features.go +++ b/vendor/github.com/openshift/api/features/features.go @@ -465,12 +465,12 @@ var ( mustRegister() FeatureGateOLMLifecycleAndCompatibility = newFeatureGate("OLMLifecycleAndCompatibility"). - reportProblemsToJiraComponent("olm"). - contactPerson("joelanford"). - productScope(ocpSpecific). - enhancementPR("https://github.com/openshift/enhancements/pull/1991"). - enable(inClusterProfile(SelfManaged), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). - mustRegister() + reportProblemsToJiraComponent("olm"). + contactPerson("joelanford"). + productScope(ocpSpecific). + enhancementPR("https://github.com/openshift/enhancements/pull/1991"). + enable(inClusterProfile(SelfManaged), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + mustRegister() FeatureGateInsightsOnDemandDataGather = newFeatureGate("InsightsOnDemandDataGather"). reportProblemsToJiraComponent("insights"). @@ -778,7 +778,7 @@ var ( contactPerson("vr4manta"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1961"). - enable(inDevPreviewNoUpgrade()). + enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). mustRegister() FeatureGateAWSServiceLBNetworkSecurityGroup = newFeatureGate("AWSServiceLBNetworkSecurityGroup"). @@ -986,10 +986,18 @@ var ( mustRegister() FeatureGateTLSGroupPreferences = newFeatureGate("TLSGroupPreferences"). - reportProblemsToJiraComponent("Networking / router"). - contactPerson("davidesalerno"). - productScope(ocpSpecific). - enhancementPR("https://github.com/openshift/enhancements/pull/1894"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). - mustRegister() + reportProblemsToJiraComponent("Networking / router"). + contactPerson("davidesalerno"). + productScope(ocpSpecific). + enhancementPR("https://github.com/openshift/enhancements/pull/1894"). + enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + mustRegister() + + FeatureGateMutableTopology = newFeatureGate("MutableTopology"). + reportProblemsToJiraComponent("Mutable Topology"). + contactPerson("jaypoulz"). + productScope(ocpSpecific). + enhancementPR("https://github.com/openshift/enhancements/pull/2008"). + enable(inClusterProfile(SelfManaged), inDevPreviewNoUpgrade()). + mustRegister() ) diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/register.go b/vendor/github.com/openshift/api/machineconfiguration/v1/register.go index d52f6480e8..1a7252834b 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/register.go +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/register.go @@ -28,6 +28,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ContainerRuntimeConfigList{}, &ControllerConfig{}, &ControllerConfigList{}, + &InternalReleaseImage{}, + &InternalReleaseImageList{}, &KubeletConfig{}, &KubeletConfigList{}, &MachineConfig{}, diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/types.go b/vendor/github.com/openshift/api/machineconfiguration/v1/types.go index 21615ee9aa..33c12be923 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/types.go +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/types.go @@ -811,10 +811,17 @@ type KubeletConfigCondition struct { type KubeletConfigStatusConditionType string const ( + // KubeletConfigAccepted designates whether a KubeletConfig CR has been accepted. + // When the condition status is True, the KubeletConfig has been accepted successfully. + // When the condition status is False, the KubeletConfig has not been accepted. + KubeletConfigAccepted KubeletConfigStatusConditionType = "Accepted" + // KubeletConfigSuccess designates a successful application of a KubeletConfig CR. + // Deprecated: Use KubeletConfigAccepted instead. KubeletConfigSuccess will be removed in a future release. KubeletConfigSuccess KubeletConfigStatusConditionType = "Success" // KubeletConfigFailure designates a failure applying a KubeletConfig CR. + // Deprecated: Use KubeletConfigAccepted with status False instead. KubeletConfigFailure will be removed in a future release. KubeletConfigFailure KubeletConfigStatusConditionType = "Failure" ) diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/types_internalreleaseimage.go b/vendor/github.com/openshift/api/machineconfiguration/v1/types_internalreleaseimage.go new file mode 100644 index 0000000000..261d313337 --- /dev/null +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/types_internalreleaseimage.go @@ -0,0 +1,159 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=internalreleaseimages,scope=Cluster +// +kubebuilder:subresource:status +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2510 +// +openshift:file-pattern=cvoRunLevel=0000_80,operatorName=machine-config,operatorOrdering=01 +// +openshift:enable:FeatureGate=NoRegistryClusterInstall +// +kubebuilder:metadata:labels=openshift.io/operator-managed= +// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'cluster'",message="internalreleaseimage is a singleton, .metadata.name must be 'cluster'" + +// InternalReleaseImage is used to keep track and manage a set +// of release bundles (OCP and OLM operators images) that are stored +// into the control planes nodes. +// This is a singleton resource with 'cluster' as the only valid name. +// +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +type InternalReleaseImage struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +required + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec describes the configuration of this internal release image. + // +required + Spec InternalReleaseImageSpec `json:"spec,omitzero"` + + // status describes the last observed state of this internal release image. + // +optional + Status InternalReleaseImageStatus `json:"status,omitzero"` +} + +// InternalReleaseImageSpec defines the desired state of a InternalReleaseImage. +type InternalReleaseImageSpec struct { + // releases is a list of release bundle identifiers that the user wants to + // add/remove to/from the control plane nodes. + // Entries must be unique, keyed on the name field. + // releases must contain at least one entry and must not exceed 16 entries. + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=16 + // +listType=map + // +listMapKey=name + // +required + Releases []InternalReleaseImageRef `json:"releases,omitempty"` +} + +// InternalReleaseImageRef is used to provide a simple reference for a release +// bundle. Currently it contains only the name field. +type InternalReleaseImageRef struct { + // name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. + // The expected name format is ocp-release-bundle--. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:XValidation:rule=`self.matches('^ocp-release-bundle-[0-9]+\\.[0-9]+\\.[0-9]+-[A-Za-z0-9._-]+$')`,message="must be ocp-release-bundle-- and <= 64 chars" + Name string `json:"name,omitempty"` +} + +// InternalReleaseImageStatus describes the current state of a InternalReleaseImage. +type InternalReleaseImageStatus struct { + // conditions represent the observations of the InternalReleaseImage controller current state. + // Valid types are: Degraded. + // If Degraded is true, that means something has gone wrong in the controller. + // The conditions list must contain at most 5 entries. + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=5 + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` + // releases is a list of the release bundles currently owned and managed by the + // cluster. + // A release bundle content could be safely pulled only when its Conditions field + // contains at least an Available entry set to "True" and Degraded to "False". + // Entries must be unique, keyed on the name field. + // releases must contain at least one entry and must not exceed 32 entries. + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + // +required + Releases []InternalReleaseImageBundleStatus `json:"releases,omitempty"` +} + +// InternalReleaseImageStatusConditionType describes the possible states for InternalReleaseImageStatus. +// +enum +type InternalReleaseImageStatusConditionType string + +const ( + // InternalReleaseImageStatusConditionTypeDegraded describes a failure in the controller. + InternalReleaseImageStatusConditionTypeDegraded InternalReleaseImageStatusConditionType = "Degraded" +) + +// InternalReleaseImageBundleStatus describes the observed state of a single release bundle managed by the cluster. +type InternalReleaseImageBundleStatus struct { + // conditions represent the observations of an internal release image current state. Valid types are: + // Mounted, Installing, Available, Removing and Degraded. + // + // If Mounted is true, that means that a valid ISO has been discovered and mounted on one of the cluster nodes. + // If Installing is true, that means that a new release bundle is currently being copied on one (or more) cluster nodes, and not yet completed. + // If Available is true, it means that the release has been previously installed on all the cluster nodes, and it can be used. + // If Removing is true, it means that a release deletion is in progress on one (or more) cluster nodes, and not yet completed. + // If Degraded is true, that means something has gone wrong (possibly on one or more cluster nodes). + // + // In general, after installing a new release bundle, it is required to wait for the Conditions "Available" to become "True" (and all + // the other conditions to be equal to "False") before being able to pull its content. + // When present, conditions must contain at least 1 entry and must not exceed 5 entries. + // + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=5 + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` + // name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. + // The expected name format is ocp-release-bundle--. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:XValidation:rule=`self.matches('^ocp-release-bundle-[0-9]+\\.[0-9]+\\.[0-9]+-[A-Za-z0-9._-]+$')`,message="must be ocp-release-bundle-- and <= 64 chars" + // +required + Name string `json:"name,omitempty"` + // image is an OCP release image referenced by digest. + // The format of the image pull spec is: host[:port][/namespace]/name@sha256:, + // where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9. + // The length of the whole spec must be between 1 to 447 characters. + // The field is optional, and it will be provided after a release has been successfully installed. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=447 + // +kubebuilder:validation:XValidation:rule=`(self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))`,message="the OCI Image reference must end with a valid '@sha256:' suffix, where '' is 64 characters long" + // +kubebuilder:validation:XValidation:rule=`(self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))`,message="the OCI Image name should follow the host[:port][/namespace]/name format, resembling a valid URL without the scheme" + // +optional + Image string `json:"image,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// InternalReleaseImageList is a list of InternalReleaseImage resources +// +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +type InternalReleaseImageList struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + metav1.ListMeta `json:"metadata"` + + Items []InternalReleaseImage `json:"items"` +} diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-TechPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-TechPreviewNoUpgrade.crd.yaml index 71cb770dc5..0d318c38c1 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-TechPreviewNoUpgrade.crd.yaml +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-TechPreviewNoUpgrade.crd.yaml @@ -1373,6 +1373,14 @@ spec: type: array x-kubernetes-list-type: atomic x-kubernetes-validations: + - message: Cannot add and remove vCenters at the same + time + rule: 'size(self) >= size(oldSelf) ? oldSelf.all(x, + self.exists(y, y.server == x.server)) : true' + - message: Cannot add and remove vCenters at the same + time + rule: 'size(self) < size(oldSelf) ? self.all(x, + oldSelf.exists(y, y.server == x.server)) : true' - message: vcenters must have unique server values rule: self.all(x, self.exists_one(y, y.server == x.server)) @@ -1385,10 +1393,9 @@ spec: rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)' type: object x-kubernetes-validations: - - message: vcenters can have at most 1 item when configured - post-install - rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? (has(self.vsphere.vcenters) - && size(self.vsphere.vcenters) < 2) : true' + - message: vcenters is required once set and cannot be removed + rule: 'oldSelf.?vsphere.vcenters.hasValue() ? self.?vsphere.vcenters.hasValue() + : true' type: object status: description: status holds observed values from the cluster. They diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-Hypershift.crd.yaml b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-Hypershift.crd.yaml new file mode 100644 index 0000000000..ed5a750e60 --- /dev/null +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-Hypershift.crd.yaml @@ -0,0 +1,294 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2510 + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + release.openshift.io/feature-set: CustomNoUpgrade + labels: + openshift.io/operator-managed: "" + name: internalreleaseimages.machineconfiguration.openshift.io +spec: + group: machineconfiguration.openshift.io + names: + kind: InternalReleaseImage + listKind: InternalReleaseImageList + plural: internalreleaseimages + singular: internalreleaseimage + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: |- + InternalReleaseImage is used to keep track and manage a set + of release bundles (OCP and OLM operators images) that are stored + into the control planes nodes. + This is a singleton resource with 'cluster' as the only valid name. + + Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec describes the configuration of this internal release + image. + properties: + releases: + description: |- + releases is a list of release bundle identifiers that the user wants to + add/remove to/from the control plane nodes. + Entries must be unique, keyed on the name field. + releases must contain at least one entry and must not exceed 16 entries. + items: + description: |- + InternalReleaseImageRef is used to provide a simple reference for a release + bundle. Currently it contains only the name field. + properties: + name: + description: |- + name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. + The expected name format is ocp-release-bundle--. + maxLength: 64 + minLength: 1 + type: string + x-kubernetes-validations: + - message: must be ocp-release-bundle-- + and <= 64 chars + rule: self.matches('^ocp-release-bundle-[0-9]+\\.[0-9]+\\.[0-9]+-[A-Za-z0-9._-]+$') + required: + - name + type: object + maxItems: 16 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - releases + type: object + status: + description: status describes the last observed state of this internal + release image. + properties: + conditions: + description: |- + conditions represent the observations of the InternalReleaseImage controller current state. + Valid types are: Degraded. + If Degraded is true, that means something has gone wrong in the controller. + The conditions list must contain at most 5 entries. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 5 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + releases: + description: |- + releases is a list of the release bundles currently owned and managed by the + cluster. + A release bundle content could be safely pulled only when its Conditions field + contains at least an Available entry set to "True" and Degraded to "False". + Entries must be unique, keyed on the name field. + releases must contain at least one entry and must not exceed 32 entries. + items: + description: InternalReleaseImageBundleStatus describes the observed + state of a single release bundle managed by the cluster. + properties: + conditions: + description: |- + conditions represent the observations of an internal release image current state. Valid types are: + Mounted, Installing, Available, Removing and Degraded. + + If Mounted is true, that means that a valid ISO has been discovered and mounted on one of the cluster nodes. + If Installing is true, that means that a new release bundle is currently being copied on one (or more) cluster nodes, and not yet completed. + If Available is true, it means that the release has been previously installed on all the cluster nodes, and it can be used. + If Removing is true, it means that a release deletion is in progress on one (or more) cluster nodes, and not yet completed. + If Degraded is true, that means something has gone wrong (possibly on one or more cluster nodes). + + In general, after installing a new release bundle, it is required to wait for the Conditions "Available" to become "True" (and all + the other conditions to be equal to "False") before being able to pull its content. + When present, conditions must contain at least 1 entry and must not exceed 5 entries. + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 5 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + image: + description: |- + image is an OCP release image referenced by digest. + The format of the image pull spec is: host[:port][/namespace]/name@sha256:, + where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9. + The length of the whole spec must be between 1 to 447 characters. + The field is optional, and it will be provided after a release has been successfully installed. + maxLength: 447 + minLength: 1 + type: string + x-kubernetes-validations: + - message: the OCI Image reference must end with a valid '@sha256:' + suffix, where '' is 64 characters long + rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$')) + - message: the OCI Image name should follow the host[:port][/namespace]/name + format, resembling a valid URL without the scheme + rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$')) + name: + description: |- + name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. + The expected name format is ocp-release-bundle--. + maxLength: 64 + minLength: 1 + type: string + x-kubernetes-validations: + - message: must be ocp-release-bundle-- + and <= 64 chars + rule: self.matches('^ocp-release-bundle-[0-9]+\\.[0-9]+\\.[0-9]+-[A-Za-z0-9._-]+$') + required: + - name + type: object + maxItems: 32 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - releases + type: object + required: + - metadata + - spec + type: object + x-kubernetes-validations: + - message: internalreleaseimage is a singleton, .metadata.name must be 'cluster' + rule: self.metadata.name == 'cluster' + served: true + storage: true + subresources: + status: {} diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-SelfManagedHA.crd.yaml b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-SelfManagedHA.crd.yaml new file mode 100644 index 0000000000..dc4893ae00 --- /dev/null +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-SelfManagedHA.crd.yaml @@ -0,0 +1,294 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2510 + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: CustomNoUpgrade,DevPreviewNoUpgrade,TechPreviewNoUpgrade + labels: + openshift.io/operator-managed: "" + name: internalreleaseimages.machineconfiguration.openshift.io +spec: + group: machineconfiguration.openshift.io + names: + kind: InternalReleaseImage + listKind: InternalReleaseImageList + plural: internalreleaseimages + singular: internalreleaseimage + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: |- + InternalReleaseImage is used to keep track and manage a set + of release bundles (OCP and OLM operators images) that are stored + into the control planes nodes. + This is a singleton resource with 'cluster' as the only valid name. + + Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec describes the configuration of this internal release + image. + properties: + releases: + description: |- + releases is a list of release bundle identifiers that the user wants to + add/remove to/from the control plane nodes. + Entries must be unique, keyed on the name field. + releases must contain at least one entry and must not exceed 16 entries. + items: + description: |- + InternalReleaseImageRef is used to provide a simple reference for a release + bundle. Currently it contains only the name field. + properties: + name: + description: |- + name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. + The expected name format is ocp-release-bundle--. + maxLength: 64 + minLength: 1 + type: string + x-kubernetes-validations: + - message: must be ocp-release-bundle-- + and <= 64 chars + rule: self.matches('^ocp-release-bundle-[0-9]+\\.[0-9]+\\.[0-9]+-[A-Za-z0-9._-]+$') + required: + - name + type: object + maxItems: 16 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - releases + type: object + status: + description: status describes the last observed state of this internal + release image. + properties: + conditions: + description: |- + conditions represent the observations of the InternalReleaseImage controller current state. + Valid types are: Degraded. + If Degraded is true, that means something has gone wrong in the controller. + The conditions list must contain at most 5 entries. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 5 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + releases: + description: |- + releases is a list of the release bundles currently owned and managed by the + cluster. + A release bundle content could be safely pulled only when its Conditions field + contains at least an Available entry set to "True" and Degraded to "False". + Entries must be unique, keyed on the name field. + releases must contain at least one entry and must not exceed 32 entries. + items: + description: InternalReleaseImageBundleStatus describes the observed + state of a single release bundle managed by the cluster. + properties: + conditions: + description: |- + conditions represent the observations of an internal release image current state. Valid types are: + Mounted, Installing, Available, Removing and Degraded. + + If Mounted is true, that means that a valid ISO has been discovered and mounted on one of the cluster nodes. + If Installing is true, that means that a new release bundle is currently being copied on one (or more) cluster nodes, and not yet completed. + If Available is true, it means that the release has been previously installed on all the cluster nodes, and it can be used. + If Removing is true, it means that a release deletion is in progress on one (or more) cluster nodes, and not yet completed. + If Degraded is true, that means something has gone wrong (possibly on one or more cluster nodes). + + In general, after installing a new release bundle, it is required to wait for the Conditions "Available" to become "True" (and all + the other conditions to be equal to "False") before being able to pull its content. + When present, conditions must contain at least 1 entry and must not exceed 5 entries. + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 5 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + image: + description: |- + image is an OCP release image referenced by digest. + The format of the image pull spec is: host[:port][/namespace]/name@sha256:, + where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9. + The length of the whole spec must be between 1 to 447 characters. + The field is optional, and it will be provided after a release has been successfully installed. + maxLength: 447 + minLength: 1 + type: string + x-kubernetes-validations: + - message: the OCI Image reference must end with a valid '@sha256:' + suffix, where '' is 64 characters long + rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$')) + - message: the OCI Image name should follow the host[:port][/namespace]/name + format, resembling a valid URL without the scheme + rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$')) + name: + description: |- + name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. + The expected name format is ocp-release-bundle--. + maxLength: 64 + minLength: 1 + type: string + x-kubernetes-validations: + - message: must be ocp-release-bundle-- + and <= 64 chars + rule: self.matches('^ocp-release-bundle-[0-9]+\\.[0-9]+\\.[0-9]+-[A-Za-z0-9._-]+$') + required: + - name + type: object + maxItems: 32 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - releases + type: object + required: + - metadata + - spec + type: object + x-kubernetes-validations: + - message: internalreleaseimage is a singleton, .metadata.name must be 'cluster' + rule: self.metadata.name == 'cluster' + served: true + storage: true + subresources: + status: {} diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.deepcopy.go index 9b738f8622..4a69ea1e9d 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.deepcopy.go @@ -510,6 +510,157 @@ func (in *ImageSecretObjectReference) DeepCopy() *ImageSecretObjectReference { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InternalReleaseImage) DeepCopyInto(out *InternalReleaseImage) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalReleaseImage. +func (in *InternalReleaseImage) DeepCopy() *InternalReleaseImage { + if in == nil { + return nil + } + out := new(InternalReleaseImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InternalReleaseImage) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InternalReleaseImageBundleStatus) DeepCopyInto(out *InternalReleaseImageBundleStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalReleaseImageBundleStatus. +func (in *InternalReleaseImageBundleStatus) DeepCopy() *InternalReleaseImageBundleStatus { + if in == nil { + return nil + } + out := new(InternalReleaseImageBundleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InternalReleaseImageList) DeepCopyInto(out *InternalReleaseImageList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]InternalReleaseImage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalReleaseImageList. +func (in *InternalReleaseImageList) DeepCopy() *InternalReleaseImageList { + if in == nil { + return nil + } + out := new(InternalReleaseImageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InternalReleaseImageList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InternalReleaseImageRef) DeepCopyInto(out *InternalReleaseImageRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalReleaseImageRef. +func (in *InternalReleaseImageRef) DeepCopy() *InternalReleaseImageRef { + if in == nil { + return nil + } + out := new(InternalReleaseImageRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InternalReleaseImageSpec) DeepCopyInto(out *InternalReleaseImageSpec) { + *out = *in + if in.Releases != nil { + in, out := &in.Releases, &out.Releases + *out = make([]InternalReleaseImageRef, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalReleaseImageSpec. +func (in *InternalReleaseImageSpec) DeepCopy() *InternalReleaseImageSpec { + if in == nil { + return nil + } + out := new(InternalReleaseImageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InternalReleaseImageStatus) DeepCopyInto(out *InternalReleaseImageStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Releases != nil { + in, out := &in.Releases, &out.Releases + *out = make([]InternalReleaseImageBundleStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalReleaseImageStatus. +func (in *InternalReleaseImageStatus) DeepCopy() *InternalReleaseImageStatus { + if in == nil { + return nil + } + out := new(InternalReleaseImageStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IrreconcilableChangeDiff) DeepCopyInto(out *IrreconcilableChangeDiff) { *out = *in diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml index 68186d1d31..35e3c11393 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml @@ -56,6 +56,30 @@ controllerconfigs.machineconfiguration.openshift.io: TopLevelFeatureGates: [] Version: v1 +internalreleaseimages.machineconfiguration.openshift.io: + Annotations: {} + ApprovedPRNumber: https://github.com/openshift/api/pull/2510 + CRDName: internalreleaseimages.machineconfiguration.openshift.io + Capability: "" + Category: "" + FeatureGates: + - NoRegistryClusterInstall + FilenameOperatorName: machine-config + FilenameOperatorOrdering: "01" + FilenameRunLevel: "0000_80" + GroupName: machineconfiguration.openshift.io + HasStatus: true + KindName: InternalReleaseImage + Labels: + openshift.io/operator-managed: "" + PluralName: internalreleaseimages + PrinterColumns: [] + Scope: Cluster + ShortNames: null + TopLevelFeatureGates: + - NoRegistryClusterInstall + Version: v1 + kubeletconfigs.machineconfiguration.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/1453 diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index 7369c02db0..aac65c9acb 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -410,6 +410,65 @@ func (PoolSynchronizerStatus) SwaggerDoc() map[string]string { return map_PoolSynchronizerStatus } +var map_InternalReleaseImage = map[string]string{ + "": "InternalReleaseImage is used to keep track and manage a set of release bundles (OCP and OLM operators images) that are stored into the control planes nodes. This is a singleton resource with 'cluster' as the only valid name.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec describes the configuration of this internal release image.", + "status": "status describes the last observed state of this internal release image.", +} + +func (InternalReleaseImage) SwaggerDoc() map[string]string { + return map_InternalReleaseImage +} + +var map_InternalReleaseImageBundleStatus = map[string]string{ + "": "InternalReleaseImageBundleStatus describes the observed state of a single release bundle managed by the cluster.", + "conditions": "conditions represent the observations of an internal release image current state. Valid types are: Mounted, Installing, Available, Removing and Degraded.\n\nIf Mounted is true, that means that a valid ISO has been discovered and mounted on one of the cluster nodes. If Installing is true, that means that a new release bundle is currently being copied on one (or more) cluster nodes, and not yet completed. If Available is true, it means that the release has been previously installed on all the cluster nodes, and it can be used. If Removing is true, it means that a release deletion is in progress on one (or more) cluster nodes, and not yet completed. If Degraded is true, that means something has gone wrong (possibly on one or more cluster nodes).\n\nIn general, after installing a new release bundle, it is required to wait for the Conditions \"Available\" to become \"True\" (and all the other conditions to be equal to \"False\") before being able to pull its content. When present, conditions must contain at least 1 entry and must not exceed 5 entries.", + "name": "name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. The expected name format is ocp-release-bundle--.", + "image": "image is an OCP release image referenced by digest. The format of the image pull spec is: host[:port][/namespace]/name@sha256:, where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9. The length of the whole spec must be between 1 to 447 characters. The field is optional, and it will be provided after a release has been successfully installed.", +} + +func (InternalReleaseImageBundleStatus) SwaggerDoc() map[string]string { + return map_InternalReleaseImageBundleStatus +} + +var map_InternalReleaseImageList = map[string]string{ + "": "InternalReleaseImageList is a list of InternalReleaseImage resources\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "metadata": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", +} + +func (InternalReleaseImageList) SwaggerDoc() map[string]string { + return map_InternalReleaseImageList +} + +var map_InternalReleaseImageRef = map[string]string{ + "": "InternalReleaseImageRef is used to provide a simple reference for a release bundle. Currently it contains only the name field.", + "name": "name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. The expected name format is ocp-release-bundle--.", +} + +func (InternalReleaseImageRef) SwaggerDoc() map[string]string { + return map_InternalReleaseImageRef +} + +var map_InternalReleaseImageSpec = map[string]string{ + "": "InternalReleaseImageSpec defines the desired state of a InternalReleaseImage.", + "releases": "releases is a list of release bundle identifiers that the user wants to add/remove to/from the control plane nodes. Entries must be unique, keyed on the name field. releases must contain at least one entry and must not exceed 16 entries.", +} + +func (InternalReleaseImageSpec) SwaggerDoc() map[string]string { + return map_InternalReleaseImageSpec +} + +var map_InternalReleaseImageStatus = map[string]string{ + "": "InternalReleaseImageStatus describes the current state of a InternalReleaseImage.", + "conditions": "conditions represent the observations of the InternalReleaseImage controller current state. Valid types are: Degraded. If Degraded is true, that means something has gone wrong in the controller. The conditions list must contain at most 5 entries.", + "releases": "releases is a list of the release bundles currently owned and managed by the cluster. A release bundle content could be safely pulled only when its Conditions field contains at least an Available entry set to \"True\" and Degraded to \"False\". Entries must be unique, keyed on the name field. releases must contain at least one entry and must not exceed 32 entries.", +} + +func (InternalReleaseImageStatus) SwaggerDoc() map[string]string { + return map_InternalReleaseImageStatus +} + var map_IrreconcilableChangeDiff = map[string]string{ "": "IrreconcilableChangeDiff holds an individual diff between the initial install-time MachineConfig and the latest applied one caused by the presence of irreconcilable changes.", "fieldPath": "fieldPath is a required reference to the path in the latest rendered MachineConfig that differs from this nodes configuration. Must not be empty and must not exceed 70 characters in length. Must begin with the prefix 'spec.' and only contain alphanumeric characters, square brackets ('[]'), or dots ('.').", diff --git a/vendor/github.com/openshift/api/operator/v1/types_etcd.go b/vendor/github.com/openshift/api/operator/v1/types_etcd.go index 252f3b3990..f2f1131036 100644 --- a/vendor/github.com/openshift/api/operator/v1/types_etcd.go +++ b/vendor/github.com/openshift/api/operator/v1/types_etcd.go @@ -42,11 +42,11 @@ type EtcdSpec struct { HardwareSpeed ControlPlaneHardwareSpeed `json:"controlPlaneHardwareSpeed"` // backendQuotaGiB sets the etcd backend storage size limit in gibibytes. - // The value should be an integer not less than 8 and not more than 32. + // The value should be an integer not less than 8 and not more than 16. // When not specified, the default value is 8. // +kubebuilder:default:=8 // +kubebuilder:validation:Minimum=8 - // +kubebuilder:validation:Maximum=32 + // +kubebuilder:validation:Maximum=16 // +kubebuilder:validation:XValidation:rule="self>=oldSelf",message="etcd backendQuotaGiB may not be decreased" // +openshift:enable:FeatureGate=EtcdBackendQuota // +default=8 diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml index 1f58ced4e0..1feb64cbb5 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml @@ -50,10 +50,10 @@ spec: default: 8 description: |- backendQuotaGiB sets the etcd backend storage size limit in gibibytes. - The value should be an integer not less than 8 and not more than 32. + The value should be an integer not less than 8 and not more than 16. When not specified, the default value is 8. format: int32 - maximum: 32 + maximum: 16 minimum: 8 type: integer x-kubernetes-validations: diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml index 76d63711f7..2c32b9c964 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml @@ -50,10 +50,10 @@ spec: default: 8 description: |- backendQuotaGiB sets the etcd backend storage size limit in gibibytes. - The value should be an integer not less than 8 and not more than 32. + The value should be an integer not less than 8 and not more than 16. When not specified, the default value is 8. format: int32 - maximum: 32 + maximum: 16 minimum: 8 type: integer x-kubernetes-validations: diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml index 7433b66d36..b74dfb9893 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml @@ -50,10 +50,10 @@ spec: default: 8 description: |- backendQuotaGiB sets the etcd backend storage size limit in gibibytes. - The value should be an integer not less than 8 and not more than 32. + The value should be an integer not less than 8 and not more than 16. When not specified, the default value is 8. format: int32 - maximum: 32 + maximum: 16 minimum: 8 type: integer x-kubernetes-validations: diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go index c3ed726028..0b82b1ac66 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go @@ -798,7 +798,7 @@ func (EtcdList) SwaggerDoc() map[string]string { var map_EtcdSpec = map[string]string{ "controlPlaneHardwareSpeed": "HardwareSpeed allows user to change the etcd tuning profile which configures the latency parameters for heartbeat interval and leader election timeouts allowing the cluster to tolerate longer round-trip-times between etcd members. Valid values are \"\", \"Standard\" and \"Slower\".\n\t\"\" means no opinion and the platform is left to choose a reasonable default\n\twhich is subject to change without notice.", - "backendQuotaGiB": "backendQuotaGiB sets the etcd backend storage size limit in gibibytes. The value should be an integer not less than 8 and not more than 32. When not specified, the default value is 8.", + "backendQuotaGiB": "backendQuotaGiB sets the etcd backend storage size limit in gibibytes. The value should be an integer not less than 8 and not more than 16. When not specified, the default value is 8.", } func (EtcdSpec) SwaggerDoc() map[string]string { diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go index 35ec6d14e6..288edad61f 100644 --- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go +++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go @@ -78,6 +78,11 @@ type ClusterMonitoringSpecApplyConfiguration struct { // or topology spread constraints. // When set, at least one field must be specified within monitoringPluginConfig. MonitoringPluginConfig *MonitoringPluginConfigApplyConfiguration `json:"monitoringPluginConfig,omitempty"` + // kubeStateMetricsConfig is an optional field that can be used to configure the kube-state-metrics + // agent that runs in the openshift-monitoring namespace. kube-state-metrics generates metrics about + // the state of Kubernetes objects such as Deployments, Nodes, and Pods. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + KubeStateMetricsConfig *KubeStateMetricsConfigApplyConfiguration `json:"kubeStateMetricsConfig,omitempty"` } // ClusterMonitoringSpecApplyConfiguration constructs a declarative configuration of the ClusterMonitoringSpec type for use with @@ -173,3 +178,11 @@ func (b *ClusterMonitoringSpecApplyConfiguration) WithMonitoringPluginConfig(val b.MonitoringPluginConfig = value return b } + +// WithKubeStateMetricsConfig sets the KubeStateMetricsConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KubeStateMetricsConfig field is set to the value of the last call. +func (b *ClusterMonitoringSpecApplyConfiguration) WithKubeStateMetricsConfig(value *KubeStateMetricsConfigApplyConfiguration) *ClusterMonitoringSpecApplyConfiguration { + b.KubeStateMetricsConfig = value + return b +} diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsconfig.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsconfig.go new file mode 100644 index 0000000000..ed850ef346 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsconfig.go @@ -0,0 +1,145 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// KubeStateMetricsConfigApplyConfiguration represents a declarative configuration of the KubeStateMetricsConfig type for use +// with apply. +// +// KubeStateMetricsConfig provides configuration options for the kube-state-metrics agent +// that runs in the `openshift-monitoring` namespace. kube-state-metrics generates metrics +// about the state of Kubernetes objects such as Deployments, Nodes, and Pods. +type KubeStateMetricsConfigApplyConfiguration struct { + // nodeSelector defines the nodes on which the Pods are scheduled. + // nodeSelector is optional. + // + // When omitted, this means the user has no opinion and the platform is left + // to choose reasonable defaults. These defaults are subject to change over time. + // The current default value is `kubernetes.io/os: linux`. + // When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries. + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + // resources defines the compute resource requests and limits for the kube-state-metrics container. + // This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. + // When not specified, defaults are used by the platform. Requests cannot exceed limits. + // This field is optional. + // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + // This is a simplified API that maps to Kubernetes ResourceRequirements. + // The current default values are: + // resources: + // - name: cpu + // request: 4m + // limit: null + // - name: memory + // request: 40Mi + // limit: null + // Maximum length for this list is 5. + // Minimum length for this list is 1. + // Each resource name must be unique within this list. + Resources []ContainerResourceApplyConfiguration `json:"resources,omitempty"` + // tolerations defines tolerations for the pods. + // tolerations is optional. + // + // When omitted, no tolerations are applied. This default is subject to change over time. + // When specified, tolerations must contain at least 1 entry and must not contain more than 10 entries. + // Each toleration's operator, when specified, must be either "Exists" or "Equal". + // Each toleration's effect, when specified, must be one of "NoSchedule", "PreferNoSchedule", or "NoExecute". + // An empty or unset effect means match all effects. + Tolerations []v1.Toleration `json:"tolerations,omitempty"` + // topologySpreadConstraints defines rules for how kube-state-metrics Pods should be distributed + // across topology domains such as zones, nodes, or other user-defined labels. + // topologySpreadConstraints is optional. + // This helps improve high availability and resource efficiency by avoiding placing + // too many replicas in the same failure domain. + // + // This field maps directly to the `topologySpreadConstraints` field in the Pod spec. + // When omitted, no topology spread constraints are applied. This default is subject to change over time. + // When specified, topologySpreadConstraints must contain at least 1 entry and must not contain more than 10 entries. + // Entries must have unique topologyKey and whenUnsatisfiable pairs. + // Each entry's whenUnsatisfiable must be either "DoNotSchedule" or "ScheduleAnyway". + // Each entry's maxSkew must be at least 1. + // When minDomains is specified, it must be at least 1 and whenUnsatisfiable must be "DoNotSchedule". + TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` + // additionalResourceLabels defines additional Kubernetes resource labels to expose as metrics + // in kube-state-metrics. + // Currently, only "Job" and "CronJob" resources are supported due to cardinality concerns. + // Each entry specifies a resource name and a list of Kubernetes label names to expose. + // Use "*" in the labels list to expose all labels for a given resource. + // additionalResourceLabels is optional. + // When omitted, no additional Kubernetes object labels are exposed as metrics + // by kube-state-metrics beyond its built-in metric labels (e.g. namespace, job_name). + // Use this field to opt in to exposing specific Kubernetes labels as metric labels + // for the supported resource types. + // Minimum length for this list is 1. + // Maximum length for this list is 2. + // Each resource name must be unique within this list. + AdditionalResourceLabels []KubeStateMetricsResourceLabelsApplyConfiguration `json:"additionalResourceLabels,omitempty"` +} + +// KubeStateMetricsConfigApplyConfiguration constructs a declarative configuration of the KubeStateMetricsConfig type for use with +// apply. +func KubeStateMetricsConfig() *KubeStateMetricsConfigApplyConfiguration { + return &KubeStateMetricsConfigApplyConfiguration{} +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *KubeStateMetricsConfigApplyConfiguration) WithNodeSelector(entries map[string]string) *KubeStateMetricsConfigApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} + +// WithResources adds the given value to the Resources field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Resources field. +func (b *KubeStateMetricsConfigApplyConfiguration) WithResources(values ...*ContainerResourceApplyConfiguration) *KubeStateMetricsConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResources") + } + b.Resources = append(b.Resources, *values[i]) + } + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *KubeStateMetricsConfigApplyConfiguration) WithTolerations(values ...v1.Toleration) *KubeStateMetricsConfigApplyConfiguration { + for i := range values { + b.Tolerations = append(b.Tolerations, values[i]) + } + return b +} + +// WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field. +func (b *KubeStateMetricsConfigApplyConfiguration) WithTopologySpreadConstraints(values ...v1.TopologySpreadConstraint) *KubeStateMetricsConfigApplyConfiguration { + for i := range values { + b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, values[i]) + } + return b +} + +// WithAdditionalResourceLabels adds the given value to the AdditionalResourceLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AdditionalResourceLabels field. +func (b *KubeStateMetricsConfigApplyConfiguration) WithAdditionalResourceLabels(values ...*KubeStateMetricsResourceLabelsApplyConfiguration) *KubeStateMetricsConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAdditionalResourceLabels") + } + b.AdditionalResourceLabels = append(b.AdditionalResourceLabels, *values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsresourcelabels.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsresourcelabels.go new file mode 100644 index 0000000000..8b4de02a9a --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsresourcelabels.go @@ -0,0 +1,53 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + configv1alpha1 "github.com/openshift/api/config/v1alpha1" +) + +// KubeStateMetricsResourceLabelsApplyConfiguration represents a declarative configuration of the KubeStateMetricsResourceLabels type for use +// with apply. +// +// KubeStateMetricsResourceLabels defines which Kubernetes labels to expose as metrics +// for a given resource type in kube-state-metrics. +type KubeStateMetricsResourceLabelsApplyConfiguration struct { + // resource is the Kubernetes resource name whose labels should be exposed as metrics. + // Currently, only "Job" and "CronJob" are supported due to cardinality concerns. + // Valid values are "Job" and "CronJob". + // This field is required. + Resource *configv1alpha1.KubeStateMetricsResourceName `json:"resource,omitempty"` + // labels is the list of Kubernetes label names to expose as metrics for this resource. + // Use "*" to expose all labels for the specified resource. + // When "*" is specified, it must be the only entry in the list; mixing "*" with + // specific label names is not allowed. + // This field is required. + // Each label name must be unique within this list. + // Minimum length for this list is 1. + // Maximum length for this list is 50. + Labels []configv1alpha1.KubeStateMetricsLabelName `json:"labels,omitempty"` +} + +// KubeStateMetricsResourceLabelsApplyConfiguration constructs a declarative configuration of the KubeStateMetricsResourceLabels type for use with +// apply. +func KubeStateMetricsResourceLabels() *KubeStateMetricsResourceLabelsApplyConfiguration { + return &KubeStateMetricsResourceLabelsApplyConfiguration{} +} + +// WithResource sets the Resource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resource field is set to the value of the last call. +func (b *KubeStateMetricsResourceLabelsApplyConfiguration) WithResource(value configv1alpha1.KubeStateMetricsResourceName) *KubeStateMetricsResourceLabelsApplyConfiguration { + b.Resource = &value + return b +} + +// WithLabels adds the given value to the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Labels field. +func (b *KubeStateMetricsResourceLabelsApplyConfiguration) WithLabels(values ...configv1alpha1.KubeStateMetricsLabelName) *KubeStateMetricsResourceLabelsApplyConfiguration { + for i := range values { + b.Labels = append(b.Labels, values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go index 10bf2d9bdd..b3e340daa1 100644 --- a/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go +++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go @@ -5111,6 +5111,10 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: com.github.openshift.api.config.v1alpha1.AlertmanagerConfig default: {} + - name: kubeStateMetricsConfig + type: + namedType: com.github.openshift.api.config.v1alpha1.KubeStateMetricsConfig + default: {} - name: metricsServerConfig type: namedType: com.github.openshift.api.config.v1alpha1.MetricsServerConfig @@ -5323,6 +5327,57 @@ var schemaYAML = typed.YAMLObject(`types: discriminatorValue: ECDSA - fieldName: rsa discriminatorValue: RSA +- name: com.github.openshift.api.config.v1alpha1.KubeStateMetricsConfig + map: + fields: + - name: additionalResourceLabels + type: + list: + elementType: + namedType: com.github.openshift.api.config.v1alpha1.KubeStateMetricsResourceLabels + elementRelationship: associative + keys: + - resource + - name: nodeSelector + type: + map: + elementType: + scalar: string + - name: resources + type: + list: + elementType: + namedType: com.github.openshift.api.config.v1alpha1.ContainerResource + elementRelationship: associative + keys: + - name + - name: tolerations + type: + list: + elementType: + namedType: Toleration.v1.core.api.k8s.io + elementRelationship: atomic + - name: topologySpreadConstraints + type: + list: + elementType: + namedType: TopologySpreadConstraint.v1.core.api.k8s.io + elementRelationship: associative + keys: + - topologyKey + - whenUnsatisfiable +- name: com.github.openshift.api.config.v1alpha1.KubeStateMetricsResourceLabels + map: + fields: + - name: labels + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: resource + type: + scalar: string - name: com.github.openshift.api.config.v1alpha1.Label map: fields: diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/utils.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/utils.go index 47aab90c8e..b5690c4d81 100644 --- a/vendor/github.com/openshift/client-go/config/applyconfigurations/utils.go +++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/utils.go @@ -560,6 +560,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &configv1alpha1.KeepEqualActionConfigApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("KeyConfig"): return &configv1alpha1.KeyConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("KubeStateMetricsConfig"): + return &configv1alpha1.KubeStateMetricsConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("KubeStateMetricsResourceLabels"): + return &configv1alpha1.KubeStateMetricsResourceLabelsApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("Label"): return &configv1alpha1.LabelApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("LabelMapActionConfig"): diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/internal/internal.go b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/internal/internal.go index 656f22e827..273dccbc9f 100644 --- a/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/internal/internal.go +++ b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/internal/internal.go @@ -195,6 +195,16 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: __untyped_deduced_ elementRelationship: separable +- name: com.github.openshift.api.machineconfiguration.v1.InternalReleaseImage + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable - name: com.github.openshift.api.machineconfiguration.v1.KubeletConfig scalar: untyped list: diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimage.go b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimage.go new file mode 100644 index 0000000000..a3bc9b1e88 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimage.go @@ -0,0 +1,280 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + machineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1" + internal "github.com/openshift/client-go/machineconfiguration/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// InternalReleaseImageApplyConfiguration represents a declarative configuration of the InternalReleaseImage type for use +// with apply. +// +// InternalReleaseImage is used to keep track and manage a set +// of release bundles (OCP and OLM operators images) that are stored +// into the control planes nodes. +// This is a singleton resource with 'cluster' as the only valid name. +// +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +type InternalReleaseImageApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec describes the configuration of this internal release image. + Spec *InternalReleaseImageSpecApplyConfiguration `json:"spec,omitempty"` + // status describes the last observed state of this internal release image. + Status *InternalReleaseImageStatusApplyConfiguration `json:"status,omitempty"` +} + +// InternalReleaseImage constructs a declarative configuration of the InternalReleaseImage type for use with +// apply. +func InternalReleaseImage(name string) *InternalReleaseImageApplyConfiguration { + b := &InternalReleaseImageApplyConfiguration{} + b.WithName(name) + b.WithKind("InternalReleaseImage") + b.WithAPIVersion("machineconfiguration.openshift.io/v1") + return b +} + +// ExtractInternalReleaseImageFrom extracts the applied configuration owned by fieldManager from +// internalReleaseImage for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// internalReleaseImage must be a unmodified InternalReleaseImage API object that was retrieved from the Kubernetes API. +// ExtractInternalReleaseImageFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractInternalReleaseImageFrom(internalReleaseImage *machineconfigurationv1.InternalReleaseImage, fieldManager string, subresource string) (*InternalReleaseImageApplyConfiguration, error) { + b := &InternalReleaseImageApplyConfiguration{} + err := managedfields.ExtractInto(internalReleaseImage, internal.Parser().Type("com.github.openshift.api.machineconfiguration.v1.InternalReleaseImage"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(internalReleaseImage.Name) + + b.WithKind("InternalReleaseImage") + b.WithAPIVersion("machineconfiguration.openshift.io/v1") + return b, nil +} + +// ExtractInternalReleaseImage extracts the applied configuration owned by fieldManager from +// internalReleaseImage. If no managedFields are found in internalReleaseImage for fieldManager, a +// InternalReleaseImageApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// internalReleaseImage must be a unmodified InternalReleaseImage API object that was retrieved from the Kubernetes API. +// ExtractInternalReleaseImage provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractInternalReleaseImage(internalReleaseImage *machineconfigurationv1.InternalReleaseImage, fieldManager string) (*InternalReleaseImageApplyConfiguration, error) { + return ExtractInternalReleaseImageFrom(internalReleaseImage, fieldManager, "") +} + +// ExtractInternalReleaseImageStatus extracts the applied configuration owned by fieldManager from +// internalReleaseImage for the status subresource. +func ExtractInternalReleaseImageStatus(internalReleaseImage *machineconfigurationv1.InternalReleaseImage, fieldManager string) (*InternalReleaseImageApplyConfiguration, error) { + return ExtractInternalReleaseImageFrom(internalReleaseImage, fieldManager, "status") +} + +func (b InternalReleaseImageApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithKind(value string) *InternalReleaseImageApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithAPIVersion(value string) *InternalReleaseImageApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithName(value string) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithGenerateName(value string) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithNamespace(value string) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithUID(value types.UID) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithResourceVersion(value string) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithGeneration(value int64) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *InternalReleaseImageApplyConfiguration) WithLabels(entries map[string]string) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *InternalReleaseImageApplyConfiguration) WithAnnotations(entries map[string]string) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *InternalReleaseImageApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *InternalReleaseImageApplyConfiguration) WithFinalizers(values ...string) *InternalReleaseImageApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *InternalReleaseImageApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithSpec(value *InternalReleaseImageSpecApplyConfiguration) *InternalReleaseImageApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *InternalReleaseImageApplyConfiguration) WithStatus(value *InternalReleaseImageStatusApplyConfiguration) *InternalReleaseImageApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *InternalReleaseImageApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *InternalReleaseImageApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *InternalReleaseImageApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *InternalReleaseImageApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagebundlestatus.go b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagebundlestatus.go new file mode 100644 index 0000000000..ee063c744f --- /dev/null +++ b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagebundlestatus.go @@ -0,0 +1,70 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// InternalReleaseImageBundleStatusApplyConfiguration represents a declarative configuration of the InternalReleaseImageBundleStatus type for use +// with apply. +// +// InternalReleaseImageBundleStatus describes the observed state of a single release bundle managed by the cluster. +type InternalReleaseImageBundleStatusApplyConfiguration struct { + // conditions represent the observations of an internal release image current state. Valid types are: + // Mounted, Installing, Available, Removing and Degraded. + // + // If Mounted is true, that means that a valid ISO has been discovered and mounted on one of the cluster nodes. + // If Installing is true, that means that a new release bundle is currently being copied on one (or more) cluster nodes, and not yet completed. + // If Available is true, it means that the release has been previously installed on all the cluster nodes, and it can be used. + // If Removing is true, it means that a release deletion is in progress on one (or more) cluster nodes, and not yet completed. + // If Degraded is true, that means something has gone wrong (possibly on one or more cluster nodes). + // + // In general, after installing a new release bundle, it is required to wait for the Conditions "Available" to become "True" (and all + // the other conditions to be equal to "False") before being able to pull its content. + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. + // The expected name format is ocp-release-bundle--. + Name *string `json:"name,omitempty"` + // image is an OCP release image referenced by digest. + // The format of the image pull spec is: host[:port][/namespace]/name@sha256:, + // where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9. + // The length of the whole spec must be between 1 to 447 characters. + // The field is optional, and it will be provided after a release has been successfully installed. + Image *string `json:"image,omitempty"` +} + +// InternalReleaseImageBundleStatusApplyConfiguration constructs a declarative configuration of the InternalReleaseImageBundleStatus type for use with +// apply. +func InternalReleaseImageBundleStatus() *InternalReleaseImageBundleStatusApplyConfiguration { + return &InternalReleaseImageBundleStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *InternalReleaseImageBundleStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *InternalReleaseImageBundleStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *InternalReleaseImageBundleStatusApplyConfiguration) WithName(value string) *InternalReleaseImageBundleStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *InternalReleaseImageBundleStatusApplyConfiguration) WithImage(value string) *InternalReleaseImageBundleStatusApplyConfiguration { + b.Image = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimageref.go b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimageref.go new file mode 100644 index 0000000000..2660edfe98 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimageref.go @@ -0,0 +1,28 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// InternalReleaseImageRefApplyConfiguration represents a declarative configuration of the InternalReleaseImageRef type for use +// with apply. +// +// InternalReleaseImageRef is used to provide a simple reference for a release +// bundle. Currently it contains only the name field. +type InternalReleaseImageRefApplyConfiguration struct { + // name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long. + // The expected name format is ocp-release-bundle--. + Name *string `json:"name,omitempty"` +} + +// InternalReleaseImageRefApplyConfiguration constructs a declarative configuration of the InternalReleaseImageRef type for use with +// apply. +func InternalReleaseImageRef() *InternalReleaseImageRefApplyConfiguration { + return &InternalReleaseImageRefApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *InternalReleaseImageRefApplyConfiguration) WithName(value string) *InternalReleaseImageRefApplyConfiguration { + b.Name = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagespec.go b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagespec.go new file mode 100644 index 0000000000..69dddfcc55 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagespec.go @@ -0,0 +1,34 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// InternalReleaseImageSpecApplyConfiguration represents a declarative configuration of the InternalReleaseImageSpec type for use +// with apply. +// +// InternalReleaseImageSpec defines the desired state of a InternalReleaseImage. +type InternalReleaseImageSpecApplyConfiguration struct { + // releases is a list of release bundle identifiers that the user wants to + // add/remove to/from the control plane nodes. + // Entries must be unique, keyed on the name field. + // releases must contain at least one entry and must not exceed 16 entries. + Releases []InternalReleaseImageRefApplyConfiguration `json:"releases,omitempty"` +} + +// InternalReleaseImageSpecApplyConfiguration constructs a declarative configuration of the InternalReleaseImageSpec type for use with +// apply. +func InternalReleaseImageSpec() *InternalReleaseImageSpecApplyConfiguration { + return &InternalReleaseImageSpecApplyConfiguration{} +} + +// WithReleases adds the given value to the Releases field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Releases field. +func (b *InternalReleaseImageSpecApplyConfiguration) WithReleases(values ...*InternalReleaseImageRefApplyConfiguration) *InternalReleaseImageSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReleases") + } + b.Releases = append(b.Releases, *values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagestatus.go b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagestatus.go new file mode 100644 index 0000000000..a2a36881e5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/internalreleaseimagestatus.go @@ -0,0 +1,58 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// InternalReleaseImageStatusApplyConfiguration represents a declarative configuration of the InternalReleaseImageStatus type for use +// with apply. +// +// InternalReleaseImageStatus describes the current state of a InternalReleaseImage. +type InternalReleaseImageStatusApplyConfiguration struct { + // conditions represent the observations of the InternalReleaseImage controller current state. + // Valid types are: Degraded. + // If Degraded is true, that means something has gone wrong in the controller. + // The conditions list must contain at most 5 entries. + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // releases is a list of the release bundles currently owned and managed by the + // cluster. + // A release bundle content could be safely pulled only when its Conditions field + // contains at least an Available entry set to "True" and Degraded to "False". + // Entries must be unique, keyed on the name field. + // releases must contain at least one entry and must not exceed 32 entries. + Releases []InternalReleaseImageBundleStatusApplyConfiguration `json:"releases,omitempty"` +} + +// InternalReleaseImageStatusApplyConfiguration constructs a declarative configuration of the InternalReleaseImageStatus type for use with +// apply. +func InternalReleaseImageStatus() *InternalReleaseImageStatusApplyConfiguration { + return &InternalReleaseImageStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *InternalReleaseImageStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *InternalReleaseImageStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithReleases adds the given value to the Releases field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Releases field. +func (b *InternalReleaseImageStatusApplyConfiguration) WithReleases(values ...*InternalReleaseImageBundleStatusApplyConfiguration) *InternalReleaseImageStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReleases") + } + b.Releases = append(b.Releases, *values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/utils.go b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/utils.go index 7fb4007ae4..3a08201ffb 100644 --- a/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/utils.go +++ b/vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/utils.go @@ -50,6 +50,16 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &machineconfigurationv1.ImageRegistryBundleApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ImageSecretObjectReference"): return &machineconfigurationv1.ImageSecretObjectReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("InternalReleaseImage"): + return &machineconfigurationv1.InternalReleaseImageApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("InternalReleaseImageBundleStatus"): + return &machineconfigurationv1.InternalReleaseImageBundleStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("InternalReleaseImageRef"): + return &machineconfigurationv1.InternalReleaseImageRefApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("InternalReleaseImageSpec"): + return &machineconfigurationv1.InternalReleaseImageSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("InternalReleaseImageStatus"): + return &machineconfigurationv1.InternalReleaseImageStatusApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("IrreconcilableChangeDiff"): return &machineconfigurationv1.IrreconcilableChangeDiffApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("KubeletConfig"): diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_internalreleaseimage.go b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_internalreleaseimage.go new file mode 100644 index 0000000000..e4fc3ef150 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_internalreleaseimage.go @@ -0,0 +1,37 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/machineconfiguration/v1" + machineconfigurationv1 "github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1" + typedmachineconfigurationv1 "github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeInternalReleaseImages implements InternalReleaseImageInterface +type fakeInternalReleaseImages struct { + *gentype.FakeClientWithListAndApply[*v1.InternalReleaseImage, *v1.InternalReleaseImageList, *machineconfigurationv1.InternalReleaseImageApplyConfiguration] + Fake *FakeMachineconfigurationV1 +} + +func newFakeInternalReleaseImages(fake *FakeMachineconfigurationV1) typedmachineconfigurationv1.InternalReleaseImageInterface { + return &fakeInternalReleaseImages{ + gentype.NewFakeClientWithListAndApply[*v1.InternalReleaseImage, *v1.InternalReleaseImageList, *machineconfigurationv1.InternalReleaseImageApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("internalreleaseimages"), + v1.SchemeGroupVersion.WithKind("InternalReleaseImage"), + func() *v1.InternalReleaseImage { return &v1.InternalReleaseImage{} }, + func() *v1.InternalReleaseImageList { return &v1.InternalReleaseImageList{} }, + func(dst, src *v1.InternalReleaseImageList) { dst.ListMeta = src.ListMeta }, + func(list *v1.InternalReleaseImageList) []*v1.InternalReleaseImage { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.InternalReleaseImageList, items []*v1.InternalReleaseImage) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfiguration_client.go b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfiguration_client.go index 81354c417e..05c4f2d80f 100644 --- a/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfiguration_client.go +++ b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfiguration_client.go @@ -20,6 +20,10 @@ func (c *FakeMachineconfigurationV1) ControllerConfigs() v1.ControllerConfigInte return newFakeControllerConfigs(c) } +func (c *FakeMachineconfigurationV1) InternalReleaseImages() v1.InternalReleaseImageInterface { + return newFakeInternalReleaseImages(c) +} + func (c *FakeMachineconfigurationV1) KubeletConfigs() v1.KubeletConfigInterface { return newFakeKubeletConfigs(c) } diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/generated_expansion.go b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/generated_expansion.go index bd8ab6e162..fa409d9fbb 100644 --- a/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/generated_expansion.go +++ b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/generated_expansion.go @@ -6,6 +6,8 @@ type ContainerRuntimeConfigExpansion interface{} type ControllerConfigExpansion interface{} +type InternalReleaseImageExpansion interface{} + type KubeletConfigExpansion interface{} type MachineConfigExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/internalreleaseimage.go b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/internalreleaseimage.go new file mode 100644 index 0000000000..c0deae9ac4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/internalreleaseimage.go @@ -0,0 +1,62 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + machineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1" + applyconfigurationsmachineconfigurationv1 "github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1" + scheme "github.com/openshift/client-go/machineconfiguration/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// InternalReleaseImagesGetter has a method to return a InternalReleaseImageInterface. +// A group's client should implement this interface. +type InternalReleaseImagesGetter interface { + InternalReleaseImages() InternalReleaseImageInterface +} + +// InternalReleaseImageInterface has methods to work with InternalReleaseImage resources. +type InternalReleaseImageInterface interface { + Create(ctx context.Context, internalReleaseImage *machineconfigurationv1.InternalReleaseImage, opts metav1.CreateOptions) (*machineconfigurationv1.InternalReleaseImage, error) + Update(ctx context.Context, internalReleaseImage *machineconfigurationv1.InternalReleaseImage, opts metav1.UpdateOptions) (*machineconfigurationv1.InternalReleaseImage, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, internalReleaseImage *machineconfigurationv1.InternalReleaseImage, opts metav1.UpdateOptions) (*machineconfigurationv1.InternalReleaseImage, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*machineconfigurationv1.InternalReleaseImage, error) + List(ctx context.Context, opts metav1.ListOptions) (*machineconfigurationv1.InternalReleaseImageList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *machineconfigurationv1.InternalReleaseImage, err error) + Apply(ctx context.Context, internalReleaseImage *applyconfigurationsmachineconfigurationv1.InternalReleaseImageApplyConfiguration, opts metav1.ApplyOptions) (result *machineconfigurationv1.InternalReleaseImage, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, internalReleaseImage *applyconfigurationsmachineconfigurationv1.InternalReleaseImageApplyConfiguration, opts metav1.ApplyOptions) (result *machineconfigurationv1.InternalReleaseImage, err error) + InternalReleaseImageExpansion +} + +// internalReleaseImages implements InternalReleaseImageInterface +type internalReleaseImages struct { + *gentype.ClientWithListAndApply[*machineconfigurationv1.InternalReleaseImage, *machineconfigurationv1.InternalReleaseImageList, *applyconfigurationsmachineconfigurationv1.InternalReleaseImageApplyConfiguration] +} + +// newInternalReleaseImages returns a InternalReleaseImages +func newInternalReleaseImages(c *MachineconfigurationV1Client) *internalReleaseImages { + return &internalReleaseImages{ + gentype.NewClientWithListAndApply[*machineconfigurationv1.InternalReleaseImage, *machineconfigurationv1.InternalReleaseImageList, *applyconfigurationsmachineconfigurationv1.InternalReleaseImageApplyConfiguration]( + "internalreleaseimages", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *machineconfigurationv1.InternalReleaseImage { + return &machineconfigurationv1.InternalReleaseImage{} + }, + func() *machineconfigurationv1.InternalReleaseImageList { + return &machineconfigurationv1.InternalReleaseImageList{} + }, + ), + } +} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfiguration_client.go b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfiguration_client.go index 8d661ff173..458b52ca97 100644 --- a/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfiguration_client.go +++ b/vendor/github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfiguration_client.go @@ -14,6 +14,7 @@ type MachineconfigurationV1Interface interface { RESTClient() rest.Interface ContainerRuntimeConfigsGetter ControllerConfigsGetter + InternalReleaseImagesGetter KubeletConfigsGetter MachineConfigsGetter MachineConfigNodesGetter @@ -37,6 +38,10 @@ func (c *MachineconfigurationV1Client) ControllerConfigs() ControllerConfigInter return newControllerConfigs(c) } +func (c *MachineconfigurationV1Client) InternalReleaseImages() InternalReleaseImageInterface { + return newInternalReleaseImages(c) +} + func (c *MachineconfigurationV1Client) KubeletConfigs() KubeletConfigInterface { return newKubeletConfigs(c) } diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/generic.go b/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/generic.go index d82e58acfb..a6365dde64 100644 --- a/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/generic.go +++ b/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/generic.go @@ -42,6 +42,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Machineconfiguration().V1().ContainerRuntimeConfigs().Informer()}, nil case v1.SchemeGroupVersion.WithResource("controllerconfigs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Machineconfiguration().V1().ControllerConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("internalreleaseimages"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Machineconfiguration().V1().InternalReleaseImages().Informer()}, nil case v1.SchemeGroupVersion.WithResource("kubeletconfigs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Machineconfiguration().V1().KubeletConfigs().Informer()}, nil case v1.SchemeGroupVersion.WithResource("machineconfigs"): diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1/interface.go b/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1/interface.go index c947034b69..9638a47ffe 100644 --- a/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1/interface.go +++ b/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1/interface.go @@ -12,6 +12,8 @@ type Interface interface { ContainerRuntimeConfigs() ContainerRuntimeConfigInformer // ControllerConfigs returns a ControllerConfigInformer. ControllerConfigs() ControllerConfigInformer + // InternalReleaseImages returns a InternalReleaseImageInformer. + InternalReleaseImages() InternalReleaseImageInformer // KubeletConfigs returns a KubeletConfigInformer. KubeletConfigs() KubeletConfigInformer // MachineConfigs returns a MachineConfigInformer. @@ -51,6 +53,11 @@ func (v *version) ControllerConfigs() ControllerConfigInformer { return &controllerConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } +// InternalReleaseImages returns a InternalReleaseImageInformer. +func (v *version) InternalReleaseImages() InternalReleaseImageInformer { + return &internalReleaseImageInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // KubeletConfigs returns a KubeletConfigInformer. func (v *version) KubeletConfigs() KubeletConfigInformer { return &kubeletConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1/internalreleaseimage.go b/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1/internalreleaseimage.go new file mode 100644 index 0000000000..0316261249 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1/internalreleaseimage.go @@ -0,0 +1,85 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + time "time" + + apimachineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1" + versioned "github.com/openshift/client-go/machineconfiguration/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/machineconfiguration/informers/externalversions/internalinterfaces" + machineconfigurationv1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// InternalReleaseImageInformer provides access to a shared informer and lister for +// InternalReleaseImages. +type InternalReleaseImageInformer interface { + Informer() cache.SharedIndexInformer + Lister() machineconfigurationv1.InternalReleaseImageLister +} + +type internalReleaseImageInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewInternalReleaseImageInformer constructs a new informer for InternalReleaseImage type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInternalReleaseImageInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInternalReleaseImageInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredInternalReleaseImageInformer constructs a new informer for InternalReleaseImage type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInternalReleaseImageInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineconfigurationV1().InternalReleaseImages().List(context.Background(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineconfigurationV1().InternalReleaseImages().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineconfigurationV1().InternalReleaseImages().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineconfigurationV1().InternalReleaseImages().Watch(ctx, options) + }, + }, client), + &apimachineconfigurationv1.InternalReleaseImage{}, + resyncPeriod, + indexers, + ) +} + +func (f *internalReleaseImageInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInternalReleaseImageInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *internalReleaseImageInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apimachineconfigurationv1.InternalReleaseImage{}, f.defaultInformer) +} + +func (f *internalReleaseImageInformer) Lister() machineconfigurationv1.InternalReleaseImageLister { + return machineconfigurationv1.NewInternalReleaseImageLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1/expansion_generated.go b/vendor/github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1/expansion_generated.go index e3489b5515..39cd1db0e7 100644 --- a/vendor/github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1/expansion_generated.go +++ b/vendor/github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1/expansion_generated.go @@ -10,6 +10,10 @@ type ContainerRuntimeConfigListerExpansion interface{} // ControllerConfigLister. type ControllerConfigListerExpansion interface{} +// InternalReleaseImageListerExpansion allows custom methods to be added to +// InternalReleaseImageLister. +type InternalReleaseImageListerExpansion interface{} + // KubeletConfigListerExpansion allows custom methods to be added to // KubeletConfigLister. type KubeletConfigListerExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1/internalreleaseimage.go b/vendor/github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1/internalreleaseimage.go new file mode 100644 index 0000000000..69e48052e3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1/internalreleaseimage.go @@ -0,0 +1,32 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + machineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// InternalReleaseImageLister helps list InternalReleaseImages. +// All objects returned here must be treated as read-only. +type InternalReleaseImageLister interface { + // List lists all InternalReleaseImages in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*machineconfigurationv1.InternalReleaseImage, err error) + // Get retrieves the InternalReleaseImage from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*machineconfigurationv1.InternalReleaseImage, error) + InternalReleaseImageListerExpansion +} + +// internalReleaseImageLister implements the InternalReleaseImageLister interface. +type internalReleaseImageLister struct { + listers.ResourceIndexer[*machineconfigurationv1.InternalReleaseImage] +} + +// NewInternalReleaseImageLister returns a new InternalReleaseImageLister. +func NewInternalReleaseImageLister(indexer cache.Indexer) InternalReleaseImageLister { + return &internalReleaseImageLister{listers.New[*machineconfigurationv1.InternalReleaseImage](indexer, machineconfigurationv1.Resource("internalreleaseimage"))} +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 405f554b2b..78c245039f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1269,7 +1269,7 @@ github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo github.com/openshift-eng/openshift-tests-extension/pkg/junit github.com/openshift-eng/openshift-tests-extension/pkg/util/sets github.com/openshift-eng/openshift-tests-extension/pkg/version -# github.com/openshift/api v0.0.0-20260603130340-1ad2ac3eb53d +# github.com/openshift/api v0.0.0-20260603130340-1ad2ac3eb53d => github.com/pawanpinjarkar/api v0.0.0-20260611132132-df7836b66b8f ## explicit; go 1.25.0 github.com/openshift/api github.com/openshift/api/annotations @@ -1357,7 +1357,7 @@ github.com/openshift/api/template github.com/openshift/api/template/v1 github.com/openshift/api/user github.com/openshift/api/user/v1 -# github.com/openshift/client-go v0.0.0-20260603140539-6892dc3e1ffc +# github.com/openshift/client-go v0.0.0-20260603140539-6892dc3e1ffc => github.com/andfasano/client-go v0.0.0-20260612090900-fc2da8892827 ## explicit; go 1.25.0 github.com/openshift/client-go/apps/applyconfigurations/apps/v1 github.com/openshift/client-go/apps/applyconfigurations/internal @@ -4009,3 +4009,5 @@ sigs.k8s.io/yaml/kyaml # k8s.io/sample-apiserver => github.com/openshift/kubernetes/staging/src/k8s.io/sample-apiserver v0.0.0-20260305123649-d18f3f005eaa # k8s.io/sample-cli-plugin => github.com/openshift/kubernetes/staging/src/k8s.io/sample-cli-plugin v0.0.0-20260305123649-d18f3f005eaa # k8s.io/sample-controller => github.com/openshift/kubernetes/staging/src/k8s.io/sample-controller v0.0.0-20260305123649-d18f3f005eaa +# github.com/openshift/api => github.com/pawanpinjarkar/api v0.0.0-20260611132132-df7836b66b8f +# github.com/openshift/client-go => github.com/andfasano/client-go v0.0.0-20260612090900-fc2da8892827