Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-25673: NO-ISSUE: Synchronize From Upstream Repositories #641

Merged
merged 2 commits into from Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -18,6 +18,7 @@ import (
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
operatorsv1alpha2 "github.com/operator-framework/api/pkg/operators/v1alpha2"
operatorsv2 "github.com/operator-framework/api/pkg/operators/v2"

"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install"
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/decorators"
Expand Down Expand Up @@ -181,6 +182,7 @@ func HasOLMOwnerRef(object metav1.Object) bool {
operatorsv1.GroupVersion,
operatorsv1alpha1.SchemeGroupVersion,
operatorsv1alpha2.GroupVersion,
operatorsv2.GroupVersion,
} {
if ref.APIVersion == gv.String() {
return true
Expand Down
14 changes: 7 additions & 7 deletions staging/operator-lifecycle-manager/test/e2e/bundle_e2e_test.go
Expand Up @@ -62,7 +62,7 @@ var _ = Describe("Installing bundles with new object types", func() {
imageName = "quay.io/olmtest/single-bundle-index:pdb-v1"
)

// create VPA CRD on cluster
By("create VPA CRD on cluster")
Expect(vpaCRDRaw).ToNot(BeEmpty(), "could not read vpa bindata")
data, err := yaml.YAMLToJSON(vpaCRDRaw)
Expect(err).ToNot(HaveOccurred(), "could not convert vpa crd to json")
Expand All @@ -80,7 +80,7 @@ var _ = Describe("Installing bundles with new object types", func() {
return nil
}).Should(Succeed())

// ensure vpa crd is established and accepted on the cluster before continuing
By("ensure vpa crd is established and accepted on the cluster before continuing")
Eventually(func() (bool, error) {
crd, err := kubeClient.ApiextensionsInterface().ApiextensionsV1().CustomResourceDefinitions().Get(context.Background(), vpaCRD.GetName(), metav1.GetOptions{})
if err != nil {
Expand Down Expand Up @@ -113,20 +113,20 @@ var _ = Describe("Installing bundles with new object types", func() {
return err
}).Should(Succeed())

// Wait for the CatalogSource to be ready
By("Wait for the CatalogSource to be ready")
_, err = fetchCatalogSourceOnStatus(operatorClient, source.GetName(), source.GetNamespace(), catalogSourceRegistryPodSynced())
Expect(err).ToNot(HaveOccurred(), "catalog source did not become ready")

// Create a Subscription for package
By("Create a Subscription for package")
_ = createSubscriptionForCatalog(operatorClient, source.GetNamespace(), subName, source.GetName(), packageName, channelName, "", v1alpha1.ApprovalAutomatic)

// Wait for the Subscription to succeed
By("Wait for the Subscription to succeed")
sub, err := fetchSubscription(operatorClient, generatedNamespace.GetName(), subName, subscriptionStateAtLatestChecker())
Expect(err).ToNot(HaveOccurred(), "could not get subscription at latest status")

installPlanRef := sub.Status.InstallPlanRef

// Wait for the installplan to complete (5 minute timeout)
By("Wait for the installplan to complete (5 minute timeout)")
_, err = fetchInstallPlanWithNamespace(GinkgoT(), operatorClient, installPlanRef.Name, installPlanRef.Namespace, buildInstallPlanPhaseCheckFunc(v1alpha1.InstallPlanPhaseComplete))
Expect(err).ToNot(HaveOccurred(), "could not get installplan at complete phase")

Expand All @@ -149,7 +149,7 @@ var _ = Describe("Installing bundles with new object types", func() {
Resource: vpaResource,
}

// confirm extra bundle objects are installed
By("confirm extra bundle objects are installed")
Eventually(func() error {
_, err := kubeClient.KubernetesInterface().SchedulingV1().PriorityClasses().Get(context.Background(), priorityClassName, metav1.GetOptions{})
return err
Expand Down
208 changes: 104 additions & 104 deletions staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go

Large diffs are not rendered by default.

Expand Up @@ -70,12 +70,12 @@ var _ = Describe("Global Catalog Exclusion", func() {
localCatalog, err = NewMagicCatalogFromFile(determinedE2eClient, generatedNamespace.GetName(), localCatalogName, fbcPath)
Expect(err).To(Succeed())

// deploy catalog blocks until the catalog has reached a ready state or fails
By("deploy catalog blocks until the catalog has reached a ready state or fails")
Expect(localCatalog.DeployCatalog(context.Background())).To(Succeed())

By("checking that the global catalog is broken")
// Adding this check here to speed up the test
// the global catalog can fail while we wait for the local catalog to get to a ready state
By("Adding this check here to speed up the test")
By("the global catalog can fail while we wait for the local catalog to get to a ready state")
EventuallyResource(globalCatalog).Should(HaveGrpcConnectionWithLastConnectionState(connectivity.TransientFailure))
})

Expand Down
Expand Up @@ -47,7 +47,7 @@ var _ = Describe("CatalogSource Grpc Pod Config", func() {
BeforeEach(func() {
client = ctx.Ctx().Client()

// must be a grpc source type with spec.image defined
By("must be a grpc source type with spec.image defined")
catalogSource = &v1alpha1.CatalogSource{
ObjectMeta: metav1.ObjectMeta{
Name: catalogSourceName,
Expand All @@ -64,10 +64,10 @@ var _ = Describe("CatalogSource Grpc Pod Config", func() {
})

AfterEach(func() {
// assume the catalog source was created and just delete it
By("assume the catalog source was created and just delete it")
_ = client.Delete(context.TODO(), catalogSource)

// wait for it to go away
By("wait for it to go away")
Expect(waitForDelete(func() error {
return client.Get(context.TODO(), k8scontrollerclient.ObjectKey{
Name: catalogSource.GetName(),
Expand All @@ -79,14 +79,14 @@ var _ = Describe("CatalogSource Grpc Pod Config", func() {
It("should override the pod's spec.priorityClassName", func() {
var overridenPriorityClassName = "system-node-critical"

// create catalog source
By("create catalog source")
catalogSource.Spec.GrpcPodConfig = &v1alpha1.GrpcPodConfig{
PriorityClassName: &overridenPriorityClassName,
SecurityContextConfig: v1alpha1.Restricted,
}
mustCreateCatalogSource(client, catalogSource)

// Check overrides are present in the spec
By("Check overrides are present in the spec")
catalogSourcePod := mustGetCatalogSourcePod(client, catalogSource)
Expect(catalogSourcePod).ToNot(BeNil())
Expect(catalogSourcePod.Spec.NodeSelector).To(BeEquivalentTo(defaultNodeSelector))
Expand All @@ -97,14 +97,14 @@ var _ = Describe("CatalogSource Grpc Pod Config", func() {
It("should override the pod's spec.priorityClassName when it is empty", func() {
var overridenPriorityClassName = ""

// create catalog source
By("create catalog source")
catalogSource.Spec.GrpcPodConfig = &v1alpha1.GrpcPodConfig{
PriorityClassName: &overridenPriorityClassName,
SecurityContextConfig: v1alpha1.Restricted,
}
mustCreateCatalogSource(client, catalogSource)

// Check overrides are present in the spec
By("Check overrides are present in the spec")
catalogSourcePod := mustGetCatalogSourcePod(client, catalogSource)
Expect(catalogSourcePod).ToNot(BeNil())
Expect(catalogSourcePod.Spec.NodeSelector).To(BeEquivalentTo(defaultNodeSelector))
Expand All @@ -118,14 +118,14 @@ var _ = Describe("CatalogSource Grpc Pod Config", func() {
"some": "tag",
}

// create catalog source
By("create catalog source")
catalogSource.Spec.GrpcPodConfig = &v1alpha1.GrpcPodConfig{
NodeSelector: overridenNodeSelector,
SecurityContextConfig: v1alpha1.Restricted,
}
mustCreateCatalogSource(client, catalogSource)

// Check overrides are present in the spec
By("Check overrides are present in the spec")
catalogSourcePod := mustGetCatalogSourcePod(client, catalogSource)
Expect(catalogSourcePod).ToNot(BeNil())
Expect(catalogSourcePod.Spec.NodeSelector).To(BeEquivalentTo(overridenNodeSelector))
Expand All @@ -149,14 +149,14 @@ var _ = Describe("CatalogSource Grpc Pod Config", func() {
},
}

// create catalog source
By("create catalog source")
catalogSource.Spec.GrpcPodConfig = &v1alpha1.GrpcPodConfig{
Tolerations: overriddenTolerations,
SecurityContextConfig: v1alpha1.Restricted,
}
mustCreateCatalogSource(client, catalogSource)

// Check overrides are present in the spec
By("Check overrides are present in the spec")
catalogSourcePod := mustGetCatalogSourcePod(client, catalogSource)
Expect(catalogSourcePod).ToNot(BeNil())
Expect(catalogSourcePod.Spec.NodeSelector).To(BeEquivalentTo(defaultNodeSelector))
Expand Down