From a01dc55d2be339043f1e3623b28ddad7e2fdc31a Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Wed, 18 Sep 2024 10:32:15 -0500 Subject: [PATCH] cnf core: use GetGVR() instead of GetServiceGVR() --- go.mod | 2 +- go.sum | 4 ++-- tests/cnf/core/network/metallb/tests/bfd-test.go | 2 +- tests/cnf/core/network/metallb/tests/bgp-tests.go | 4 ++-- .../cnf/core/network/metallb/tests/layer2-test.go | 2 +- .../pkg/clusterversion/clusterversion.go | 14 +++++++------- .../eco-goinfra/pkg/console/console.go | 10 +++++----- .../pkg/infrastructure/infrastructure.go | 8 ++++---- .../eco-goinfra/pkg/network/network.go | 8 ++++---- .../openshift-kni/eco-goinfra/pkg/proxy/proxy.go | 8 ++++---- vendor/modules.txt | 2 +- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/go.mod b/go.mod index bb9fcd995..6f42efb21 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-20241001140145-4b805e11b245 // latest + github.com/openshift-kni/eco-goinfra v0.0.0-20241003151956-8f011e8f2d76 // 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 diff --git a/go.sum b/go.sum index 09cd99bee..f367f516c 100644 --- a/go.sum +++ b/go.sum @@ -1264,8 +1264,8 @@ github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/openshift-kni/cluster-group-upgrades-operator v0.0.0-20240423171335-f07cdbf8af2c h1:wAPCXsnAXOUAJ5DYlVgGUcV9YBSiVlH4o9tbQ9py8ZY= 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-20241001140145-4b805e11b245 h1:NX/QFJSdK6gqsPS/Cm/OnrbVNvHovpwLEX98U0PX+5U= -github.com/openshift-kni/eco-goinfra v0.0.0-20241001140145-4b805e11b245/go.mod h1:yWno/75XOopIj/GlMgvm+dye+cwbaMQBVek1XNGl+SI= +github.com/openshift-kni/eco-goinfra v0.0.0-20241003151956-8f011e8f2d76 h1:SjNTz1xYXjBLgoauDqVooIojx8IHBzqa3iGr0LtriU0= +github.com/openshift-kni/eco-goinfra v0.0.0-20241003151956-8f011e8f2d76/go.mod h1:yWno/75XOopIj/GlMgvm+dye+cwbaMQBVek1XNGl+SI= 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/tests/cnf/core/network/metallb/tests/bfd-test.go b/tests/cnf/core/network/metallb/tests/bfd-test.go index 2b552358d..6acd4d7e4 100644 --- a/tests/cnf/core/network/metallb/tests/bfd-test.go +++ b/tests/cnf/core/network/metallb/tests/bfd-test.go @@ -203,7 +203,7 @@ var _ = Describe("BFD", Ordered, Label(tsparams.LabelBFDTestCases), ContinueOnFa err = namespace.NewBuilder(APIClient, tsparams.TestNamespaceName).CleanObjects( tsparams.DefaultTimeout, pod.GetGVR(), - service.GetServiceGVR(), + service.GetGVR(), configmap.GetGVR(), nad.GetGVR()) Expect(err).ToNot(HaveOccurred(), "Failed to clean test namespace") diff --git a/tests/cnf/core/network/metallb/tests/bgp-tests.go b/tests/cnf/core/network/metallb/tests/bgp-tests.go index 5e99d83ee..8d928a80d 100644 --- a/tests/cnf/core/network/metallb/tests/bgp-tests.go +++ b/tests/cnf/core/network/metallb/tests/bgp-tests.go @@ -94,7 +94,7 @@ var _ = Describe("BGP", Ordered, Label(tsparams.LabelBGPTestCases), ContinueOnFa err = namespace.NewBuilder(APIClient, tsparams.TestNamespaceName).CleanObjects( tsparams.DefaultTimeout, pod.GetGVR(), - service.GetServiceGVR(), + service.GetGVR(), configmap.GetGVR(), nad.GetGVR()) Expect(err).ToNot(HaveOccurred(), "Failed to clean test namespace") @@ -217,7 +217,7 @@ var _ = Describe("BGP", Ordered, Label(tsparams.LabelBGPTestCases), ContinueOnFa err = namespace.NewBuilder(APIClient, tsparams.TestNamespaceName).CleanObjects( tsparams.DefaultTimeout, pod.GetGVR(), - service.GetServiceGVR(), + service.GetGVR(), configmap.GetGVR(), nad.GetGVR()) Expect(err).ToNot(HaveOccurred(), "Failed to clean test namespace") diff --git a/tests/cnf/core/network/metallb/tests/layer2-test.go b/tests/cnf/core/network/metallb/tests/layer2-test.go index bade2d400..8d8cc071b 100644 --- a/tests/cnf/core/network/metallb/tests/layer2-test.go +++ b/tests/cnf/core/network/metallb/tests/layer2-test.go @@ -111,7 +111,7 @@ var _ = Describe("Layer2", Ordered, Label(tsparams.LabelLayer2TestCases), Contin err = namespace.NewBuilder(APIClient, tsparams.TestNamespaceName).CleanObjects( tsparams.DefaultTimeout, pod.GetGVR(), - service.GetServiceGVR(), + service.GetGVR(), nad.GetGVR()) Expect(err).ToNot(HaveOccurred(), "Failed to clean test namespace") }) diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/clusterversion/clusterversion.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/clusterversion/clusterversion.go index 48290dd5a..eba802a1f 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/clusterversion/clusterversion.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/clusterversion/clusterversion.go @@ -10,7 +10,7 @@ import ( "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" "github.com/openshift-kni/eco-goinfra/pkg/msg" - v1 "github.com/openshift/api/config/v1" + configv1 "github.com/openshift/api/config/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" @@ -24,9 +24,9 @@ const ( // Builder provides a struct for clusterversion object from the cluster and a clusterversion definition. type Builder struct { // clusterversion definition, used to create the clusterversion object. - Definition *v1.ClusterVersion + Definition *configv1.ClusterVersion // Created clusterversion object. - Object *v1.ClusterVersion + Object *configv1.ClusterVersion // api client to interact with the cluster. apiClient *clients.Settings // Used in functions that define or mutate clusterversion definition. errorMsg is processed before the @@ -40,7 +40,7 @@ func Pull(apiClient *clients.Settings) (*Builder, error) { builder := Builder{ apiClient: apiClient, - Definition: &v1.ClusterVersion{ + Definition: &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: clusterVersionName, }, @@ -90,7 +90,7 @@ func (builder *Builder) WithDesiredUpdateImage(desiredUpdateImage string, force return builder } - builder.Definition.Spec.DesiredUpdate = &v1.Update{Image: desiredUpdateImage, Force: force} + builder.Definition.Spec.DesiredUpdate = &configv1.Update{Image: desiredUpdateImage, Force: force} return builder } @@ -150,7 +150,7 @@ func (builder *Builder) WaitUntilAvailable(timeout time.Duration) error { // WaitUntilConditionTrue waits for timeout duration or until clusterversion gets to a specific status. func (builder *Builder) WaitUntilConditionTrue( - conditionType v1.ClusterStatusConditionType, timeout time.Duration) error { + conditionType configv1.ClusterStatusConditionType, timeout time.Duration) error { if valid, err := builder.validate(); !valid { return err } @@ -193,7 +193,7 @@ func (builder *Builder) WaitUntilUpdateIsCompleted(timeout time.Duration) error // WaitUntilUpdateHistoryStateTrue waits until there is a history entry indicating an updateHistoryState. func (builder *Builder) WaitUntilUpdateHistoryStateTrue( - updateHistoryState v1.UpdateState, timeout time.Duration) error { + updateHistoryState configv1.UpdateState, timeout time.Duration) error { if valid, err := builder.validate(); !valid { return err } diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/console/console.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/console/console.go index 6ee3d6c87..aaa4ef690 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/console/console.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/console/console.go @@ -9,16 +9,16 @@ import ( "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" "github.com/openshift-kni/eco-goinfra/pkg/msg" - v1 "github.com/openshift/api/config/v1" + configv1 "github.com/openshift/api/config/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Builder provides a struct for console object from the cluster and a console definition. type Builder struct { // Console definition, used to create the pod object. - Definition *v1.Console + Definition *configv1.Console // Created console object. - Object *v1.Console + Object *configv1.Console // api client to interact with the cluster. apiClient *clients.Settings // errorMsg is processed before console object is created. @@ -31,7 +31,7 @@ func NewBuilder(apiClient *clients.Settings, name string) *Builder { builder := Builder{ apiClient: apiClient, - Definition: &v1.Console{ + Definition: &configv1.Console{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, @@ -51,7 +51,7 @@ func NewBuilder(apiClient *clients.Settings, name string) *Builder { func Pull(apiClient *clients.Settings, name string) (*Builder, error) { builder := Builder{ apiClient: apiClient, - Definition: &v1.Console{ + Definition: &configv1.Console{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/infrastructure/infrastructure.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/infrastructure/infrastructure.go index c652f1d2a..63712f683 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/infrastructure/infrastructure.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/infrastructure/infrastructure.go @@ -7,7 +7,7 @@ import ( "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" "github.com/openshift-kni/eco-goinfra/pkg/msg" - v1 "github.com/openshift/api/config/v1" + configv1 "github.com/openshift/api/config/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -19,9 +19,9 @@ const ( // Builder provides a struct for infrastructure object from the cluster and a infrastructure definition. type Builder struct { // infrastructure definition, used to create the infrastructure object. - Definition *v1.Infrastructure + Definition *configv1.Infrastructure // Created infrastructure object. - Object *v1.Infrastructure + Object *configv1.Infrastructure // api client to interact with the cluster. apiClient *clients.Settings } @@ -32,7 +32,7 @@ func Pull(apiClient *clients.Settings) (*Builder, error) { builder := Builder{ apiClient: apiClient, - Definition: &v1.Infrastructure{ + Definition: &configv1.Infrastructure{ ObjectMeta: metav1.ObjectMeta{ Name: infrastructureName, }, diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/network/network.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/network/network.go index 79df67820..38451deb5 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/network/network.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/network/network.go @@ -7,7 +7,7 @@ import ( "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" "github.com/openshift-kni/eco-goinfra/pkg/msg" - v1 "github.com/openshift/api/config/v1" + configv1 "github.com/openshift/api/config/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -19,9 +19,9 @@ const ( // ConfigBuilder provides a struct for network object from the cluster and a network definition. type ConfigBuilder struct { // network definition, used to create the network object. - Definition *v1.Network + Definition *configv1.Network // Created network object. - Object *v1.Network + Object *configv1.Network // api client to interact with the cluster. apiClient *clients.Settings } @@ -32,7 +32,7 @@ func PullConfig(apiClient *clients.Settings) (*ConfigBuilder, error) { builder := ConfigBuilder{ apiClient: apiClient, - Definition: &v1.Network{ + Definition: &configv1.Network{ ObjectMeta: metav1.ObjectMeta{ Name: clusterNetworkName, }, diff --git a/vendor/github.com/openshift-kni/eco-goinfra/pkg/proxy/proxy.go b/vendor/github.com/openshift-kni/eco-goinfra/pkg/proxy/proxy.go index 1f2973f56..f7fe1bc25 100644 --- a/vendor/github.com/openshift-kni/eco-goinfra/pkg/proxy/proxy.go +++ b/vendor/github.com/openshift-kni/eco-goinfra/pkg/proxy/proxy.go @@ -7,7 +7,7 @@ import ( "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" "github.com/openshift-kni/eco-goinfra/pkg/msg" - v1 "github.com/openshift/api/config/v1" + configv1 "github.com/openshift/api/config/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -19,9 +19,9 @@ const ( // Builder provides a struct for proxy object from the cluster and a proxy definition. type Builder struct { // proxy definition, used to create the proxy object. - Definition *v1.Proxy + Definition *configv1.Proxy // Created proxy object. - Object *v1.Proxy + Object *configv1.Proxy // api client to interact with the cluster. apiClient *clients.Settings } @@ -32,7 +32,7 @@ func Pull(apiClient *clients.Settings) (*Builder, error) { builder := Builder{ apiClient: apiClient, - Definition: &v1.Proxy{ + Definition: &configv1.Proxy{ ObjectMeta: metav1.ObjectMeta{ Name: clusterProxyName, }, diff --git a/vendor/modules.txt b/vendor/modules.txt index d10214348..9d312e291 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -521,7 +521,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-20241001140145-4b805e11b245 +# github.com/openshift-kni/eco-goinfra v0.0.0-20241003151956-8f011e8f2d76 ## explicit; go 1.22 github.com/openshift-kni/eco-goinfra/pkg/apiservers github.com/openshift-kni/eco-goinfra/pkg/argocd