From 55e92cd2d89f6423ce0d134b3744eadd7a67e92d Mon Sep 17 00:00:00 2001 From: Kirsten Laskoski Date: Tue, 27 Aug 2024 12:40:22 -0400 Subject: [PATCH] bump: eco-goinfra v0.0.0-20240827150327-fe103730d840 --- go.mod | 4 +- go.sum | 2 + .../eco-goinfra/pkg/argocd/applications.go | 55 ++++++++ .../eco-goinfra/pkg/bmh/baremetalhost.go | 45 +++++++ .../eco-goinfra/pkg/clients/clients.go | 35 +---- .../pkg/imageregistry/imageregistry.go | 56 ++++++++ .../pkg/kmm/managedclustermodule.go | 44 +++++-- .../eco-goinfra/pkg/kmm/module.go | 52 ++++++-- .../pkg/kmm/preflightvalidationocp.go | 20 +++ .../eco-goinfra/pkg/mco/machineconfig.go | 85 +++++++++--- .../eco-goinfra/pkg/mco/machineconfiglist.go | 20 ++- .../openshift-kni/eco-goinfra/pkg/mco/mcp.go | 124 ++++++++++++------ .../eco-goinfra/pkg/mco/mcplist.go | 39 +++++- .../pkg/nfd/nodefeaturediscovery.go | 76 +++++++---- .../argocd/argocdoperatorcommon/defaults.go | 2 +- .../upgrade/v1alpha1/zz_generated.deepcopy.go | 1 - .../versioned/fake/clientset_generated.go | 69 ---------- .../generated/clientset/versioned/fake/doc.go | 4 - .../clientset/versioned/fake/register.go | 40 ------ .../v1/fake/doc.go | 4 - .../v1/fake/fake_containerruntimeconfig.go | 116 ---------------- .../v1/fake/fake_controllerconfig.go | 116 ---------------- .../v1/fake/fake_kubeletconfig.go | 116 ---------------- .../v1/fake/fake_machineconfig.go | 105 --------------- .../v1/fake/fake_machineconfigpool.go | 116 ---------------- ...achineconfiguration.openshift.io_client.go | 40 ------ vendor/modules.txt | 6 +- 27 files changed, 516 insertions(+), 876 deletions(-) delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/clientset_generated.go delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/doc.go delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/register.go delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/doc.go delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_containerruntimeconfig.go delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_controllerconfig.go delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_kubeletconfig.go delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfig.go delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfigpool.go delete mode 100644 vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfiguration.openshift.io_client.go diff --git a/go.mod b/go.mod index 28e5508a5..5afc182f4 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/nmstate/kubernetes-nmstate/api v0.0.0-20240605150941-df565dd7bf35 github.com/onsi/ginkgo/v2 v2.19.0 github.com/onsi/gomega v1.33.1 - github.com/openshift-kni/eco-goinfra v0.0.0-20240819205434-62b2119d4777 // latest + github.com/openshift-kni/eco-goinfra v0.0.0-20240827150327-fe103730d840 // latest github.com/openshift-kni/k8sreporter v1.0.5 github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible github.com/openshift/cluster-nfd-operator v0.0.0-20240604082319-19bf50784aa7 @@ -228,7 +228,7 @@ require ( k8s.io/klog/v2 v2.120.1 // indirect k8s.io/kube-aggregator v0.29.4 // indirect k8s.io/kube-openapi v0.0.0-20240411171206-dc4e619f62f3 // indirect - k8s.io/kubectl v0.29.3 // indirect + k8s.io/kubectl v0.29.4 // indirect k8s.io/kubelet v0.29.4 sigs.k8s.io/container-object-storage-interface-api v0.1.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index 545cf944a..2f5ee7dd2 100644 --- a/go.sum +++ b/go.sum @@ -1572,6 +1572,8 @@ github.com/openshift-kni/cluster-group-upgrades-operator v0.0.0-20240423171335-f github.com/openshift-kni/cluster-group-upgrades-operator v0.0.0-20240423171335-f07cdbf8af2c/go.mod h1:hkzqKpmQvh7vgPx8Hw6IExJorKPM0dEeJdOXjIW3gNw= github.com/openshift-kni/eco-goinfra v0.0.0-20240819205434-62b2119d4777 h1:fkQhAU+1ZE5/f2OmPIJKeJ5khlHYJ4B+Bsz611QmkZo= github.com/openshift-kni/eco-goinfra v0.0.0-20240819205434-62b2119d4777/go.mod h1:f3XX4dM4BbVlqRTl3GrQqC0yuSJL8tA7Ebv6skpc7RE= +github.com/openshift-kni/eco-goinfra v0.0.0-20240827150327-fe103730d840 h1:FJgW8VwqVPluYEt48RCkjUMBQzfyGiuOS2hdq5QLibo= +github.com/openshift-kni/eco-goinfra v0.0.0-20240827150327-fe103730d840/go.mod h1:0C2ea2ASJPLb6gky5BSzUW6HzNe2fnJskb9s9FXx4Ng= github.com/openshift-kni/k8sreporter v1.0.5 h1:1GYBc/BTZyVoXilHef43v9A8BSzw700zAPZ6zsZvo6Y= github.com/openshift-kni/k8sreporter v1.0.5/go.mod h1:fg8HI9yxiKAi6UzR6NTtrmQmA2WKzUqmkRUHwQ1+Bj8= github.com/openshift-kni/lifecycle-agent v0.0.0-20240606123201-0c45cd13c2f1 h1:y+0Ecc+MSZA/GNS3VOpKq+XK9x8qoNA7TlyHvqbVbpw= diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/argocd/applications.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/argocd/applications.go index 95485e3a6..6af0c27f2 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/argocd/applications.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/argocd/applications.go @@ -3,6 +3,8 @@ package argocd import ( "context" "fmt" + "strings" + "time" "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" @@ -10,6 +12,7 @@ import ( argocdtypes "github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdtypes/v1alpha1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/wait" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -247,6 +250,58 @@ func (builder *ApplicationBuilder) WithGitDetails(gitRepo, gitBranch, gitPath st return builder } +// WaitForCondition waits until the Application has a condition that matches the expected, checking only the Type and +// Message fields. For the messages field, it matches if the message contains the expected. Zero value fields in the +// expected condition are ignored. +func (builder *ApplicationBuilder) WaitForCondition( + expected argocdtypes.ApplicationCondition, timeout time.Duration) (*ApplicationBuilder, error) { + if valid, err := builder.validate(); !valid { + return nil, err + } + + glog.V(100).Infof( + "Waiting until condition of Argo CD Application %s in namespace %s matches %v", + builder.Definition.Name, builder.Definition.Namespace, expected) + + if !builder.Exists() { + return nil, fmt.Errorf( + "application object %s in namespace %s does not exist", builder.Definition.Name, builder.Definition.Namespace) + } + + var err error + err = wait.PollUntilContextTimeout( + context.TODO(), time.Second, timeout, true, func(ctx context.Context) (bool, error) { + builder.Object, err = builder.Get() + if err != nil { + glog.V(100).Infof( + "Failed to get Argo CD Application %s in namespace %s: %s", + builder.Definition.Name, builder.Definition.Namespace, err.Error()) + + return false, nil + } + + for _, condition := range builder.Object.Status.Conditions { + if expected.Type != "" && condition.Type != expected.Type { + continue + } + + if expected.Message != "" && !strings.Contains(condition.Message, expected.Message) { + continue + } + + return true, nil + } + + return false, nil + }) + + if err != nil { + return nil, err + } + + return builder, nil +} + // validate will check that the builder and builder definition are properly initialized before // accessing any member fields. func (builder *ApplicationBuilder) validate() (bool, error) { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/bmh/baremetalhost.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/bmh/baremetalhost.go index 8d89d977c..d68155d24 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/bmh/baremetalhost.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/bmh/baremetalhost.go @@ -649,6 +649,51 @@ func (builder *BmhBuilder) WaitUntilDeleted(timeout time.Duration) error { return err } +// WaitUntilAnnotationExists waits up to the specified timeout until the annotation exists. +func (builder *BmhBuilder) WaitUntilAnnotationExists(annotation string, timeout time.Duration) (*BmhBuilder, error) { + if valid, err := builder.validate(); !valid { + return nil, err + } + + if annotation == "" { + glog.V(100).Info("BMH annotation key cannot be empty") + + return nil, fmt.Errorf("bmh annotation key cannot be empty") + } + + glog.V(100).Infof( + "Waiting until BMH %s in namespace %s has annotation %s", + builder.Definition.Name, builder.Definition.Namespace, annotation) + + if !builder.Exists() { + return nil, fmt.Errorf( + "baremetalhost object %s does not exist in namespace %s", builder.Definition.Name, builder.Definition.Namespace) + } + + var err error + err = wait.PollUntilContextTimeout( + context.TODO(), time.Second, timeout, true, func(ctx context.Context) (bool, error) { + builder.Object, err = builder.Get() + if err != nil { + glog.V(100).Infof("failed to get bmh %s/%s: %v", builder.Definition.Namespace, builder.Definition.Name, err) + + return false, nil + } + + if _, ok := builder.Object.Annotations[annotation]; !ok { + return false, nil + } + + return true, nil + }) + + if err != nil { + return nil, err + } + + return builder, nil +} + // validate will check that the builder and builder definition are properly initialized before // accessing any member fields. func (builder *BmhBuilder) validate() (bool, error) { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/clients/clients.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/clients/clients.go index e3c069518..f2ec06360 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/clients/clients.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/clients/clients.go @@ -11,7 +11,6 @@ import ( clientConfigV1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" v1security "github.com/openshift/client-go/security/clientset/versioned/typed/security/v1" - mcv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" apiExt "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" @@ -23,14 +22,10 @@ import ( "k8s.io/client-go/tools/clientcmd" runtimeClient "sigs.k8s.io/controller-runtime/pkg/client" - clientMachineConfigFake "github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake" - clientMachineConfigV1 "github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1" - agentInstallV1Beta1 "github.com/openshift-kni/eco-goinfra/pkg/schemes/assisted/api/v1beta1" configV1 "github.com/openshift/api/config/v1" imageregistryV1 "github.com/openshift/api/imageregistry/v1" routev1 "github.com/openshift/api/route/v1" - moduleV1Beta1 "github.com/rh-ecosystem-edge/kernel-module-management/api/v1beta1" "k8s.io/client-go/kubernetes/scheme" coreV1Client "k8s.io/client-go/kubernetes/typed/core/v1" storageV1Client "k8s.io/client-go/kubernetes/typed/storage/v1" @@ -48,8 +43,6 @@ import ( operatorv1 "github.com/openshift/api/operator/v1" machinev1beta1client "github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1" operatorv1alpha1 "github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1alpha1" - nfdv1 "github.com/openshift/cluster-nfd-operator/api/v1" - mcmV1Beta1 "github.com/rh-ecosystem-edge/kernel-module-management/api-hub/v1beta1" dynamicFake "k8s.io/client-go/dynamic/fake" ) @@ -59,7 +52,6 @@ type Settings struct { K8sClient kubernetes.Interface coreV1Client.CoreV1Interface clientConfigV1.ConfigV1Interface - clientMachineConfigV1.MachineconfigurationV1Interface networkV1Client.NetworkingV1Interface appsV1Client.AppsV1Interface rbacV1Client.RbacV1Interface @@ -104,7 +96,6 @@ func New(kubeconfig string) *Settings { clientSet := &Settings{} clientSet.CoreV1Interface = coreV1Client.NewForConfigOrDie(config) clientSet.ConfigV1Interface = clientConfigV1.NewForConfigOrDie(config) - clientSet.MachineconfigurationV1Interface = clientMachineConfigV1.NewForConfigOrDie(config) clientSet.AppsV1Interface = appsV1Client.NewForConfigOrDie(config) clientSet.NetworkingV1Interface = networkV1Client.NewForConfigOrDie(config) clientSet.RbacV1Interface = rbacV1Client.NewForConfigOrDie(config) @@ -146,10 +137,6 @@ func SetScheme(crScheme *runtime.Scheme) error { return err } - if err := mcv1.AddToScheme(crScheme); err != nil { - return err - } - if err := apiExt.AddToScheme(crScheme); err != nil { return err } @@ -170,18 +157,6 @@ func SetScheme(crScheme *runtime.Scheme) error { return err } - if err := moduleV1Beta1.AddToScheme(crScheme); err != nil { - return err - } - - if err := mcmV1Beta1.AddToScheme(crScheme); err != nil { - return err - } - - if err := nfdv1.AddToScheme(crScheme); err != nil { - return err - } - if err := routev1.AddToScheme(crScheme); err != nil { return err } @@ -240,7 +215,7 @@ func GetTestClients(tcp TestClientParams) *Settings { func GetModifiableTestClients(tcp TestClientParams) (*Settings, *fakeRuntimeClient.ClientBuilder) { clientSet := &Settings{} - var k8sClientObjects, genericClientObjects, mcoObjects []runtime.Object + var k8sClientObjects, genericClientObjects []runtime.Object //nolint:varnamelen for _, v := range tcp.K8sMockObjects { @@ -312,12 +287,6 @@ func GetModifiableTestClients(tcp TestClientParams) (*Settings, *fakeRuntimeClie genericClientObjects = append(genericClientObjects, v) case *agentInstallV1Beta1.AgentServiceConfig: genericClientObjects = append(genericClientObjects, v) - // KMM Client Objects - case *moduleV1Beta1.PreflightValidationOCP: - genericClientObjects = append(genericClientObjects, v) - // MCO Client Objects - case *mcv1.MachineConfig: - mcoObjects = append(mcoObjects, v) } } @@ -328,8 +297,6 @@ func GetModifiableTestClients(tcp TestClientParams) (*Settings, *fakeRuntimeClie clientSet.NetworkingV1Interface = clientSet.K8sClient.NetworkingV1() clientSet.RbacV1Interface = clientSet.K8sClient.RbacV1() clientSet.StorageV1Interface = clientSet.K8sClient.StorageV1() - clientSet.MachineconfigurationV1Interface = clientMachineConfigFake.NewSimpleClientset( - mcoObjects...).MachineconfigurationV1() // Update the generic client with schemes of generic resources clientSet.scheme = runtime.NewScheme() diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/imageregistry/imageregistry.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/imageregistry/imageregistry.go index ba9afb22b..5931a8f91 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/imageregistry/imageregistry.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/imageregistry/imageregistry.go @@ -3,6 +3,8 @@ package imageregistry import ( "context" "fmt" + "strings" + "time" "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" @@ -10,6 +12,7 @@ import ( imageregistryv1 "github.com/openshift/api/imageregistry/v1" operatorv1 "github.com/openshift/api/operator/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/wait" goclient "sigs.k8s.io/controller-runtime/pkg/client" k8serrors "k8s.io/apimachinery/pkg/api/errors" @@ -179,6 +182,59 @@ func (builder *Builder) WithStorage(expectedStorage imageregistryv1.ImageRegistr return builder } +// WaitForCondition waits until the imageRegistry has a condition that matches the expected, checking only the Type, +// Status, Reason, and Message fields. For the messages field, it matches if the message contains the expected. Zero +// value fields in the expected condition are ignored. +func (builder *Builder) WaitForCondition( + expected operatorv1.OperatorCondition, timeout time.Duration) (*Builder, error) { + if valid, err := builder.validate(); !valid { + return nil, err + } + + glog.V(100).Infof("Waiting until condition of imageRegistry %s matches %v", builder.Definition.Name, expected) + + if !builder.Exists() { + return nil, fmt.Errorf("imageRegistry object %s does not exist", builder.Definition.Name) + } + + var err error + err = wait.PollUntilContextTimeout( + context.TODO(), time.Second, timeout, true, func(ctx context.Context) (bool, error) { + builder.Object, err = builder.Get() + if err != nil { + return false, nil + } + + for _, condition := range builder.Object.Status.Conditions { + if expected.Type != "" && condition.Type != expected.Type { + continue + } + + if expected.Status != "" && condition.Status != expected.Status { + continue + } + + if expected.Reason != "" && condition.Reason != expected.Reason { + continue + } + + if expected.Message != "" && !strings.Contains(condition.Message, expected.Message) { + continue + } + + return true, nil + } + + return false, nil + }) + + if err != nil { + return nil, err + } + + return builder, nil +} + // validate will check that the builder and builder definition are properly initialized before // accessing any member fields. func (builder *Builder) validate() (bool, error) { diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/managedclustermodule.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/managedclustermodule.go index 07b3d3154..06edad3a6 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/managedclustermodule.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/managedclustermodule.go @@ -20,7 +20,7 @@ type ManagedClusterModuleBuilder struct { Definition *mcmV1Beta1.ManagedClusterModule Object *mcmV1Beta1.ManagedClusterModule errorMsg string - apiClient *clients.Settings + apiClient goclient.Client } // ManagedClusterModuleAdditionalOptions additional options for managedclustermodule object. @@ -32,8 +32,21 @@ func NewManagedClusterModuleBuilder(apiClient *clients.Settings, name, nsname st glog.V(100).Infof( "Initializing new ManagedClusterModule structure with following params: %s, %s", name, nsname) + if apiClient == nil { + glog.V(100).Infof("The apiClient is empty") + + return nil + } + + err := apiClient.AttachScheme(mcmV1Beta1.AddToScheme) + if err != nil { + glog.V(100).Infof("Failed to add module v1beta1 scheme to client schemes") + + return nil + } + builder := ManagedClusterModuleBuilder{ - apiClient: apiClient, + apiClient: apiClient.Client, Definition: &mcmV1Beta1.ManagedClusterModule{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -45,13 +58,13 @@ func NewManagedClusterModuleBuilder(apiClient *clients.Settings, name, nsname st if name == "" { glog.V(100).Infof("The name of the ManagedClusterModule is empty") - builder.errorMsg = "ManagedClusterModule 'name' cannot be empty" + builder.errorMsg = "managedClusterModule 'name' cannot be empty" } if nsname == "" { glog.V(100).Infof("The namespace of the ManagedClusterModule is empty") - builder.errorMsg = "ManagedClusterModule 'nsname' cannot be empty" + builder.errorMsg = "managedClusterModule 'nsname' cannot be empty" } return &builder @@ -139,8 +152,21 @@ func (builder *ManagedClusterModuleBuilder) WithOptions( func PullManagedClusterModule(apiClient *clients.Settings, name, nsname string) (*ManagedClusterModuleBuilder, error) { glog.V(100).Infof("Pulling existing module name %s under namespace %s from cluster", name, nsname) + if apiClient == nil { + glog.V(100).Infof("The apiClient is empty") + + return nil, fmt.Errorf("managedclustermodule 'apiClient' cannot be empty") + } + + err := apiClient.AttachScheme(mcmV1Beta1.AddToScheme) + if err != nil { + glog.V(100).Infof("Failed to add module v1beta1 scheme to client schemes") + + return nil, err + } + builder := ManagedClusterModuleBuilder{ - apiClient: apiClient, + apiClient: apiClient.Client, Definition: &mcmV1Beta1.ManagedClusterModule{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -152,13 +178,13 @@ func PullManagedClusterModule(apiClient *clients.Settings, name, nsname string) if name == "" { glog.V(100).Infof("The name of the managedclustermodule is empty") - builder.errorMsg = "managedclustermodule 'name' cannot be empty" + return nil, fmt.Errorf("managedclustermodule 'name' cannot be empty") } if nsname == "" { glog.V(100).Infof("The namespace of the managedclustermodule is empty") - builder.errorMsg = "managedclustermodule 'namespace' cannot be empty" + return nil, fmt.Errorf("managedclustermodule 'namespace' cannot be empty") } if !builder.Exists() { @@ -235,7 +261,9 @@ func (builder *ManagedClusterModuleBuilder) Delete() (*ManagedClusterModuleBuild builder.Definition.Name, builder.Definition.Namespace) if !builder.Exists() { - return builder, fmt.Errorf("managedclustermodule cannot be deleted because it does not exist") + glog.V(100).Infof("managedclustermodule cannot be deleted because it does not exist") + + return builder, nil } err := builder.apiClient.Delete(context.TODO(), builder.Definition) diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/module.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/module.go index 089c9002a..3345e2bfb 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/module.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/module.go @@ -23,7 +23,7 @@ type ModuleBuilder struct { Object *moduleV1Beta1.Module // Used in functions that define or mutate Module definition. errorMsg is processed before the Module // object is created. - apiClient *clients.Settings + apiClient goclient.Client errorMsg string } @@ -36,8 +36,21 @@ func NewModuleBuilder( glog.V(100).Infof( "Initializing new Module structure with following params: %s, %s", name, nsname) + if apiClient == nil { + glog.V(100).Infof("The apiClient is empty") + + return nil + } + + err := apiClient.AttachScheme(moduleV1Beta1.AddToScheme) + if err != nil { + glog.V(100).Infof("Failed to add module v1beta1 scheme to client schemes") + + return nil + } + builder := ModuleBuilder{ - apiClient: apiClient, + apiClient: apiClient.Client, Definition: &moduleV1Beta1.Module{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -49,13 +62,13 @@ func NewModuleBuilder( if name == "" { glog.V(100).Infof("The name of the Module is empty") - builder.errorMsg = "Module 'name' cannot be empty" + builder.errorMsg = "module 'name' cannot be empty" } if nsname == "" { glog.V(100).Infof("The namespace of the module is empty") - builder.errorMsg = "Module 'namespace' cannot be empty" + builder.errorMsg = "module 'namespace' cannot be empty" } return &builder @@ -251,8 +264,21 @@ func (builder *ModuleBuilder) WithOptions(options ...ModuleAdditionalOptions) *M func Pull(apiClient *clients.Settings, name, nsname string) (*ModuleBuilder, error) { glog.V(100).Infof("Pulling existing module name %s under namespace %s from cluster", name, nsname) + if apiClient == nil { + glog.V(100).Infof("The apiClient is empty") + + return nil, fmt.Errorf("module 'apiClient' cannot be empty") + } + + err := apiClient.AttachScheme(moduleV1Beta1.AddToScheme) + if err != nil { + glog.V(100).Infof("Failed to add module v1beta1 scheme to client schemes") + + return nil, err + } + builder := ModuleBuilder{ - apiClient: apiClient, + apiClient: apiClient.Client, Definition: &moduleV1Beta1.Module{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -264,13 +290,13 @@ func Pull(apiClient *clients.Settings, name, nsname string) (*ModuleBuilder, err if name == "" { glog.V(100).Infof("The name of the module is empty") - builder.errorMsg = "module 'name' cannot be empty" + return nil, fmt.Errorf("module 'name' cannot be empty") } if nsname == "" { glog.V(100).Infof("The namespace of the module is empty") - builder.errorMsg = "module 'namespace' cannot be empty" + return nil, fmt.Errorf("module 'namespace' cannot be empty") } if !builder.Exists() { @@ -295,6 +321,10 @@ func (builder *ModuleBuilder) Create() (*ModuleBuilder, error) { var err error if !builder.Exists() { err = builder.apiClient.Create(context.TODO(), builder.Definition) + + if err == nil { + builder.Object = builder.Definition + } } return builder, err @@ -312,6 +342,10 @@ func (builder *ModuleBuilder) Update() (*ModuleBuilder, error) { err := builder.apiClient.Update(context.TODO(), builder.Definition) + if err == nil { + builder.Object = builder.Definition + } + return builder, err } @@ -340,7 +374,9 @@ func (builder *ModuleBuilder) Delete() (*ModuleBuilder, error) { builder.Definition.Name, builder.Definition.Namespace) if !builder.Exists() { - return builder, fmt.Errorf("module cannot be deleted because it does not exist") + glog.V(100).Infof("module cannot be deleted because it does not exist") + + return builder, nil } err := builder.apiClient.Delete(context.TODO(), builder.Definition) diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/preflightvalidationocp.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/preflightvalidationocp.go index 5e504f06f..58ea0d9fd 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/preflightvalidationocp.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/kmm/preflightvalidationocp.go @@ -36,6 +36,19 @@ func NewPreflightValidationOCPBuilder( glog.V(100).Infof("Initializing new PreflightValidationOCP structure with following params: %s, %s", name, nsname) + if apiClient == nil { + glog.V(100).Infof("The apiClient is empty") + + return nil + } + + err := apiClient.AttachScheme(moduleV1Beta1.AddToScheme) + if err != nil { + glog.V(100).Infof("Failed to add module v1beta1 scheme to client schemes") + + return nil + } + builder := PreflightValidationOCPBuilder{ apiClient: apiClient, Definition: &moduleV1Beta1.PreflightValidationOCP{ @@ -145,6 +158,13 @@ func PullPreflightValidationOCP(apiClient *clients.Settings, return nil, fmt.Errorf("preflightvalidation 'apiClient' cannot be empty") } + err := apiClient.AttachScheme(moduleV1Beta1.AddToScheme) + if err != nil { + glog.V(100).Infof("Failed to add module v1beta1 scheme to client schemes") + + return nil, err + } + builder := PreflightValidationOCPBuilder{ apiClient: apiClient, Definition: &moduleV1Beta1.PreflightValidationOCP{ diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/machineconfig.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/machineconfig.go index a7072dd89..71d32f60a 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/machineconfig.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/machineconfig.go @@ -10,6 +10,7 @@ import ( mcv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" ) // MCBuilder provides struct for MachineConfig Object which contains connection to cluster @@ -20,7 +21,7 @@ type MCBuilder struct { // Created MachineConfig object on the cluster. Object *mcv1.MachineConfig // api client to interact with the cluster. - apiClient *clients.Settings + apiClient runtimeclient.Client // errorMsg is processed before MachineConfig object is created. errorMsg string } @@ -33,8 +34,21 @@ type MCAdditionalOptions func(builder *MCBuilder) (*MCBuilder, error) func NewMCBuilder(apiClient *clients.Settings, name string) *MCBuilder { glog.V(100).Infof("Initializing new MCBuilder structure with following params: %s", name) + if apiClient == nil { + glog.V(100).Info("The apiClient of the MachineConfig is nil") + + return nil + } + + err := apiClient.AttachScheme(mcv1.Install) + if err != nil { + glog.V(100).Info("Failed to add machineconfig v1 scheme to client schemes") + + return nil + } + builder := MCBuilder{ - apiClient: apiClient, + apiClient: apiClient.Client, Definition: &mcv1.MachineConfig{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -45,7 +59,7 @@ func NewMCBuilder(apiClient *clients.Settings, name string) *MCBuilder { if name == "" { glog.V(100).Infof("The name of the MachineConfig is empty") - builder.errorMsg = "MachineConfig 'name' cannot be empty" + builder.errorMsg = "machineconfig 'name' cannot be empty" } return &builder @@ -55,8 +69,21 @@ func NewMCBuilder(apiClient *clients.Settings, name string) *MCBuilder { func PullMachineConfig(apiClient *clients.Settings, name string) (*MCBuilder, error) { glog.V(100).Infof("Pulling existing machineconfig name %s from cluster", name) + if apiClient == nil { + glog.V(100).Info("The apiClient of the MachineConfig is nil") + + return nil, fmt.Errorf("machineconfig 'apiClient' cannot be nil") + } + + err := apiClient.AttachScheme(mcv1.Install) + if err != nil { + glog.V(100).Info("Failed to add machineconfig v1 scheme to client schemes") + + return nil, err + } + builder := MCBuilder{ - apiClient: apiClient, + apiClient: apiClient.Client, Definition: &mcv1.MachineConfig{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -67,7 +94,7 @@ func PullMachineConfig(apiClient *clients.Settings, name string) (*MCBuilder, er if name == "" { glog.V(100).Infof("The name of the machineconfig is empty") - builder.errorMsg = "machineconfig 'name' cannot be empty" + return nil, fmt.Errorf("machineconfig 'name' cannot be empty") } if !builder.Exists() { @@ -79,6 +106,26 @@ func PullMachineConfig(apiClient *clients.Settings, name string) (*MCBuilder, er return &builder, nil } +// Get returns the MachineConfig object if found. +func (builder *MCBuilder) Get() (*mcv1.MachineConfig, error) { + if valid, err := builder.validate(); !valid { + return nil, err + } + + glog.V(100).Infof("Getting MachineConfig object %s", builder.Definition.Name) + + machineConfig := &mcv1.MachineConfig{} + err := builder.apiClient.Get(context.TODO(), runtimeclient.ObjectKey{Name: builder.Definition.Name}, machineConfig) + + if err != nil { + glog.V(100).Infof("MachineConfig object %s does not exist", builder.Definition.Name) + + return nil, err + } + + return machineConfig, nil +} + // Create generates a machineconfig in the cluster and stores the created object in struct. func (builder *MCBuilder) Create() (*MCBuilder, error) { if valid, err := builder.validate(); !valid { @@ -89,8 +136,10 @@ func (builder *MCBuilder) Create() (*MCBuilder, error) { var err error if !builder.Exists() { - builder.Object, err = builder.apiClient.MachineConfigs().Create( - context.TODO(), builder.Definition, metav1.CreateOptions{}) + err := builder.apiClient.Create(context.TODO(), builder.Definition) + if err == nil { + builder.Object = builder.Definition + } } return builder, err @@ -105,14 +154,16 @@ func (builder *MCBuilder) Delete() error { glog.V(100).Infof("Deleting the MachineConfig object %s", builder.Definition.Name) if !builder.Exists() { - return fmt.Errorf("MachineConfig cannot be deleted because it does not exist") - } + glog.V(100).Infof("MachineConfig %s cannot be deleted because it does not exist", builder.Definition.Name) - err := builder.apiClient.MachineConfigs().Delete( - context.TODO(), builder.Object.Name, metav1.DeleteOptions{}) + builder.Object = nil + return nil + } + + err := builder.apiClient.Delete(context.TODO(), builder.Object) if err != nil { - return fmt.Errorf("cannot delete MachineConfig: %w", err) + return fmt.Errorf("cannot delete machineconfig: %w", err) } builder.Object = nil @@ -128,9 +179,10 @@ func (builder *MCBuilder) Update() (*MCBuilder, error) { glog.V(100).Infof("Updating machineconfig %s", builder.Definition.Name) - var err error - builder.Object, err = builder.apiClient.MachineConfigs().Update( - context.TODO(), builder.Definition, metav1.UpdateOptions{}) + err := builder.apiClient.Update(context.TODO(), builder.Definition) + if err == nil { + builder.Object = builder.Definition + } return builder, err } @@ -144,8 +196,7 @@ func (builder *MCBuilder) Exists() bool { glog.V(100).Infof("Checking if the MachineConfig object %s exists", builder.Definition.Name) var err error - builder.Object, err = builder.apiClient.MachineConfigs().Get( - context.TODO(), builder.Definition.Name, metav1.GetOptions{}) + builder.Object, err = builder.Get() return err == nil || !k8serrors.IsNotFound(err) } diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/machineconfiglist.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/machineconfiglist.go index d620acebc..6528f0f68 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/machineconfiglist.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/machineconfiglist.go @@ -6,18 +6,26 @@ import ( "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + mcv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" + runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" ) // ListMC returns a list of builders for MachineConfigs. -func ListMC(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*MCBuilder, error) { +func ListMC(apiClient *clients.Settings, options ...runtimeclient.ListOptions) ([]*MCBuilder, error) { if apiClient == nil { glog.V(100).Info("MachineConfig 'apiClient' can not be empty") return nil, fmt.Errorf("failed to list MachineConfigs, 'apiClient' parameter is empty") } - passedOptions := metav1.ListOptions{} + err := apiClient.AttachScheme(mcv1.Install) + if err != nil { + glog.V(100).Info("Failed to add machineconfig v1 scheme to client schemes") + + return nil, err + } + + passedOptions := runtimeclient.ListOptions{} logMessage := "Listing all MC resources" if len(options) > 1 { @@ -33,7 +41,9 @@ func ListMC(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*MCBu glog.V(100).Infof(logMessage) - mcList, err := apiClient.MachineConfigs().List(context.TODO(), passedOptions) + mcList := new(mcv1.MachineConfigList) + err = apiClient.Client.List(context.TODO(), mcList, &passedOptions) + if err != nil { glog.V(100).Info("Failed to list MC objects due to %s", err.Error()) @@ -45,7 +55,7 @@ func ListMC(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*MCBu for _, mc := range mcList.Items { copiedMc := mc mcBuilder := &MCBuilder{ - apiClient: apiClient, + apiClient: apiClient.Client, Object: &copiedMc, Definition: &copiedMc, } diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/mcp.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/mcp.go index eda56ffc8..93f21f5f8 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/mcp.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/mcp.go @@ -9,28 +9,27 @@ import ( "github.com/openshift-kni/eco-goinfra/pkg/clients" "github.com/openshift-kni/eco-goinfra/pkg/msg" k8serrors "k8s.io/apimachinery/pkg/api/errors" + runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" - mcov1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" + mcv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" ) const ( - fiveScds time.Duration = 5 * time.Second - isTrue = "True" - machineConfigPool = "MachineConfigPool" + fiveScds time.Duration = 5 * time.Second ) // MCPBuilder provides struct for MachineConfigPool object which contains connection to cluster // and MachineConfigPool definitions. type MCPBuilder struct { // MachineConfigPool definition. Used to create MachineConfigPool object with minimum set of required elements. - Definition *mcov1.MachineConfigPool + Definition *mcv1.MachineConfigPool // Created MachineConfigPool object on the cluster. - Object *mcov1.MachineConfigPool + Object *mcv1.MachineConfigPool // api client to interact with the cluster. - apiClient *clients.Settings + apiClient runtimeclient.Client // errorMsg is processed before MachineConfigPool object is created. errorMsg string } @@ -43,9 +42,22 @@ func NewMCPBuilder(apiClient *clients.Settings, mcpName string) *MCPBuilder { glog.V(100).Infof( "Initializing new MCPBuilder structure with the following params: %s", mcpName) + if apiClient == nil { + glog.V(100).Info("The apiClient of the MachineConfigPool is nil") + + return nil + } + + err := apiClient.AttachScheme(mcv1.Install) + if err != nil { + glog.V(100).Info("Failed to add machineconfig v1 scheme to client schemes") + + return nil + } + builder := &MCPBuilder{ - apiClient: apiClient, - Definition: &mcov1.MachineConfigPool{ + apiClient: apiClient.Client, + Definition: &mcv1.MachineConfigPool{ ObjectMeta: metav1.ObjectMeta{ Name: mcpName, }, @@ -55,7 +67,7 @@ func NewMCPBuilder(apiClient *clients.Settings, mcpName string) *MCPBuilder { if mcpName == "" { glog.V(100).Infof("The name of the MachineConfigPool is empty") - builder.errorMsg = "MachineConfigPool 'name' cannot be empty" + builder.errorMsg = "machineconfigpool 'name' cannot be empty" } return builder @@ -65,9 +77,22 @@ func NewMCPBuilder(apiClient *clients.Settings, mcpName string) *MCPBuilder { func Pull(apiClient *clients.Settings, name string) (*MCPBuilder, error) { glog.V(100).Infof("Pulling existing machineconfigpool name %s from cluster", name) + if apiClient == nil { + glog.V(100).Info("The apiClient of the MachineConfigPool is nil") + + return nil, fmt.Errorf("machineconfigpool 'apiClient' cannot be nil") + } + + err := apiClient.AttachScheme(mcv1.Install) + if err != nil { + glog.V(100).Info("Failed to add machineconfig v1 scheme to client schemes") + + return nil, err + } + builder := MCPBuilder{ - apiClient: apiClient, - Definition: &mcov1.MachineConfigPool{ + apiClient: apiClient.Client, + Definition: &mcv1.MachineConfigPool{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, @@ -77,7 +102,7 @@ func Pull(apiClient *clients.Settings, name string) (*MCPBuilder, error) { if name == "" { glog.V(100).Infof("The name of the machineconfigpool is empty") - builder.errorMsg = "machineconfigpool 'name' cannot be empty" + return nil, fmt.Errorf("machineconfigpool 'name' cannot be empty") } if !builder.Exists() { @@ -89,6 +114,26 @@ func Pull(apiClient *clients.Settings, name string) (*MCPBuilder, error) { return &builder, nil } +// Get returns the MachineConfigPool object if found. +func (builder *MCPBuilder) Get() (*mcv1.MachineConfigPool, error) { + if valid, err := builder.validate(); !valid { + return nil, err + } + + glog.V(100).Infof("Getting MachineConfigPool object %s", builder.Definition.Name) + + machineConfigPool := &mcv1.MachineConfigPool{} + err := builder.apiClient.Get(context.TODO(), runtimeclient.ObjectKey{Name: builder.Definition.Name}, machineConfigPool) + + if err != nil { + glog.V(100).Infof("MachineConfigPool object %s does not exist", builder.Definition.Name) + + return nil, err + } + + return machineConfigPool, nil +} + // Create makes a MachineConfigPool in cluster and stores the created object in struct. func (builder *MCPBuilder) Create() (*MCPBuilder, error) { if valid, err := builder.validate(); !valid { @@ -100,8 +145,10 @@ func (builder *MCPBuilder) Create() (*MCPBuilder, error) { var err error if !builder.Exists() { - builder.Object, err = builder.apiClient.MachineConfigPools().Create( - context.TODO(), builder.Definition, metav1.CreateOptions{}) + err = builder.apiClient.Create(context.TODO(), builder.Definition) + if err == nil { + builder.Object = builder.Definition + } } return builder, err @@ -117,16 +164,20 @@ func (builder *MCPBuilder) Delete() error { builder.Definition.Name) if !builder.Exists() { - return fmt.Errorf("MachineConfigPool cannot be deleted because it does not exist") - } + glog.V(100).Infof("MachineConfigPool %s cannot be deleted because it does not exist", builder.Definition.Name) - err := builder.apiClient.MachineConfigPools().Delete( - context.TODO(), builder.Object.Name, metav1.DeleteOptions{}) + builder.Object = nil + return nil + } + + err := builder.apiClient.Delete(context.TODO(), builder.Object) if err != nil { - return fmt.Errorf("cannot delete MachineConfigPool: %w", err) + return fmt.Errorf("cannot delete machineconfigpool: %w", err) } + builder.Object = nil + return err } @@ -140,8 +191,7 @@ func (builder *MCPBuilder) Exists() bool { builder.Definition.Name) var err error - builder.Object, err = builder.apiClient.MachineConfigPools().Get( - context.TODO(), builder.Definition.Name, metav1.GetOptions{}) + builder.Object, err = builder.Get() return err == nil || !k8serrors.IsNotFound(err) } @@ -156,13 +206,15 @@ func (builder *MCPBuilder) WithMcSelector(mcSelector map[string]string) *MCPBuil "machineConfigSelector label: %v", mcSelector) if len(mcSelector) == 0 { - builder.errorMsg = "'machineConfigSelector MatchLabels' field cannot be empty" - } + builder.errorMsg = "machineConfigSelector 'MatchLabels' field cannot be empty" - if builder.errorMsg != "" { return builder } + if builder.Definition.Spec.MachineConfigSelector == nil { + builder.Definition.Spec.MachineConfigSelector = &metav1.LabelSelector{} + } + builder.Definition.Spec.MachineConfigSelector.MatchLabels = mcSelector return builder @@ -171,7 +223,7 @@ func (builder *MCPBuilder) WithMcSelector(mcSelector map[string]string) *MCPBuil // WaitToBeInCondition waits for a specific time duration until the MachineConfigPool will have a // specified condition type with the expected status. func (builder *MCPBuilder) WaitToBeInCondition( - conditionType mcov1.MachineConfigPoolConditionType, + conditionType mcv1.MachineConfigPoolConditionType, conditionStatus corev1.ConditionStatus, timeout time.Duration, ) error { @@ -184,9 +236,7 @@ func (builder *MCPBuilder) WaitToBeInCondition( return wait.PollUntilContextTimeout( context.TODO(), fiveScds, timeout, true, func(ctx context.Context) (bool, error) { - mcp, err := builder.apiClient.MachineConfigPools().Get(context.TODO(), - builder.Object.Name, metav1.GetOptions{}) - + mcp, err := builder.Get() if err != nil { return false, nil } @@ -210,26 +260,22 @@ func (builder *MCPBuilder) WaitForUpdate(timeout time.Duration) error { glog.V(100).Infof("WaitForUpdate waits up to specified time %v until updating"+ " machineConfigPool object is updated", timeout) - mcpUpdating, err := builder.apiClient.MachineConfigPools().Get(context.TODO(), - builder.Object.Name, metav1.GetOptions{}) - + mcpUpdating, err := builder.Get() if err != nil { return err } for _, condition := range mcpUpdating.Status.Conditions { - if condition.Type == "Updating" && condition.Status == isTrue { + if condition.Type == "Updating" && condition.Status == corev1.ConditionTrue { err := wait.PollUntilContextTimeout( context.TODO(), fiveScds, timeout, true, func(ctx context.Context) (bool, error) { - mcpUpdated, err := builder.apiClient.MachineConfigPools().Get(context.TODO(), - builder.Object.Name, metav1.GetOptions{}) - + mcpUpdated, err := builder.Get() if err != nil { return false, nil } for _, condition := range mcpUpdated.Status.Conditions { - if condition.Type == "Updated" && condition.Status == isTrue { + if condition.Type == "Updated" && condition.Status == corev1.ConditionTrue { return true, nil } } @@ -339,7 +385,7 @@ func (builder *MCPBuilder) WithOptions(options ...MCPAdditionalOptions) *MCPBuil // IsInCondition parses MachineConfigPool conditions. // Returns true if given MachineConfigPool is in given condition, otherwise false. -func (builder *MCPBuilder) IsInCondition(mcpConditionType mcov1.MachineConfigPoolConditionType) bool { +func (builder *MCPBuilder) IsInCondition(mcpConditionType mcv1.MachineConfigPoolConditionType) bool { if valid, _ := builder.validate(); !valid { return false } @@ -349,7 +395,7 @@ func (builder *MCPBuilder) IsInCondition(mcpConditionType mcov1.MachineConfigPoo if builder.Exists() { for _, condition := range builder.Object.Status.Conditions { - if condition.Type == mcpConditionType && condition.Status == isTrue { + if condition.Type == mcpConditionType && condition.Status == corev1.ConditionTrue { return true } } diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/mcplist.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/mcplist.go index baa1c7526..572ca40ed 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/mcplist.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/mco/mcplist.go @@ -7,14 +7,28 @@ import ( "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" + mcv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" + runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" ) // ListMCP returns a list of MachineConfigPoolBuilder. -func ListMCP(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*MCPBuilder, error) { - passedOptions := metav1.ListOptions{} +func ListMCP(apiClient *clients.Settings, options ...runtimeclient.ListOptions) ([]*MCPBuilder, error) { + if apiClient == nil { + glog.V(100).Info("MachineConfigPool 'apiClient' can not be empty") + + return nil, fmt.Errorf("failed to list MachineConfigPools, 'apiClient' parameter is empty") + } + + err := apiClient.AttachScheme(mcv1.Install) + if err != nil { + glog.V(100).Info("Failed to add machineconfig v1 scheme to client schemes") + + return nil, err + } + + passedOptions := runtimeclient.ListOptions{} logMessage := "Listing all MCP resources" if len(options) > 1 { @@ -30,7 +44,8 @@ func ListMCP(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*MCP glog.V(100).Infof(logMessage) - mcpList, err := apiClient.MachineConfigPools().List(context.TODO(), passedOptions) + mcpList := new(mcv1.MachineConfigPoolList) + err = apiClient.Client.List(context.TODO(), mcpList, &passedOptions) if err != nil { glog.V(100).Infof("Failed to list MCP objects due to %s", err.Error()) @@ -43,7 +58,7 @@ func ListMCP(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*MCP for _, mcp := range mcpList.Items { copiedMcp := mcp mcpBuilder := &MCPBuilder{ - apiClient: apiClient, + apiClient: apiClient.Client, Object: &copiedMcp, Definition: &copiedMcp, } @@ -56,7 +71,7 @@ func ListMCP(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*MCP // ListMCPByMachineConfigSelector returns a list of MachineConfigurationPoolBuilders for given selector. func ListMCPByMachineConfigSelector( - apiClient *clients.Settings, mcpLabel string, options ...metav1.ListOptions) (*MCPBuilder, error) { + apiClient *clients.Settings, mcpLabel string, options ...runtimeclient.ListOptions) (*MCPBuilder, error) { glog.V(100).Infof("GetByLabel returns MachineConfigPool with the specified label: %v", mcpLabel) mcpList, err := ListMCP(apiClient, options...) @@ -66,6 +81,10 @@ func ListMCPByMachineConfigSelector( } for _, mcp := range mcpList { + if mcp.Object.Spec.MachineConfigSelector == nil { + continue + } + for _, label := range mcp.Object.Spec.MachineConfigSelector.MatchExpressions { for _, value := range label.Values { if value == mcpLabel { @@ -86,7 +105,13 @@ func ListMCPByMachineConfigSelector( // ListMCPWaitToBeStableFor waits for a given MachineConfigurationPool to be stable for a given period. func ListMCPWaitToBeStableFor( - apiClient *clients.Settings, stableDuration, timeout time.Duration, options ...metav1.ListOptions) error { + apiClient *clients.Settings, stableDuration, timeout time.Duration, options ...runtimeclient.ListOptions) error { + if apiClient == nil { + glog.V(100).Info("MachineConfigPool 'apiClient' can not be empty") + + return fmt.Errorf("failed to list MachineConfigPools, 'apiClient' parameter is empty") + } + glog.V(100).Infof("WaitForMcpListToBeStableFor waits up to duration of %v for "+ "MachineConfigPoolList to be stable for %v", timeout, stableDuration) diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/nfd/nodefeaturediscovery.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/nfd/nodefeaturediscovery.go index 7c865b744..f43115e2b 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/nfd/nodefeaturediscovery.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/nfd/nodefeaturediscovery.go @@ -33,6 +33,19 @@ func NewBuilderFromObjectString(apiClient *clients.Settings, almExample string) glog.V(100).Infof( "Initializing new Builder structure from almExample string") + if apiClient == nil { + glog.V(100).Info("The apiClient of the Policy is nil") + + return nil + } + + err := apiClient.AttachScheme(nfdv1.AddToScheme) + if err != nil { + glog.V(100).Info("Failed to add nfd v1 scheme to client schemes") + + return nil + } + nodeFeatureDiscovery, err := getNodeFeatureDiscoveryFromAlmExample(almExample) glog.V(100).Infof( @@ -60,35 +73,23 @@ func NewBuilderFromObjectString(apiClient *clients.Settings, almExample string) return &builder } -// Get returns NodeFeatureDiscovery object if found. -func (builder *Builder) Get() (*nfdv1.NodeFeatureDiscovery, error) { - if valid, err := builder.validate(); !valid { - return nil, err - } +// Pull loads an existing NodeFeatureDiscovery into Builder struct. +func Pull(apiClient *clients.Settings, name, namespace string) (*Builder, error) { + glog.V(100).Infof("Pulling existing nodeFeatureDiscovery name: %s in namespace: %s", name, namespace) - glog.V(100).Infof("Collecting NodeFeatureDiscovery object %s in namespace %s", - builder.Definition.Name, builder.Definition.Namespace) + if apiClient == nil { + glog.V(100).Info("The apiClient of the Policy is nil") - nodeFeatureDiscovery := &nfdv1.NodeFeatureDiscovery{} - err := builder.apiClient.Get(context.TODO(), goclient.ObjectKey{ - Name: builder.Definition.Name, - Namespace: builder.Definition.Namespace, - }, nodeFeatureDiscovery) + return nil, fmt.Errorf("the apiClient of the Policy is nil") + } + err := apiClient.AttachScheme(nfdv1.AddToScheme) if err != nil { - glog.V(100).Infof("NodeFeatureDiscovery object %s does not exist in namespace %s", - builder.Definition.Name, builder.Definition.Namespace) + glog.V(100).Info("Failed to add nfd v1 scheme to client schemes") return nil, err } - return nodeFeatureDiscovery, err -} - -// Pull loads an existing NodeFeatureDiscovery into Builder struct. -func Pull(apiClient *clients.Settings, name, namespace string) (*Builder, error) { - glog.V(100).Infof("Pulling existing nodeFeatureDiscovery name: %s in namespace: %s", name, namespace) - builder := Builder{ apiClient: apiClient, Definition: &nfdv1.NodeFeatureDiscovery{ @@ -102,13 +103,13 @@ func Pull(apiClient *clients.Settings, name, namespace string) (*Builder, error) if name == "" { glog.V(100).Infof("NodeFeatureDiscovery name is empty") - builder.errorMsg = "NodeFeatureDiscovery 'name' cannot be empty" + return nil, fmt.Errorf("nodeFeatureDiscovery 'name' cannot be empty") } if namespace == "" { glog.V(100).Infof("NodeFeatureDiscovery namespace is empty") - builder.errorMsg = "NodeFeatureDiscovery 'namespace' cannot be empty" + return nil, fmt.Errorf("nodeFeatureDiscovery 'namespace' cannot be empty") } if !builder.Exists() { @@ -120,6 +121,31 @@ func Pull(apiClient *clients.Settings, name, namespace string) (*Builder, error) return &builder, nil } +// Get returns NodeFeatureDiscovery object if found. +func (builder *Builder) Get() (*nfdv1.NodeFeatureDiscovery, error) { + if valid, err := builder.validate(); !valid { + return nil, err + } + + glog.V(100).Infof("Collecting NodeFeatureDiscovery object %s in namespace %s", + builder.Definition.Name, builder.Definition.Namespace) + + nodeFeatureDiscovery := &nfdv1.NodeFeatureDiscovery{} + err := builder.apiClient.Get(context.TODO(), goclient.ObjectKey{ + Name: builder.Definition.Name, + Namespace: builder.Definition.Namespace, + }, nodeFeatureDiscovery) + + if err != nil { + glog.V(100).Infof("NodeFeatureDiscovery object %s does not exist in namespace %s", + builder.Definition.Name, builder.Definition.Namespace) + + return nil, err + } + + return nodeFeatureDiscovery, err +} + // Exists checks whether the given NodeFeatureDiscovery exists. func (builder *Builder) Exists() bool { if valid, _ := builder.validate(); !valid { @@ -150,7 +176,9 @@ func (builder *Builder) Delete() (*Builder, error) { builder.Definition.Namespace) if !builder.Exists() { - return builder, fmt.Errorf("NodeFeatureDiscovery cannot be deleted because it does not exist") + glog.V(100).Infof("nodeFeatureDiscovery cannot be deleted because it does not exist") + + return builder, nil } err := builder.apiClient.Delete(context.TODO(), builder.Definition) diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperatorcommon/defaults.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperatorcommon/defaults.go index 66bf6ca1d..fff0a6c93 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperatorcommon/defaults.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperatorcommon/defaults.go @@ -70,7 +70,7 @@ const ( ArgoCDDefaultArgoImage = "quay.io/argoproj/argocd" // ArgoCDDefaultArgoVersion is the Argo CD container image digest to use when version not specified. - ArgoCDDefaultArgoVersion = "sha256:7f82e7eec131866c3cbd91e5035381d62bd9318269cd3d16e6e2d42ede402292" // v2.11.6 + ArgoCDDefaultArgoVersion = "sha256:a0ebfa7d419a1c78babc80fc77de093751d8a5fabffcaf3f7e81a4d55a23cc0d" // v2.12.1 // ArgoCDDefaultBackupKeyLength is the length of the generated default backup key. ArgoCDDefaultBackupKeyLength = 32 diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/nvidiagpu/k8skoperatorlibs/upgrade/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/nvidiagpu/k8skoperatorlibs/upgrade/v1alpha1/zz_generated.deepcopy.go index 38f524f73..9c2adde64 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/nvidiagpu/k8skoperatorlibs/upgrade/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/schemes/nvidiagpu/k8skoperatorlibs/upgrade/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 NVIDIA diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index b151cb38b..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - clientset "github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned" - machineconfigurationv1 "github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1" - fakemachineconfigurationv1 "github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery - tracker testing.ObjectTracker -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -func (c *Clientset) Tracker() testing.ObjectTracker { - return c.tracker -} - -var ( - _ clientset.Interface = &Clientset{} - _ testing.FakeClient = &Clientset{} -) - -// MachineconfigurationV1 retrieves the MachineconfigurationV1Client -func (c *Clientset) MachineconfigurationV1() machineconfigurationv1.MachineconfigurationV1Interface { - return &fakemachineconfigurationv1.FakeMachineconfigurationV1{Fake: &c.Fake} -} diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/doc.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/doc.go deleted file mode 100644 index 3630ed1cd..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/register.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/register.go deleted file mode 100644 index b6f4e6f25..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake/register.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - machineconfigurationv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) - -var localSchemeBuilder = runtime.SchemeBuilder{ - machineconfigurationv1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/doc.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/doc.go deleted file mode 100644 index 2b5ba4c8e..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_containerruntimeconfig.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_containerruntimeconfig.go deleted file mode 100644 index f66c7699e..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_containerruntimeconfig.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeContainerRuntimeConfigs implements ContainerRuntimeConfigInterface -type FakeContainerRuntimeConfigs struct { - Fake *FakeMachineconfigurationV1 -} - -var containerruntimeconfigsResource = v1.SchemeGroupVersion.WithResource("containerruntimeconfigs") - -var containerruntimeconfigsKind = v1.SchemeGroupVersion.WithKind("ContainerRuntimeConfig") - -// Get takes name of the containerRuntimeConfig, and returns the corresponding containerRuntimeConfig object, and an error if there is any. -func (c *FakeContainerRuntimeConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ContainerRuntimeConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(containerruntimeconfigsResource, name), &v1.ContainerRuntimeConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ContainerRuntimeConfig), err -} - -// List takes label and field selectors, and returns the list of ContainerRuntimeConfigs that match those selectors. -func (c *FakeContainerRuntimeConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ContainerRuntimeConfigList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(containerruntimeconfigsResource, containerruntimeconfigsKind, opts), &v1.ContainerRuntimeConfigList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ContainerRuntimeConfigList{ListMeta: obj.(*v1.ContainerRuntimeConfigList).ListMeta} - for _, item := range obj.(*v1.ContainerRuntimeConfigList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested containerRuntimeConfigs. -func (c *FakeContainerRuntimeConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(containerruntimeconfigsResource, opts)) -} - -// Create takes the representation of a containerRuntimeConfig and creates it. Returns the server's representation of the containerRuntimeConfig, and an error, if there is any. -func (c *FakeContainerRuntimeConfigs) Create(ctx context.Context, containerRuntimeConfig *v1.ContainerRuntimeConfig, opts metav1.CreateOptions) (result *v1.ContainerRuntimeConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(containerruntimeconfigsResource, containerRuntimeConfig), &v1.ContainerRuntimeConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ContainerRuntimeConfig), err -} - -// Update takes the representation of a containerRuntimeConfig and updates it. Returns the server's representation of the containerRuntimeConfig, and an error, if there is any. -func (c *FakeContainerRuntimeConfigs) Update(ctx context.Context, containerRuntimeConfig *v1.ContainerRuntimeConfig, opts metav1.UpdateOptions) (result *v1.ContainerRuntimeConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(containerruntimeconfigsResource, containerRuntimeConfig), &v1.ContainerRuntimeConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ContainerRuntimeConfig), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeContainerRuntimeConfigs) UpdateStatus(ctx context.Context, containerRuntimeConfig *v1.ContainerRuntimeConfig, opts metav1.UpdateOptions) (*v1.ContainerRuntimeConfig, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(containerruntimeconfigsResource, "status", containerRuntimeConfig), &v1.ContainerRuntimeConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ContainerRuntimeConfig), err -} - -// Delete takes name of the containerRuntimeConfig and deletes it. Returns an error if one occurs. -func (c *FakeContainerRuntimeConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(containerruntimeconfigsResource, name, opts), &v1.ContainerRuntimeConfig{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeContainerRuntimeConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(containerruntimeconfigsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ContainerRuntimeConfigList{}) - return err -} - -// Patch applies the patch and returns the patched containerRuntimeConfig. -func (c *FakeContainerRuntimeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ContainerRuntimeConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(containerruntimeconfigsResource, name, pt, data, subresources...), &v1.ContainerRuntimeConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ContainerRuntimeConfig), err -} diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_controllerconfig.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_controllerconfig.go deleted file mode 100644 index 8cbf1b6fa..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_controllerconfig.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeControllerConfigs implements ControllerConfigInterface -type FakeControllerConfigs struct { - Fake *FakeMachineconfigurationV1 -} - -var controllerconfigsResource = v1.SchemeGroupVersion.WithResource("controllerconfigs") - -var controllerconfigsKind = v1.SchemeGroupVersion.WithKind("ControllerConfig") - -// Get takes name of the controllerConfig, and returns the corresponding controllerConfig object, and an error if there is any. -func (c *FakeControllerConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControllerConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(controllerconfigsResource, name), &v1.ControllerConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ControllerConfig), err -} - -// List takes label and field selectors, and returns the list of ControllerConfigs that match those selectors. -func (c *FakeControllerConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerConfigList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(controllerconfigsResource, controllerconfigsKind, opts), &v1.ControllerConfigList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ControllerConfigList{ListMeta: obj.(*v1.ControllerConfigList).ListMeta} - for _, item := range obj.(*v1.ControllerConfigList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested controllerConfigs. -func (c *FakeControllerConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(controllerconfigsResource, opts)) -} - -// Create takes the representation of a controllerConfig and creates it. Returns the server's representation of the controllerConfig, and an error, if there is any. -func (c *FakeControllerConfigs) Create(ctx context.Context, controllerConfig *v1.ControllerConfig, opts metav1.CreateOptions) (result *v1.ControllerConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(controllerconfigsResource, controllerConfig), &v1.ControllerConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ControllerConfig), err -} - -// Update takes the representation of a controllerConfig and updates it. Returns the server's representation of the controllerConfig, and an error, if there is any. -func (c *FakeControllerConfigs) Update(ctx context.Context, controllerConfig *v1.ControllerConfig, opts metav1.UpdateOptions) (result *v1.ControllerConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(controllerconfigsResource, controllerConfig), &v1.ControllerConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ControllerConfig), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeControllerConfigs) UpdateStatus(ctx context.Context, controllerConfig *v1.ControllerConfig, opts metav1.UpdateOptions) (*v1.ControllerConfig, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(controllerconfigsResource, "status", controllerConfig), &v1.ControllerConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ControllerConfig), err -} - -// Delete takes name of the controllerConfig and deletes it. Returns an error if one occurs. -func (c *FakeControllerConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(controllerconfigsResource, name, opts), &v1.ControllerConfig{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeControllerConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(controllerconfigsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ControllerConfigList{}) - return err -} - -// Patch applies the patch and returns the patched controllerConfig. -func (c *FakeControllerConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(controllerconfigsResource, name, pt, data, subresources...), &v1.ControllerConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.ControllerConfig), err -} diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_kubeletconfig.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_kubeletconfig.go deleted file mode 100644 index fb65ca259..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_kubeletconfig.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeKubeletConfigs implements KubeletConfigInterface -type FakeKubeletConfigs struct { - Fake *FakeMachineconfigurationV1 -} - -var kubeletconfigsResource = v1.SchemeGroupVersion.WithResource("kubeletconfigs") - -var kubeletconfigsKind = v1.SchemeGroupVersion.WithKind("KubeletConfig") - -// Get takes name of the kubeletConfig, and returns the corresponding kubeletConfig object, and an error if there is any. -func (c *FakeKubeletConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.KubeletConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(kubeletconfigsResource, name), &v1.KubeletConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.KubeletConfig), err -} - -// List takes label and field selectors, and returns the list of KubeletConfigs that match those selectors. -func (c *FakeKubeletConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.KubeletConfigList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(kubeletconfigsResource, kubeletconfigsKind, opts), &v1.KubeletConfigList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.KubeletConfigList{ListMeta: obj.(*v1.KubeletConfigList).ListMeta} - for _, item := range obj.(*v1.KubeletConfigList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested kubeletConfigs. -func (c *FakeKubeletConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(kubeletconfigsResource, opts)) -} - -// Create takes the representation of a kubeletConfig and creates it. Returns the server's representation of the kubeletConfig, and an error, if there is any. -func (c *FakeKubeletConfigs) Create(ctx context.Context, kubeletConfig *v1.KubeletConfig, opts metav1.CreateOptions) (result *v1.KubeletConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(kubeletconfigsResource, kubeletConfig), &v1.KubeletConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.KubeletConfig), err -} - -// Update takes the representation of a kubeletConfig and updates it. Returns the server's representation of the kubeletConfig, and an error, if there is any. -func (c *FakeKubeletConfigs) Update(ctx context.Context, kubeletConfig *v1.KubeletConfig, opts metav1.UpdateOptions) (result *v1.KubeletConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(kubeletconfigsResource, kubeletConfig), &v1.KubeletConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.KubeletConfig), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeKubeletConfigs) UpdateStatus(ctx context.Context, kubeletConfig *v1.KubeletConfig, opts metav1.UpdateOptions) (*v1.KubeletConfig, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(kubeletconfigsResource, "status", kubeletConfig), &v1.KubeletConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.KubeletConfig), err -} - -// Delete takes name of the kubeletConfig and deletes it. Returns an error if one occurs. -func (c *FakeKubeletConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(kubeletconfigsResource, name, opts), &v1.KubeletConfig{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeKubeletConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(kubeletconfigsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1.KubeletConfigList{}) - return err -} - -// Patch applies the patch and returns the patched kubeletConfig. -func (c *FakeKubeletConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.KubeletConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(kubeletconfigsResource, name, pt, data, subresources...), &v1.KubeletConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.KubeletConfig), err -} diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfig.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfig.go deleted file mode 100644 index b7318c0ee..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfig.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeMachineConfigs implements MachineConfigInterface -type FakeMachineConfigs struct { - Fake *FakeMachineconfigurationV1 -} - -var machineconfigsResource = v1.SchemeGroupVersion.WithResource("machineconfigs") - -var machineconfigsKind = v1.SchemeGroupVersion.WithKind("MachineConfig") - -// Get takes name of the machineConfig, and returns the corresponding machineConfig object, and an error if there is any. -func (c *FakeMachineConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MachineConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(machineconfigsResource, name), &v1.MachineConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.MachineConfig), err -} - -// List takes label and field selectors, and returns the list of MachineConfigs that match those selectors. -func (c *FakeMachineConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MachineConfigList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(machineconfigsResource, machineconfigsKind, opts), &v1.MachineConfigList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.MachineConfigList{ListMeta: obj.(*v1.MachineConfigList).ListMeta} - for _, item := range obj.(*v1.MachineConfigList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested machineConfigs. -func (c *FakeMachineConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(machineconfigsResource, opts)) -} - -// Create takes the representation of a machineConfig and creates it. Returns the server's representation of the machineConfig, and an error, if there is any. -func (c *FakeMachineConfigs) Create(ctx context.Context, machineConfig *v1.MachineConfig, opts metav1.CreateOptions) (result *v1.MachineConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(machineconfigsResource, machineConfig), &v1.MachineConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.MachineConfig), err -} - -// Update takes the representation of a machineConfig and updates it. Returns the server's representation of the machineConfig, and an error, if there is any. -func (c *FakeMachineConfigs) Update(ctx context.Context, machineConfig *v1.MachineConfig, opts metav1.UpdateOptions) (result *v1.MachineConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(machineconfigsResource, machineConfig), &v1.MachineConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.MachineConfig), err -} - -// Delete takes name of the machineConfig and deletes it. Returns an error if one occurs. -func (c *FakeMachineConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(machineconfigsResource, name, opts), &v1.MachineConfig{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMachineConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(machineconfigsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1.MachineConfigList{}) - return err -} - -// Patch applies the patch and returns the patched machineConfig. -func (c *FakeMachineConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MachineConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(machineconfigsResource, name, pt, data, subresources...), &v1.MachineConfig{}) - if obj == nil { - return nil, err - } - return obj.(*v1.MachineConfig), err -} diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfigpool.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfigpool.go deleted file mode 100644 index e895a42a4..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfigpool.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeMachineConfigPools implements MachineConfigPoolInterface -type FakeMachineConfigPools struct { - Fake *FakeMachineconfigurationV1 -} - -var machineconfigpoolsResource = v1.SchemeGroupVersion.WithResource("machineconfigpools") - -var machineconfigpoolsKind = v1.SchemeGroupVersion.WithKind("MachineConfigPool") - -// Get takes name of the machineConfigPool, and returns the corresponding machineConfigPool object, and an error if there is any. -func (c *FakeMachineConfigPools) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MachineConfigPool, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(machineconfigpoolsResource, name), &v1.MachineConfigPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1.MachineConfigPool), err -} - -// List takes label and field selectors, and returns the list of MachineConfigPools that match those selectors. -func (c *FakeMachineConfigPools) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MachineConfigPoolList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(machineconfigpoolsResource, machineconfigpoolsKind, opts), &v1.MachineConfigPoolList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.MachineConfigPoolList{ListMeta: obj.(*v1.MachineConfigPoolList).ListMeta} - for _, item := range obj.(*v1.MachineConfigPoolList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested machineConfigPools. -func (c *FakeMachineConfigPools) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(machineconfigpoolsResource, opts)) -} - -// Create takes the representation of a machineConfigPool and creates it. Returns the server's representation of the machineConfigPool, and an error, if there is any. -func (c *FakeMachineConfigPools) Create(ctx context.Context, machineConfigPool *v1.MachineConfigPool, opts metav1.CreateOptions) (result *v1.MachineConfigPool, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(machineconfigpoolsResource, machineConfigPool), &v1.MachineConfigPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1.MachineConfigPool), err -} - -// Update takes the representation of a machineConfigPool and updates it. Returns the server's representation of the machineConfigPool, and an error, if there is any. -func (c *FakeMachineConfigPools) Update(ctx context.Context, machineConfigPool *v1.MachineConfigPool, opts metav1.UpdateOptions) (result *v1.MachineConfigPool, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(machineconfigpoolsResource, machineConfigPool), &v1.MachineConfigPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1.MachineConfigPool), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeMachineConfigPools) UpdateStatus(ctx context.Context, machineConfigPool *v1.MachineConfigPool, opts metav1.UpdateOptions) (*v1.MachineConfigPool, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(machineconfigpoolsResource, "status", machineConfigPool), &v1.MachineConfigPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1.MachineConfigPool), err -} - -// Delete takes name of the machineConfigPool and deletes it. Returns an error if one occurs. -func (c *FakeMachineConfigPools) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(machineconfigpoolsResource, name, opts), &v1.MachineConfigPool{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMachineConfigPools) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(machineconfigpoolsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1.MachineConfigPoolList{}) - return err -} - -// Patch applies the patch and returns the patched machineConfigPool. -func (c *FakeMachineConfigPools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MachineConfigPool, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(machineconfigpoolsResource, name, pt, data, subresources...), &v1.MachineConfigPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1.MachineConfigPool), err -} diff --git a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfiguration.openshift.io_client.go b/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfiguration.openshift.io_client.go deleted file mode 100644 index d2b03b259..000000000 --- a/vendor/github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake/fake_machineconfiguration.openshift.io_client.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeMachineconfigurationV1 struct { - *testing.Fake -} - -func (c *FakeMachineconfigurationV1) ContainerRuntimeConfigs() v1.ContainerRuntimeConfigInterface { - return &FakeContainerRuntimeConfigs{c} -} - -func (c *FakeMachineconfigurationV1) ControllerConfigs() v1.ControllerConfigInterface { - return &FakeControllerConfigs{c} -} - -func (c *FakeMachineconfigurationV1) KubeletConfigs() v1.KubeletConfigInterface { - return &FakeKubeletConfigs{c} -} - -func (c *FakeMachineconfigurationV1) MachineConfigs() v1.MachineConfigInterface { - return &FakeMachineConfigs{c} -} - -func (c *FakeMachineconfigurationV1) MachineConfigPools() v1.MachineConfigPoolInterface { - return &FakeMachineConfigPools{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeMachineconfigurationV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 674dbd444..adc770db4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -535,7 +535,7 @@ github.com/onsi/gomega/types ## explicit; go 1.20 github.com/openshift-kni/cluster-group-upgrades-operator/pkg/api/clustergroupupgrades github.com/openshift-kni/cluster-group-upgrades-operator/pkg/api/clustergroupupgrades/v1alpha1 -# github.com/openshift-kni/eco-goinfra v0.0.0-20240819205434-62b2119d4777 +# github.com/openshift-kni/eco-goinfra v0.0.0-20240827150327-fe103730d840 ## explicit; go 1.22 github.com/openshift-kni/eco-goinfra/pkg/apiservers github.com/openshift-kni/eco-goinfra/pkg/argocd @@ -856,10 +856,8 @@ github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.opens github.com/openshift/machine-config-operator/pkg/controller/common github.com/openshift/machine-config-operator/pkg/daemon/constants github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned -github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/scheme github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1 -github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1/fake github.com/openshift/machine-config-operator/pkg/generated/informers/externalversions github.com/openshift/machine-config-operator/pkg/generated/informers/externalversions/internalinterfaces github.com/openshift/machine-config-operator/pkg/generated/informers/externalversions/machineconfiguration.openshift.io @@ -1685,7 +1683,7 @@ k8s.io/kube-openapi/pkg/spec3 k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/util/proto/validation k8s.io/kube-openapi/pkg/validation/spec -# k8s.io/kubectl v0.29.3 => k8s.io/kubectl v0.29.4 +# k8s.io/kubectl v0.29.4 => k8s.io/kubectl v0.29.4 ## explicit; go 1.21 k8s.io/kubectl/pkg/cmd/util k8s.io/kubectl/pkg/drain