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
4 changes: 2 additions & 2 deletions cmd/machine-config-controller/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func createControllers(ctx *ctrlcommon.ControllerContext) []ctrlcommon.Controlle
ctx.InformerFactory.Machineconfiguration().V1().ContainerRuntimeConfigs(),
ctx.InformerFactory.Machineconfiguration().V1().KubeletConfigs(),
ctx.OperatorInformerFactory.Operator().V1().MachineConfigurations(),
ctx.InformerFactory.Machineconfiguration().V1alpha1().OSImageStreams(),
ctx.InformerFactory.Machineconfiguration().V1().OSImageStreams(),
ctx.ClientBuilder.KubeClientOrDie("render-controller"),
ctx.ClientBuilder.MachineConfigClientOrDie("render-controller"),
ctx.FeatureGatesHandler,
Expand All @@ -286,7 +286,7 @@ func createControllers(ctx *ctrlcommon.ControllerContext) []ctrlcommon.Controlle
ctx.InformerFactory.Machineconfiguration().V1().MachineConfigNodes(),
ctx.ConfigInformerFactory.Config().V1().Schedulers(),
ctx.OperatorInformerFactory.Operator().V1().MachineConfigurations(),
ctx.InformerFactory.Machineconfiguration().V1alpha1().OSImageStreams(),
ctx.InformerFactory.Machineconfiguration().V1().OSImageStreams(),
ctx.ConfigInformerFactory.Config().V1().Infrastructures(),
ctx.ClientBuilder.KubeClientOrDie("node-update-controller"),
ctx.ClientBuilder.MachineConfigClientOrDie("node-update-controller"),
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 @@ -118,7 +118,7 @@ func runStartCmd(_ *cobra.Command, _ []string) {
ctrlctx.ConfigInformerFactory.Config().V1().APIServers(),
ctrlctx.NamespacedInformerFactory.Machineconfiguration().V1().MachineOSConfigs(),
ctrlctx.ConfigInformerFactory.Config().V1().ClusterVersions(),
ctrlctx.InformerFactory.Machineconfiguration().V1alpha1().OSImageStreams(),
ctrlctx.InformerFactory.Machineconfiguration().V1().OSImageStreams(),
iriInformer,
ctrlctx,
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/machine-config-osimagestream/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sigs.k8s.io/yaml"

imagev1 "github.com/openshift/api/image/v1"
mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

k8serrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -29,7 +29,7 @@ const (
)

// Retrieves the OSImageStream for the given release image or ImageStream path.
func getOSImageStreamFromReleaseImageOrImageStream(opts getOpts) (_ *mcfgv1alpha1.OSImageStream, errOut error) {
func getOSImageStreamFromReleaseImageOrImageStream(opts getOpts) (_ *mcfgv1.OSImageStream, errOut error) {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5)
defer cancel()

Expand Down Expand Up @@ -92,7 +92,7 @@ func getOSImageStreamFromReleaseImageOrImageStream(opts getOpts) (_ *mcfgv1alpha

// Wraps osimagestream.GetOSImageStreamSetByName() and provides more helpful
// output whenever a not found error is returned.
func getOSImageStreamSetFromOSImageStream(osImageStream *mcfgv1alpha1.OSImageStream, name string) (*mcfgv1alpha1.OSImageStreamSet, error) {
func getOSImageStreamSetFromOSImageStream(osImageStream *mcfgv1.OSImageStream, name string) (*mcfgv1.OSImageStreamSet, error) {
if name == "" {
return nil, fmt.Errorf("empty OSImageStream name")
}
Expand Down Expand Up @@ -151,7 +151,7 @@ func detectFormatFromFilepath(filepath, fallbackFormat string) string {
}

// Writes the OSImageStream to a file or stdout in the desired format.
func writeOutput(osImageStream *mcfgv1alpha1.OSImageStream, format, outputFile string) error {
func writeOutput(osImageStream *mcfgv1.OSImageStream, format, outputFile string) error {
// Detect format from file extension if outputFile is provided
finalFormat := format
if outputFile != "" {
Expand Down
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ require (
github.com/onsi/gomega v1.38.2
github.com/opencontainers/go-digest v1.0.0
github.com/openshift-eng/openshift-tests-extension v0.0.0-20260127124016-0fed2b824818
github.com/openshift/api v0.0.0-20260326111139-30c2ef7a272e
github.com/openshift/api v0.0.0-20260511191110-9b69e5fa27e9
github.com/openshift/client-go v0.0.0-20260330134249-7e1499aaacd7
github.com/openshift/library-go v0.0.0-20260303171201-5d9eb6295ff6
github.com/openshift/runtime-utils v0.0.0-20230921210328-7bdb5b9c177b
Expand Down Expand Up @@ -454,3 +454,8 @@ 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/pablintino/api v0.0.0-20260528074109-71b14e62c33b
github.com/openshift/client-go => github.com/pablintino/client-go v0.0.0-20260602163508-784018048305
)
Comment on lines +458 to +461
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

❓ Verification inconclusive

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Current openshift module replaces:"
rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod

echo
echo "All replace blocks:"
rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 2007


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod
rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 1988


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod

rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 1988


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Current openshift module replaces:"
rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod

echo
echo "All replace blocks:"
rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 1988


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Current openshift module replaces:"
rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod

echo
echo "All replace blocks:"
rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 1988


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Current openshift module replaces:"
rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod

echo
echo "All replace blocks:"
rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 1988


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Current openshift module replaces:"
rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod

echo
echo "All replace blocks:"
rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 1988


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Current openshift module replaces:"
rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod

echo
echo "All replace blocks:"
rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 1988


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod
rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 1988


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n '^\s*github\.com/openshift/(api|client-go)\s*=>\s*\S+' go.mod
rg -n '^\s*replace\s*\(|^\s*[a-zA-Z0-9./_-]+\s*=>\s*[a-zA-Z0-9./_-]+' go.mod

Repository: openshift/machine-config-operator

Length of output: 1988


Avoid committing personal-fork replace directives for core OpenShift modules in go.mod.

go.mod adds a replace block redirecting github.com/openshift/api and github.com/openshift/client-go to github.com/pablintino/* (pseudo-version), which weakens supply-chain integrity and can break reproducibility unless this is explicitly temporary and governed by policy (with a clear removal/revert plan before merge).

replace (
	github.com/openshift/api => github.com/pablintino/api v0.0.0-20260521171850-d966b3dbc2ea
	github.com/openshift/client-go => github.com/pablintino/client-go v0.0.0-20260525080936-979136ea86e0
)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@go.mod` around lines 458 - 461, Remove the personal-fork replace directives
from the go.mod replace block that redirect github.com/openshift/api and
github.com/openshift/client-go to github.com/pablintino/api and
github.com/pablintino/client-go (the pseudo-versions), and instead point to the
official upstream module versions or the intended canonical tags/releases; if
this replacement is strictly temporary, revert the two replace entries and add a
short PR note documenting the temporary workaround and the exact revert plan so
the change is not committed long-term.

8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -623,10 +623,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-20260326111139-30c2ef7a272e h1:SbgwHvkc6vgiqHOfGrbumjPvtOvJmCwJoFEwr7rAKzY=
github.com/openshift/api v0.0.0-20260326111139-30c2ef7a272e/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo=
github.com/openshift/client-go v0.0.0-20260330134249-7e1499aaacd7 h1:5GSoQlywIwYsRCw3qN+ZDmN6HrXTMZfI33bdRNm2jRQ=
github.com/openshift/client-go v0.0.0-20260330134249-7e1499aaacd7/go.mod h1:HhXTUIMhgzxR3Ln/zEkr4QjTL0NN7A+t9Py/we9j2ug=
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 +684,10 @@ 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/pablintino/api v0.0.0-20260528074109-71b14e62c33b h1:VNoqZTWcS74TUI4TeUIdbevP+1ZhvHNk9E/3N79wxzg=
github.com/pablintino/api v0.0.0-20260528074109-71b14e62c33b/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo=
github.com/pablintino/client-go v0.0.0-20260602163508-784018048305 h1:Y/KH/7YB3XGNakXjSD6exhu4ehDlmo8T6tTFPDv2B9s=
github.com/pablintino/client-go v0.0.0-20260602163508-784018048305/go.mod h1:B30HmrKXy/2nTJ3GS5QJMPxpOyhvH68T1Lm03cXswXs=
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 @@ -5,7 +5,7 @@ metadata:
spec:
failurePolicy: Fail
paramKind:
apiVersion: machineconfiguration.openshift.io/v1alpha1
apiVersion: machineconfiguration.openshift.io/v1
kind: OSImageStream
matchConstraints:
matchPolicy: Equivalent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
objectSelector: {}
resourceRules:
- apiGroups: ["machineconfiguration.openshift.io"]
apiVersions: ["v1alpha1"]
apiVersions: ["v1"]
operations: ["DELETE"]
resources: ["osimagestreams"]
scope: "*"
Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func (b *Bootstrap) Run(destDir string) error {
imageStream *imagev1.ImageStream
iri *mcfgv1alpha1.InternalReleaseImage
iriTLSCert *corev1.Secret
osImageStream *mcfgv1alpha1.OSImageStream
iriCredentialsSecret *corev1.Secret
osImageStream *mcfgv1.OSImageStream
iriCredentialsSecret *corev1.Secret
)
for _, info := range infos {
if info.IsDir() {
Expand Down Expand Up @@ -206,7 +206,7 @@ func (b *Bootstrap) Run(destDir string) error {
if obj.GetName() == ctrlcommon.InternalReleaseImageAuthSecretName {
iriCredentialsSecret = obj
}
case *mcfgv1alpha1.OSImageStream:
case *mcfgv1.OSImageStream:
// If given, it's treated as user input with config such as the default stream
osImageStream = obj
default:
Expand Down Expand Up @@ -493,8 +493,8 @@ func (b *Bootstrap) fetchOSImageStream(
itmsRules []*apicfgv1.ImageTagMirrorSet,
imgCfg *apicfgv1.Image,
pullSecret *corev1.Secret,
existingOSImageStream *mcfgv1alpha1.OSImageStream,
) (*mcfgv1alpha1.OSImageStream, error) {
existingOSImageStream *mcfgv1.OSImageStream,
) (*mcfgv1.OSImageStream, error) {

ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
Expand Down
16 changes: 8 additions & 8 deletions pkg/controller/bootstrap/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/util/diff"

"github.com/openshift/api/machineconfiguration/v1alpha1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
mcoResourceRead "github.com/openshift/machine-config-operator/lib/resourceread"
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
"github.com/openshift/machine-config-operator/pkg/osimagestream"
Expand Down Expand Up @@ -165,12 +165,12 @@ spec:
// Implements a fake ImageStreamFactory.
type fakeImageStreamFactory struct {
// The OSImageStream to return.
stream *v1alpha1.OSImageStream
stream *mcfgv1.OSImageStream
// Whether the Create method was called.
createCalled bool
}

func (f *fakeImageStreamFactory) Create(ctx context.Context, sysCtx *types.SystemContext, createOptions osimagestream.CreateOptions) (*v1alpha1.OSImageStream, error) {
func (f *fakeImageStreamFactory) Create(ctx context.Context, sysCtx *types.SystemContext, createOptions osimagestream.CreateOptions) (*mcfgv1.OSImageStream, error) {
f.createCalled = true
return f.stream, nil
}
Expand All @@ -192,13 +192,13 @@ func setupForBootstrapTest(t *testing.T) (*Bootstrap, *fakeImageStreamFactory, s
bootstrap := New("../../../templates", srcDir, filepath.Join(srcDir, "machineconfigcontroller-pull-secret"))

fakeFactory := &fakeImageStreamFactory{
stream: &v1alpha1.OSImageStream{
Status: v1alpha1.OSImageStreamStatus{
AvailableStreams: []v1alpha1.OSImageStreamSet{
stream: &mcfgv1.OSImageStream{
Status: mcfgv1.OSImageStreamStatus{
AvailableStreams: []mcfgv1.OSImageStreamSet{
{
Name: "stream-1",
OSImage: v1alpha1.ImageDigestFormat("registry.host.com/os:latest"),
OSExtensionsImage: v1alpha1.ImageDigestFormat("registry.host.com/extensions:latest"),
OSImage: mcfgv1.ImageDigestFormat("registry.host.com/os:latest"),
OSExtensionsImage: mcfgv1.ImageDigestFormat("registry.host.com/extensions:latest"),
},
},
DefaultStream: "stream-1",
Expand Down
8 changes: 3 additions & 5 deletions pkg/controller/common/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (
ign2types "github.com/coreos/ignition/config/v2_2/types"
validate2 "github.com/coreos/ignition/config/validate"
ign3error "github.com/coreos/ignition/v2/config/shared/errors"
"github.com/openshift/api/machineconfiguration/v1alpha1"

ign3 "github.com/coreos/ignition/v2/config/v3_5"
ign3types "github.com/coreos/ignition/v2/config/v3_5/types"
validate3 "github.com/coreos/ignition/v2/config/validate"
Expand Down Expand Up @@ -69,7 +67,7 @@ func boolToPtr(b bool) *bool {
// It uses the Ignition config from first object as base and appends all the rest.
// Kernel arguments are concatenated.
// It defaults to the OSImageURL provided by the CVO but allows a MC provided OSImageURL to take precedence.
func MergeMachineConfigs(configs []*mcfgv1.MachineConfig, cconfig *mcfgv1.ControllerConfig, imageStream *v1alpha1.OSImageStreamSet) (*mcfgv1.MachineConfig, error) {
func MergeMachineConfigs(configs []*mcfgv1.MachineConfig, cconfig *mcfgv1.ControllerConfig, imageStream *mcfgv1.OSImageStreamSet) (*mcfgv1.MachineConfig, error) {
if len(configs) == 0 {
return nil, nil
}
Expand Down Expand Up @@ -1093,15 +1091,15 @@ func GetIgnitionFileDataByPath(config *ign3types.Config, path string) ([]byte, e
}

// GetBaseImageContainer returns the default bootable host base image.
func GetBaseImageContainer(cconfigspec *mcfgv1.ControllerConfigSpec, imageStream *v1alpha1.OSImageStreamSet) string {
func GetBaseImageContainer(cconfigspec *mcfgv1.ControllerConfigSpec, imageStream *mcfgv1.OSImageStreamSet) string {
if imageStream == nil {
return cconfigspec.BaseOSContainerImage
}
return string(imageStream.OSImage)
}

// GetBaseExtensionsImageContainer returns the default bootable host base image.
func GetBaseExtensionsImageContainer(cconfigspec *mcfgv1.ControllerConfigSpec, imageStream *v1alpha1.OSImageStreamSet) string {
func GetBaseExtensionsImageContainer(cconfigspec *mcfgv1.ControllerConfigSpec, imageStream *mcfgv1.OSImageStreamSet) string {
if imageStream == nil {
return cconfigspec.BaseOSExtensionsContainerImage
}
Expand Down
10 changes: 4 additions & 6 deletions pkg/controller/node/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ 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"
mcopinformersv1 "github.com/openshift/client-go/operator/informers/externalversions/operator/v1"
mcoplistersv1 "github.com/openshift/client-go/operator/listers/operator/v1"

mcfglistersv1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1"
mcfglistersv1alpha1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1alpha1"
"github.com/openshift/library-go/pkg/operator/v1helpers"
"github.com/openshift/machine-config-operator/internal"
"github.com/openshift/machine-config-operator/pkg/apihelpers"
Expand Down Expand Up @@ -103,7 +101,7 @@ type Controller struct {
nodeLister corelisterv1.NodeLister
podLister corelisterv1.PodLister
mcnLister mcfglistersv1.MachineConfigNodeLister
osImageStreamLister mcfglistersv1alpha1.OSImageStreamLister
osImageStreamLister mcfglistersv1.OSImageStreamLister

ccListerSynced cache.InformerSynced
mcListerSynced cache.InformerSynced
Expand Down Expand Up @@ -146,7 +144,7 @@ func New(
mcnInformer mcfginformersv1.MachineConfigNodeInformer,
schedulerInformer cligoinformersv1.SchedulerInformer,
mcopInformer mcopinformersv1.MachineConfigurationInformer,
osImageStreamInformer mcfginformersv1alpha1.OSImageStreamInformer,
osImageStreamInformer mcfginformersv1.OSImageStreamInformer,
infraInformer cligoinformersv1.InfrastructureInformer,
kubeClient clientset.Interface,
mcfgClient mcfgclientset.Interface,
Expand Down Expand Up @@ -183,7 +181,7 @@ func NewWithCustomUpdateDelay(
mcnInformer mcfginformersv1.MachineConfigNodeInformer,
schedulerInformer cligoinformersv1.SchedulerInformer,
mcopInformer mcopinformersv1.MachineConfigurationInformer,
osImageStreamInformer mcfginformersv1alpha1.OSImageStreamInformer,
osImageStreamInformer mcfginformersv1.OSImageStreamInformer,
infraInformer cligoinformersv1.InfrastructureInformer,
kubeClient clientset.Interface,
mcfgClient mcfgclientset.Interface,
Expand Down Expand Up @@ -222,7 +220,7 @@ func newController(
mcnInformer mcfginformersv1.MachineConfigNodeInformer,
schedulerInformer cligoinformersv1.SchedulerInformer,
mcopInformer mcopinformersv1.MachineConfigurationInformer,
osImageStreamInformer mcfginformersv1alpha1.OSImageStreamInformer,
osImageStreamInformer mcfginformersv1.OSImageStreamInformer,
infraInformer cligoinformersv1.InfrastructureInformer,
kubeClient clientset.Interface,
mcfgClient mcfgclientset.Interface,
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/node/node_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (f *fixture) newControllerWithStopChan(stopCh <-chan struct{}) *Controller
oi := operatorinformer.NewSharedInformerFactory(operatorClient, noResyncPeriodFunc())
c := NewWithCustomUpdateDelay(i.Machineconfiguration().V1().ControllerConfigs(), i.Machineconfiguration().V1().MachineConfigs(), i.Machineconfiguration().V1().MachineConfigPools(), k8sI.Core().V1().Nodes(),
k8sI.Core().V1().Pods(), i.Machineconfiguration().V1().MachineOSConfigs(), i.Machineconfiguration().V1().MachineOSBuilds(), i.Machineconfiguration().V1().MachineConfigNodes(), ci.Config().V1().Schedulers(), oi.Operator().V1().MachineConfigurations(),
i.Machineconfiguration().V1alpha1().OSImageStreams(), ci.Config().V1().Infrastructures(), f.kubeclient, f.client, time.Millisecond, f.fgHandler)
i.Machineconfiguration().V1().OSImageStreams(), ci.Config().V1().Infrastructures(), f.kubeclient, f.client, time.Millisecond, f.fgHandler)

c.ccListerSynced = alwaysReady
c.mcpListerSynced = alwaysReady
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/node/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

features "github.com/openshift/api/features"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1"
"github.com/openshift/machine-config-operator/pkg/apihelpers"
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
daemonconsts "github.com/openshift/machine-config-operator/pkg/daemon/constants"
Expand Down Expand Up @@ -562,7 +561,7 @@ func (ctrl *Controller) getOSImageStream(pool *mcfgv1.MachineConfigPool, isUpdat

// Match the osImageURL against available streams
for _, streamSet := range osImageStream.Status.AvailableStreams {
if streamSet.OSImage == mcfgv1alpha1.ImageDigestFormat(osImageURL) {
if streamSet.OSImage == mcfgv1.ImageDigestFormat(osImageURL) {
klog.V(4).Infof("Pool %s osImageURL matched stream %s", pool.Name, streamSet.Name)
return mcfgv1.OSImageStreamReference{Name: streamSet.Name}
}
Expand Down
11 changes: 5 additions & 6 deletions pkg/controller/node/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

apicfgv1 "github.com/openshift/api/config/v1"
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1"
informers "github.com/openshift/client-go/machineconfiguration/informers/externalversions"
"github.com/openshift/machine-config-operator/pkg/apihelpers"
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
Expand Down Expand Up @@ -1051,13 +1050,13 @@ func TestCalculateStatus(t *testing.T) {
},
}
// Add OSImageStream CR with available streams
osImageStream := &mcfgv1alpha1.OSImageStream{
osImageStream := &mcfgv1.OSImageStream{
ObjectMeta: metav1.ObjectMeta{
Name: ctrlcommon.ClusterInstanceNameOSImageStream,
},
Status: mcfgv1alpha1.OSImageStreamStatus{
Status: mcfgv1.OSImageStreamStatus{
DefaultStream: "rhel-9",
AvailableStreams: []mcfgv1alpha1.OSImageStreamSet{
AvailableStreams: []mcfgv1.OSImageStreamSet{
{
Name: "rhel-9",
OSImage: "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:rhel9image",
Expand All @@ -1083,11 +1082,11 @@ func TestCalculateStatus(t *testing.T) {
tmpInformer.Machineconfiguration().V1().MachineConfigs().Informer().GetIndexer().Add(mc1)
tmpInformer.Machineconfiguration().V1().MachineConfigs().Informer().GetIndexer().Add(mc2)
tmpInformer.Machineconfiguration().V1().MachineConfigs().Informer().GetIndexer().Add(mcRhel10)
tmpInformer.Machineconfiguration().V1alpha1().OSImageStreams().Informer().GetIndexer().Add(osImageStream)
tmpInformer.Machineconfiguration().V1().OSImageStreams().Informer().GetIndexer().Add(osImageStream)

// Replace the controller's listers with the populated ones
c.mcLister = tmpInformer.Machineconfiguration().V1().MachineConfigs().Lister()
c.osImageStreamLister = tmpInformer.Machineconfiguration().V1alpha1().OSImageStreams().Lister()
c.osImageStreamLister = tmpInformer.Machineconfiguration().V1().OSImageStreams().Lister()
} else {
c = f.newController()
}
Expand Down
Loading