Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/machine-config-controller/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/machine-config-daemon/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/machine-config-operator/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Expand Down
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
objectSelector: {}
resourceRules:
- apiGroups: ["machineconfiguration.openshift.io"]
apiVersions: ["v1alpha1"]
apiVersions: ["v1"]
operations: ["DELETE"]
resources: ["internalreleaseimages"]
scope: "*"
Expand Down
9 changes: 3 additions & 6 deletions pkg/controller/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/certrotation/certrotation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/certrotation/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
},
Expand Down
8 changes: 3 additions & 5 deletions pkg/controller/common/iri_secret_merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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{
Expand Down Expand Up @@ -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) {
Expand Down
30 changes: 14 additions & 16 deletions pkg/controller/common/iri_secret_merger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---
Expand Down Expand Up @@ -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},
}
}
Expand Down Expand Up @@ -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 ---
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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",
},
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -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",
},
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand Down
Loading