Skip to content

Commit b3e5e0b

Browse files
author
Mateus Oliveira
authored
fix: upgrade template (#1703)
Signed-off-by: Mateus Oliveira <[email protected]>
1 parent 76e1b87 commit b3e5e0b

File tree

5 files changed

+16
-70
lines changed

5 files changed

+16
-70
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ VERSION ?= $(DEFAULT_VERSION)
1111
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
1212
# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=candidate,fast,stable)
1313
# - use environment variables to overwrite this value (e.g export CHANNELS="candidate,fast,stable")
14-
CHANNELS = "stable"
14+
CHANNELS = "dev"
1515
ifneq ($(origin CHANNELS), undefined)
1616
BUNDLE_CHANNELS := --channels=$(CHANNELS)
1717
endif
@@ -21,7 +21,7 @@ endif
2121
# To re-generate a bundle for any other default channel without changing the default setup, you can:
2222
# - use the DEFAULT_CHANNEL as arg of the bundle target (e.g make bundle DEFAULT_CHANNEL=stable)
2323
# - use environment variables to overwrite this value (e.g export DEFAULT_CHANNEL="stable")
24-
DEFAULT_CHANNEL = "stable"
24+
DEFAULT_CHANNEL = "dev"
2525
ifneq ($(origin DEFAULT_CHANNEL), undefined)
2626
BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
2727
endif
@@ -450,9 +450,9 @@ undeploy-olm: login-required operator-sdk ## Uninstall current branch operator v
450450
$(OPERATOR_SDK) cleanup oadp-operator --namespace $(OADP_TEST_NAMESPACE)
451451

452452
# A valid Git branch from https://github.com/openshift/oadp-operator
453-
PREVIOUS_CHANNEL ?= oadp-1.4
453+
PREVIOUS_CHANNEL ?= oadp-1.5
454454
# Go version in go.mod in that branch
455-
PREVIOUS_CHANNEL_GO_VERSION ?= 1.22
455+
PREVIOUS_CHANNEL_GO_VERSION ?= 1.23
456456

457457
.PHONY: catalog-test-upgrade
458458
catalog-test-upgrade: PREVIOUS_OPERATOR_IMAGE?=ttl.sh/oadp-operator-previous-$(GIT_REV):1h

build/Dockerfile.bundle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
55
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
66
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=oadp-operator
8-
LABEL operators.operatorframework.io.bundle.channels.v1=stable
9-
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
8+
LABEL operators.operatorframework.io.bundle.channels.v1=dev
9+
LABEL operators.operatorframework.io.bundle.channel.default.v1=dev
1010
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.2
1111
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1212
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4

bundle.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
55
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
66
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=oadp-operator
8-
LABEL operators.operatorframework.io.bundle.channels.v1=stable
9-
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
8+
LABEL operators.operatorframework.io.bundle.channels.v1=dev
9+
LABEL operators.operatorframework.io.bundle.channel.default.v1=dev
1010
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.2
1111
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1212
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4

bundle/metadata/annotations.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ annotations:
44
operators.operatorframework.io.bundle.manifests.v1: manifests/
55
operators.operatorframework.io.bundle.metadata.v1: metadata/
66
operators.operatorframework.io.bundle.package.v1: oadp-operator
7-
operators.operatorframework.io.bundle.channels.v1: stable
8-
operators.operatorframework.io.bundle.channel.default.v1: stable
7+
operators.operatorframework.io.bundle.channels.v1: dev
8+
operators.operatorframework.io.bundle.channel.default.v1: dev
99
operators.operatorframework.io.metrics.builder: operator-sdk-v1.34.2
1010
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
1111
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v4

tests/e2e/upgrade_suite_test.go

Lines changed: 6 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package e2e_test
22

33
import (
44
"context"
5-
"fmt"
65
"log"
76
"time"
87

@@ -14,7 +13,6 @@ import (
1413
corev1 "k8s.io/api/core/v1"
1514
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1615
"k8s.io/apimachinery/pkg/types"
17-
"k8s.io/utils/ptr"
1816
"sigs.k8s.io/controller-runtime/pkg/client"
1917

2018
oadpv1alpha1 "github.com/openshift/oadp-operator/api/v1alpha1"
@@ -89,11 +87,6 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
8987
LogLevel: "debug",
9088
DefaultPlugins: dpaCR.VeleroDefaultPlugins,
9189
},
92-
Restic: &oadpv1alpha1.ResticConfig{
93-
NodeAgentCommonFields: oadpv1alpha1.NodeAgentCommonFields{
94-
Enable: ptr.To(true),
95-
},
96-
},
9790
},
9891
BackupLocations: []oadpv1alpha1.BackupLocation{
9992
{
@@ -128,9 +121,7 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
128121
log.Print("Checking if Velero Pod is running")
129122
gomega.Eventually(lib.VeleroPodIsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
130123

131-
// check that NodeAgent Pods are running
132-
log.Printf("Checking if Node Agent Pods are running")
133-
gomega.Eventually(lib.AreNodeAgentPodsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
124+
// TODO check NodeAgent Pod if using restic or kopia
134125

135126
// check if BSL is available
136127
log.Print("Checking if BSL is available")
@@ -142,7 +133,7 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
142133

143134
// TODO backup/restore
144135

145-
// Update spec.channel in Subscription to stable
136+
// Update spec.channel in Subscription to dev
146137
log.Print("Updating Subscription oadp-operator spec.channel")
147138
err = runTimeClientForSuiteRun.Get(context.Background(), types.NamespacedName{Namespace: subscription.Namespace, Name: subscription.Name}, &subscription)
148139
gomega.Expect(err).To(gomega.BeNil())
@@ -161,21 +152,6 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
161152
// check DPA after controller-manager Pod is running
162153
gomega.Eventually(lib.ManagerPodIsUp(kubernetesClientForSuiteRun, namespace), time.Minute*8, time.Second*15).Should(gomega.BeTrue())
163154

164-
// check if updated DPA is reconciled
165-
log.Print("Checking if DPA was reconciled after update")
166-
gomega.Eventually(dpaCR.IsReconciledFalse("Delete restic object from spec.configuration, use spec.configuration.nodeAgent instead"), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
167-
168-
log.Print("Updating DPA")
169-
dpaSpec.Configuration.Restic = nil
170-
dpaSpec.Configuration.NodeAgent = &oadpv1alpha1.NodeAgentConfig{
171-
UploaderType: "restic",
172-
NodeAgentCommonFields: oadpv1alpha1.NodeAgentCommonFields{
173-
Enable: ptr.To(true),
174-
},
175-
}
176-
err = dpaCR.CreateOrUpdate(dpaSpec)
177-
gomega.Expect(err).To(gomega.BeNil())
178-
179155
// check if updated DPA is reconciled
180156
log.Print("Checking if DPA was reconciled after update")
181157
// TODO do not use Consistently, using because no field in DPA is updated telling when it was last reconciled
@@ -189,37 +165,7 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
189165

190166
timeAfterVeleroIsRunning := time.Now()
191167

192-
// check if updated NodeAgent Pods are running
193-
log.Print("Checking if Node Agent Pods were recreated after update")
194-
gomega.Eventually(func() (bool, error) {
195-
nodeAgentDaemonSet, err := lib.GetNodeAgentDaemonSet(kubernetesClientForSuiteRun, namespace)
196-
if err != nil {
197-
return false, err
198-
}
199-
200-
numScheduled := nodeAgentDaemonSet.Status.CurrentNumberScheduled
201-
numDesired := nodeAgentDaemonSet.Status.DesiredNumberScheduled
202-
// check correct number of NodeAgent Pods are initialized
203-
if numScheduled != numDesired {
204-
return false, fmt.Errorf("wrong number of Node Agent Pods")
205-
}
206-
207-
podList, err := lib.GetAllPodsWithLabel(kubernetesClientForSuiteRun, namespace, "name=node-agent")
208-
if err != nil {
209-
return false, err
210-
}
211-
if err != nil {
212-
return false, err
213-
}
214-
for _, pod := range podList.Items {
215-
if !pod.CreationTimestamp.After(timeAfterUpgrade) {
216-
return false, fmt.Errorf("not all Node Agent Pods were updated")
217-
}
218-
}
219-
return true, nil
220-
}, time.Minute*3, time.Second*5).Should(gomega.BeTrue())
221-
log.Printf("Checking if Node Agent Pods are running")
222-
gomega.Eventually(lib.AreNodeAgentPodsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
168+
// TODO check NodeAgent Pod if using restic or kopia
223169

224170
// check if updated BSL is available
225171
log.Print("Checking if BSL was reconciled after update")
@@ -233,9 +179,9 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
233179

234180
// TODO backup/restore
235181
},
236-
ginkgo.Entry("Upgrade from stable-1.4 (oadp-1.4 branch) to stable (master branch) channel", ginkgo.Label("upgrade"), channelUpgradeCase{
237-
previous: "stable-1.4",
238-
next: "stable",
182+
ginkgo.Entry("Upgrade from stable (oadp-1.5 branch) to dev (master branch) channel", ginkgo.Label("upgrade"), channelUpgradeCase{
183+
previous: "stable",
184+
next: "dev",
239185
// to test production
240186
// production: true,
241187
}),

0 commit comments

Comments
 (0)