Skip to content

BUG 1825349: Generation should not be a required field #1467

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

Closed
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
6 changes: 5 additions & 1 deletion deploy/chart/templates/0000_50_olm_04-installplan.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ spec:
- approval
- approved
- clusterServiceVersionNames
- generation
properties:
approval:
description: Approval is the user approval policy for an InstallPlan.
Expand Down Expand Up @@ -140,6 +139,7 @@ spec:
type: object
required:
- catalogSourceRef
- identifier
- path
- replaces
properties:
Expand Down Expand Up @@ -212,6 +212,10 @@ spec:
type:
description: Type of condition.
type: string
identifier:
description: Identifier is the catalog-unique name of the operator
(the name of the CSV for bundles that contain CSVs)
type: string
path:
description: Path refers to the location of a bundle to pull.
It's typically an image reference.
Expand Down
2 changes: 0 additions & 2 deletions manifests/0000_50_olm_04-installplan.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ spec:
- approval
- approved
- clusterServiceVersionNames
- generation
properties:
approval:
description: Approval is the user approval policy for an InstallPlan.
Expand Down Expand Up @@ -301,4 +300,3 @@ spec:
description: StepStatus is the current status of a particular
resource an in InstallPlan
type: string

2 changes: 1 addition & 1 deletion pkg/api/apis/operators/v1alpha1/installplan_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type InstallPlanSpec struct {
ClusterServiceVersionNames []string `json:"clusterServiceVersionNames"`
Approval Approval `json:"approval"`
Approved bool `json:"approved"`
Generation int `json:"generation"`
Generation int `json:"generation,omitempty"`
}

// InstallPlanPhase is the current status of a InstallPlan as a whole.
Expand Down
23 changes: 9 additions & 14 deletions test/e2e/catalog_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@ func TestCatalogImageUpdate(t *testing.T) {

// ensure registry pod is ready before attempting port-forwarding
_ = awaitPod(t, c, testNamespace, registryName, podReady)

err = registryPortForward(testNamespace)
if err != nil {
t.Fatalf("port-forwarding local registry: %s", err)
Expand Down Expand Up @@ -780,8 +779,8 @@ func TestCatalogImageUpdate(t *testing.T) {
defer cleaner.NotifyTestComplete(t, true)

sourceName := genName("catalog-")
packageName := "etcd"
channelName := "clusterwide-alpha"
packageName := "busybox"
channelName := "alpha"

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

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

// check version of running csv to ensure the latest version (0.9.2) was installed onto the cluster
v := csv.Spec.Version
etcdVersion := semver.Version{
Major: 0,
Minor: 9,
Patch: 2,
Pre: []semver.PRVersion{
{
VersionStr: "clusterwide",
},
},
busyboxVersion := semver.Version{
Major: 2,
Minor: 0,
Patch: 0,
}
if !reflect.DeepEqual(v, version.OperatorVersion{Version: etcdVersion}) {

if !reflect.DeepEqual(v, version.OperatorVersion{Version: busyboxVersion}) {
t.Errorf("latest version of operator not installed: catalog souce update failed")
}
}
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/subscription_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,10 @@ func TestCreateNewSubscriptionWithPodConfig(t *testing.T) {
require.NotNil(t, subscription)

csv, err := fetchCSV(t, crClient, subscription.Status.CurrentCSV, testNamespace, buildCSVConditionChecker(v1alpha1.CSVPhaseSucceeded))
if err != nil {
// 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.
csv, err = fetchCSV(GinkgoT(), crClient, subscription.Status.CurrentCSV, testNamespace, buildCSVConditionChecker(v1alpha1.CSVPhaseSucceeded))
}
require.NoError(t, err)

proxyEnv := proxyEnvVarFunc(t, config)
Expand Down