Skip to content

NO-ISSUE: Synchronize From Upstream Repositories #732

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

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"time"

operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
packageserverclientset "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/clientset/versioned"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
k8serror "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -1421,7 +1420,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
var (
magicCatalog *MagicCatalog
catalogSourceName string
subscription *operatorsv1alpha1.Subscription
subscription *v1alpha1.Subscription
c client.Client
)

Expand All @@ -1444,12 +1443,12 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
When("A Subscription is created catalogSource built with the malformed CSV", func() {

BeforeEach(func() {
subscription = &operatorsv1alpha1.Subscription{
subscription = &v1alpha1.Subscription{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("%s-sub", catalogSourceName),
Namespace: generatedNamespace.GetName(),
},
Spec: &operatorsv1alpha1.SubscriptionSpec{
Spec: &v1alpha1.SubscriptionSpec{
CatalogSource: catalogSourceName,
CatalogSourceNamespace: generatedNamespace.GetName(),
Channel: "stable",
Expand Down Expand Up @@ -1514,7 +1513,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
SourceType: v1alpha1.SourceTypeGrpc,
Image: "quay.io/olmtest/old-opm-catsrc:v1.21.0",
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
SecurityContextConfig: operatorsv1alpha1.Restricted,
SecurityContextConfig: v1alpha1.Restricted,
},
},
}
Expand Down Expand Up @@ -1585,7 +1584,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
SourceType: v1alpha1.SourceTypeGrpc,
Image: "quay.io/olmtest/old-opm-catsrc:v1.21.0",
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
SecurityContextConfig: operatorsv1alpha1.Legacy,
SecurityContextConfig: v1alpha1.Legacy,
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (

"github.com/operator-framework/api/pkg/lib/version"
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
"github.com/operator-framework/api/pkg/operators/v1alpha1"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install"
Expand Down Expand Up @@ -170,6 +169,7 @@ var _ = Describe("Subscription", func() {

By(fmt.Sprintf("creating a subscription: %s/%s", generatedNamespace.GetName(), testSubscriptionName))
cleanup, _ := createSubscription(GinkgoT(), crc, generatedNamespace.GetName(), testSubscriptionName, testPackageName, betaChannel, operatorsv1alpha1.ApprovalAutomatic)

defer cleanup()

By("waiting for the subscription to have a current CSV and be at latest")
Expand Down Expand Up @@ -366,6 +366,7 @@ var _ = Describe("Subscription", func() {

By(`Set the InstallPlan's approved to True`)
Eventually(Apply(newInstallPlan, func(p *operatorsv1alpha1.InstallPlan) error {

p.Spec.Approved = true
return nil
})).Should(Succeed())
Expand Down Expand Up @@ -1084,6 +1085,7 @@ var _ = Describe("Subscription", func() {
By(`Set the InstallPlan's approval mode to Manual`)
Eventually(Apply(plan, func(p *operatorsv1alpha1.InstallPlan) error {
p.Spec.Approval = operatorsv1alpha1.ApprovalManual

p.Spec.Approved = false
return nil
})).Should(Succeed())
Expand Down Expand Up @@ -2440,7 +2442,7 @@ var _ = Describe("Subscription", func() {
if err != nil {
return "", err
}
cond := fetched.Status.GetCondition(v1alpha1.SubscriptionBundleUnpacking)
cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpacking)
return cond.Status, nil
},
5*time.Minute,
Expand All @@ -2454,7 +2456,7 @@ var _ = Describe("Subscription", func() {
if err != nil {
return "", err
}
cond := fetched.Status.GetCondition(v1alpha1.SubscriptionBundleUnpackFailed)
cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpackFailed)
return cond.Status, nil
},
5*time.Minute,
Expand Down Expand Up @@ -2483,9 +2485,9 @@ var _ = Describe("Subscription", func() {
if err != nil {
return "", err
}
cond := fetched.Status.GetCondition(v1alpha1.SubscriptionBundleUnpackFailed)
cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpackFailed)
if cond.Status != corev1.ConditionTrue || cond.Reason != "BundleUnpackFailed" {
return "", fmt.Errorf("%s condition not found", v1alpha1.SubscriptionBundleUnpackFailed)
return "", fmt.Errorf("%s condition not found", operatorsv1alpha1.SubscriptionBundleUnpackFailed)
}

return cond.Message, nil
Expand Down Expand Up @@ -2527,7 +2529,7 @@ var _ = Describe("Subscription", func() {

By("waiting for the subscription to have v0.2.0 installed with a Bundle Deprecated condition")
sub, err := fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasCondition(
v1alpha1.SubscriptionBundleDeprecated,
operatorsv1alpha1.SubscriptionBundleDeprecated,
corev1.ConditionTrue,
"",
"olm.bundle/example-operator.v0.2.0: bundle \"example-operator.v0.2.0\" has been deprecated. Please switch to a different one."))
Expand Down Expand Up @@ -2557,7 +2559,7 @@ var _ = Describe("Subscription", func() {
Expect(err).To(BeNil())

By("waiting for the subscription to have v0.3.0 installed with no deprecation message present")
_, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionDoesNotHaveCondition(v1alpha1.SubscriptionDeprecated))
_, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionDoesNotHaveCondition(operatorsv1alpha1.SubscriptionDeprecated))
Expect(err).Should(BeNil())
})

Expand All @@ -2574,7 +2576,7 @@ var _ = Describe("Subscription", func() {

By("waiting for the subscription to have v0.2.0 installed with a Bundle Deprecated condition")
sub, err := fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasCondition(
v1alpha1.SubscriptionBundleDeprecated,
operatorsv1alpha1.SubscriptionBundleDeprecated,
corev1.ConditionTrue,
"",
"olm.bundle/example-operator.v0.2.0: bundle \"example-operator.v0.2.0\" has been deprecated. Please switch to a different one."))
Expand All @@ -2592,10 +2594,10 @@ var _ = Describe("Subscription", func() {
Expect(err).To(BeNil())

By("waiting for the subscription to have v0.3.0 installed with a Package deprecated condition")
_, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionDoesNotHaveCondition(v1alpha1.SubscriptionBundleDeprecated))
_, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionDoesNotHaveCondition(operatorsv1alpha1.SubscriptionBundleDeprecated))
Expect(err).Should(BeNil())
sub, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasCondition(
v1alpha1.SubscriptionPackageDeprecated,
operatorsv1alpha1.SubscriptionPackageDeprecated,
corev1.ConditionTrue,
"",
"olm.package/packageA: packageA has been deprecated. Please switch to packageB."))
Expand Down Expand Up @@ -2650,9 +2652,9 @@ var _ = Describe("Subscription", func() {
if err != nil {
return false, err
}
cond := sub.Status.GetCondition(v1alpha1.SubscriptionDeprecated)
cond := sub.Status.GetCondition(operatorsv1alpha1.SubscriptionDeprecated)
if cond.Status != corev1.ConditionTrue {
return false, fmt.Errorf("%s condition not found", v1alpha1.SubscriptionDeprecated)
return false, fmt.Errorf("%s condition not found", operatorsv1alpha1.SubscriptionDeprecated)
}

return true, nil
Expand Down Expand Up @@ -2774,8 +2776,8 @@ properties:
if err != nil {
return err
}
if cond := fetched.Status.GetCondition(v1alpha1.SubscriptionBundleUnpackFailed); cond.Status != corev1.ConditionTrue || cond.Reason != "BundleUnpackFailed" {
return fmt.Errorf("%s condition not found", v1alpha1.SubscriptionBundleUnpackFailed)
if cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpackFailed); cond.Status != corev1.ConditionTrue || cond.Reason != "BundleUnpackFailed" {
return fmt.Errorf("%s condition not found", operatorsv1alpha1.SubscriptionBundleUnpackFailed)
}
return nil
},
Expand Down Expand Up @@ -2806,11 +2808,11 @@ properties:
if err != nil {
return err
}
if cond := fetched.Status.GetCondition(v1alpha1.SubscriptionBundleUnpacking); cond.Status != corev1.ConditionUnknown {
return fmt.Errorf("subscription condition %s has unexpected value %s, expected %s", v1alpha1.SubscriptionBundleUnpacking, cond.Status, corev1.ConditionFalse)
if cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpacking); cond.Status != corev1.ConditionUnknown {
return fmt.Errorf("subscription condition %s has unexpected value %s, expected %s", operatorsv1alpha1.SubscriptionBundleUnpacking, cond.Status, corev1.ConditionFalse)
}
if cond := fetched.Status.GetCondition(v1alpha1.SubscriptionBundleUnpackFailed); cond.Status != corev1.ConditionUnknown {
return fmt.Errorf("unexpected condition %s on subscription", v1alpha1.SubscriptionBundleUnpackFailed)
if cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpackFailed); cond.Status != corev1.ConditionUnknown {
return fmt.Errorf("unexpected condition %s on subscription", operatorsv1alpha1.SubscriptionBundleUnpackFailed)
}
return nil
}).Should(Succeed())
Expand Down Expand Up @@ -2846,11 +2848,11 @@ properties:
if err != nil {
return err
}
if cond := fetched.Status.GetCondition(v1alpha1.SubscriptionBundleUnpacking); cond.Status == corev1.ConditionTrue {
return fmt.Errorf("unexpected condition status for %s on subscription %s", v1alpha1.SubscriptionBundleUnpacking, subName)
if cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpacking); cond.Status == corev1.ConditionTrue {
return fmt.Errorf("unexpected condition status for %s on subscription %s", operatorsv1alpha1.SubscriptionBundleUnpacking, subName)
}
if cond := fetched.Status.GetCondition(v1alpha1.SubscriptionBundleUnpackFailed); cond.Status == corev1.ConditionTrue {
return fmt.Errorf("unexpected condition status for %s on subscription %s", v1alpha1.SubscriptionBundleUnpackFailed, subName)
if cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpackFailed); cond.Status == corev1.ConditionTrue {
return fmt.Errorf("unexpected condition status for %s on subscription %s", operatorsv1alpha1.SubscriptionBundleUnpackFailed, subName)
}
return nil
}).Should(Succeed())
Expand Down Expand Up @@ -3396,6 +3398,7 @@ func waitForSubscriptionToDelete(namespace, name string, c versioned.Interface)
}

func checkDeploymentHasPodConfigNodeSelector(t GinkgoTInterface, client operatorclient.ClientInterface, csv *operatorsv1alpha1.ClusterServiceVersion, nodeSelector map[string]string) error {

resolver := install.StrategyResolver{}

strategy, err := resolver.UnmarshalStrategy(csv.Spec.InstallStrategy)
Expand Down