Skip to content

Commit a6acf50

Browse files
Merge pull request #1473 from awgreene/generation-required-bug
BUG 1825349: Generation required bug
2 parents 2248cc6 + e1fcb99 commit a6acf50

File tree

5 files changed

+14
-18
lines changed

5 files changed

+14
-18
lines changed

deploy/chart/templates/0000_50_olm_04-installplan.crd.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ spec:
6767
- approval
6868
- approved
6969
- clusterServiceVersionNames
70-
- generation
7170
properties:
7271
approval:
7372
description: Approval is the user approval policy for an InstallPlan.

manifests/0000_50_olm_04-installplan.crd.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ spec:
6767
- approval
6868
- approved
6969
- clusterServiceVersionNames
70-
- generation
7170
properties:
7271
approval:
7372
description: Approval is the user approval policy for an InstallPlan.
@@ -301,4 +300,3 @@ spec:
301300
description: StepStatus is the current status of a particular
302301
resource an in InstallPlan
303302
type: string
304-

pkg/api/apis/operators/v1alpha1/installplan_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type InstallPlanSpec struct {
2828
ClusterServiceVersionNames []string `json:"clusterServiceVersionNames"`
2929
Approval Approval `json:"approval"`
3030
Approved bool `json:"approved"`
31-
Generation int `json:"generation"`
31+
Generation int `json:"generation,omitempty"`
3232
}
3333

3434
// InstallPlanPhase is the current status of a InstallPlan as a whole.

test/e2e/catalog_e2e_test.go

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,6 @@ func TestCatalogImageUpdate(t *testing.T) {
733733

734734
// ensure registry pod is ready before attempting port-forwarding
735735
_ = awaitPod(t, c, testNamespace, registryName, podReady)
736-
737736
err = registryPortForward(testNamespace)
738737
if err != nil {
739738
t.Fatalf("port-forwarding local registry: %s", err)
@@ -780,8 +779,8 @@ func TestCatalogImageUpdate(t *testing.T) {
780779
defer cleaner.NotifyTestComplete(t, true)
781780

782781
sourceName := genName("catalog-")
783-
packageName := "etcd"
784-
channelName := "clusterwide-alpha"
782+
packageName := "busybox"
783+
channelName := "alpha"
785784

786785
// Create gRPC CatalogSource using an external registry image and poll interval
787786
var image string
@@ -918,7 +917,7 @@ func TestCatalogImageUpdate(t *testing.T) {
918917
require.NoError(t, err, "error awaiting registry pod")
919918

920919
subChecker := func(sub *v1alpha1.Subscription) bool {
921-
return sub.Status.InstalledCSV == "etcdoperator.v0.9.2-clusterwide"
920+
return sub.Status.InstalledCSV == "busybox.v2.0.0"
922921
}
923922
// Wait for the Subscription to succeed
924923
subscription, err = fetchSubscription(t, crc, testNamespace, subscriptionName, subChecker)
@@ -931,17 +930,13 @@ func TestCatalogImageUpdate(t *testing.T) {
931930

932931
// check version of running csv to ensure the latest version (0.9.2) was installed onto the cluster
933932
v := csv.Spec.Version
934-
etcdVersion := semver.Version{
935-
Major: 0,
936-
Minor: 9,
937-
Patch: 2,
938-
Pre: []semver.PRVersion{
939-
{
940-
VersionStr: "clusterwide",
941-
},
942-
},
933+
busyboxVersion := semver.Version{
934+
Major: 2,
935+
Minor: 0,
936+
Patch: 0,
943937
}
944-
if !reflect.DeepEqual(v, version.OperatorVersion{Version: etcdVersion}) {
938+
939+
if !reflect.DeepEqual(v, version.OperatorVersion{Version: busyboxVersion}) {
945940
t.Errorf("latest version of operator not installed: catalog souce update failed")
946941
}
947942
}

test/e2e/subscription_e2e_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,10 @@ func TestCreateNewSubscriptionWithPodConfig(t *testing.T) {
13531353
require.NotNil(t, subscription)
13541354

13551355
csv, err := fetchCSV(t, crClient, subscription.Status.CurrentCSV, testNamespace, buildCSVConditionChecker(v1alpha1.CSVPhaseSucceeded))
1356+
if err != nil {
1357+
// TODO: If OLM doesn't have the subscription in its cache when it initially creates the deployment, the CSV will hang on "Installing" until it reaches the five-minute timeout, then succeed on a retry. It should be possible to skip the wait and retry immediately, but in the meantime, giving this test a little extra patience should mitigate flakes.
1358+
csv, err = fetchCSV(t, crClient, subscription.Status.CurrentCSV, testNamespace, buildCSVConditionChecker(v1alpha1.CSVPhaseSucceeded))
1359+
}
13561360
require.NoError(t, err)
13571361

13581362
proxyEnv := proxyEnvVarFunc(t, config)

0 commit comments

Comments
 (0)