|
| 1 | +package cvo |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + |
| 6 | + g "github.com/onsi/ginkgo/v2" |
| 7 | + o "github.com/onsi/gomega" |
| 8 | + |
| 9 | + apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" |
| 10 | + kerrors "k8s.io/apimachinery/pkg/api/errors" |
| 11 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 12 | + "k8s.io/client-go/rest" |
| 13 | + |
| 14 | + "github.com/openshift/cluster-version-operator/test/util" |
| 15 | +) |
| 16 | + |
| 17 | +var _ = g.Describe(`[Jira:"Cluster Version Operator"] cluster-version-operator`, func() { |
| 18 | + |
| 19 | + var ( |
| 20 | + c *rest.Config |
| 21 | + err error |
| 22 | + |
| 23 | + ctx = context.Background() |
| 24 | + apiExtensionsClient apiextensionsclientset.Interface |
| 25 | + ) |
| 26 | + |
| 27 | + g.BeforeEach(func() { |
| 28 | + c, err = util.GetRestConfig() |
| 29 | + o.Expect(err).To(o.BeNil()) |
| 30 | + |
| 31 | + o.Expect(util.SkipIfHypershift(ctx, c)).To(o.BeNil()) |
| 32 | + o.Expect(util.SkipIfMicroshift(ctx, c)).To(o.BeNil()) |
| 33 | + |
| 34 | + apiExtensionsClient, err = apiextensionsclientset.NewForConfig(c) |
| 35 | + o.Expect(err).To(o.BeNil()) |
| 36 | + |
| 37 | + }) |
| 38 | + |
| 39 | + g.It("should install light speed CRDs correctly", func() { |
| 40 | + for _, name := range []string{"proposals.agentic.openshift.io", "agents.agentic.openshift.io", "workflows.agentic.openshift.io"} { |
| 41 | + _, err := apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, name, metav1.GetOptions{}) |
| 42 | + if util.IsTechPreviewNoUpgrade(ctx, c) { |
| 43 | + o.Expect(err).To(o.BeNil()) |
| 44 | + } else { |
| 45 | + o.Expect(kerrors.IsNotFound(err)).To(o.BeTrue()) |
| 46 | + } |
| 47 | + } |
| 48 | + }) |
| 49 | +}) |
0 commit comments