Skip to content

Commit

Permalink
Upgrade operator versions in canary upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
kovayur committed Feb 14, 2024
1 parent 256b295 commit a8fb308
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions e2e/e2e_canary_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ const (
namespace = "rhacs"
gitopsConfigmapName = "gitops-config"
gitopsConfigmapDataKey = "config.yaml"
operatorVersion1 = "4.2.0-428-g318762a66d"
operatorVersion2 = "4.2.0-427-gd49519f172"
operatorVersion1 = "4.3.3"
operatorVersion2 = "4.3.4"
)

var (
defaultCRDUrls = []string{
"https://raw.githubusercontent.com/stackrox/stackrox/4.2.1/operator/bundle/manifests/platform.stackrox.io_securedclusters.yaml",
"https://raw.githubusercontent.com/stackrox/stackrox/4.2.1/operator/bundle/manifests/platform.stackrox.io_centrals.yaml",
"https://raw.githubusercontent.com/stackrox/stackrox/4.3.4/operator/bundle/manifests/platform.stackrox.io_securedclusters.yaml",
"https://raw.githubusercontent.com/stackrox/stackrox/4.3.4/operator/bundle/manifests/platform.stackrox.io_centrals.yaml",
}
operatorConfig1 = operatorConfigForVersion(operatorVersion1)
operatorConfig2 = operatorConfigForVersion(operatorVersion2)
Expand Down Expand Up @@ -181,9 +181,9 @@ var _ = Describe("Fleetshard-sync Targeted Upgrade", Ordered, func() {
Region: dpRegion,
}
resp, _, err := client.PublicAPI().CreateCentral(ctx, true, request)
Expect(err).To(BeNil())
Expect(err).To(Not(HaveOccurred()))
createdCentral = &resp
Expect(err).To(BeNil())
Expect(err).To(Not(HaveOccurred()))
Expect(constants.CentralRequestStatusAccepted.String()).To(Equal(createdCentral.Status))
centralNamespace, err = services.FormatNamespace(createdCentral.Id)

Expand All @@ -194,7 +194,6 @@ var _ = Describe("Fleetshard-sync Targeted Upgrade", Ordered, func() {
})

It("upgrade central", func() {
Skip("Re-enable once https://github.com/stackrox/stackrox/pull/8156 is released with ACS/StackRox 4.3")
config := gitops.Config{
RHACSOperators: operator.OperatorConfigs{
CRDURLs: defaultCRDUrls,
Expand All @@ -217,7 +216,7 @@ var _ = Describe("Fleetshard-sync Targeted Upgrade", Ordered, func() {
It("delete central", func() {
Expect(deleteCentralByID(ctx, client, createdCentral.Id)).
To(Succeed())
Eventually(assertCentralRequestDeprovisioning(ctx, client, createdCentral.Id)).
Eventually(assertCentralRequestDeleting(ctx, client, createdCentral.Id)).
WithTimeout(waitTimeout).
WithPolling(defaultPolling).
Should(Succeed())
Expand Down Expand Up @@ -404,13 +403,6 @@ func overrideAllCentralsToUseMinimalResources() gitops.CentralOverride {
return overrideAllCentralsWithPatch(minimalCentralResourcesPatch())
}

func overrideOneCentralToBeReconciledByOperator(central *public.CentralRequest, operatorConfig operator.OperatorConfig) gitops.CentralOverride {
return gitops.CentralOverride{
InstanceIDs: []string{central.Id},
Patch: reconciledByOperatorPatch(operatorConfig),
}
}

func overrideAllCentralsWithPatch(patch string) gitops.CentralOverride {
return gitops.CentralOverride{
InstanceIDs: []string{"*"},
Expand Down Expand Up @@ -492,15 +484,12 @@ metadata:
func defaultGitopsConfig() gitops.Config {
return gitops.Config{
RHACSOperators: operator.OperatorConfigs{
CRDURLs: []string{
"https://raw.githubusercontent.com/stackrox/stackrox/4.2.1/operator/bundle/manifests/platform.stackrox.io_securedclusters.yaml",
"https://raw.githubusercontent.com/stackrox/stackrox/4.2.1/operator/bundle/manifests/platform.stackrox.io_centrals.yaml",
},
CRDURLs: defaultCRDUrls,
Configs: []operator.OperatorConfig{
{
"deploymentName": "rhacs-operator-4.2.2-rc.0",
"image": "quay.io/rhacs-eng/stackrox-operator:4.2.2-rc.0",
"centralLabelSelector": "rhacs.redhat.com/version-selector=4.2.2-rc.0",
"deploymentName": "rhacs-operator-4.3.4",
"image": "quay.io/rhacs-eng/stackrox-operator:4.3.4",
"centralLabelSelector": "rhacs.redhat.com/version-selector=4.3.4",
"securedClusterReconcilerEnabled": false,
},
},
Expand All @@ -512,7 +501,7 @@ func defaultGitopsConfig() gitops.Config {
Patch: `
metadata:
labels:
rhacs.redhat.com/version-selector: "4.2.2-rc.0"`,
rhacs.redhat.com/version-selector: "4.3.4"`,
}, {
InstanceIDs: []string{"*"},
Patch: `
Expand Down

0 comments on commit a8fb308

Please sign in to comment.