diff --git a/testing/e2e/manifests/operator.go b/testing/e2e/manifests/operator.go index 39b71aa9..46a331f0 100644 --- a/testing/e2e/manifests/operator.go +++ b/testing/e2e/manifests/operator.go @@ -25,8 +25,8 @@ var ( "app": "app-routing-operator", } - // AllOperatorVersions is a list of all the operator versions - AllOperatorVersions = []OperatorVersion{OperatorVersion0_0_3, OperatorVersionLatest} + // AllUsedOperatorVersions is a list of all the operator versions used today + AllUsedOperatorVersions = []OperatorVersion{OperatorVersion0_2_0, OperatorVersionLatest} // AllDnsZoneCounts is a list of all the dns zone counts AllDnsZoneCounts = []DnsZoneCount{DnsZoneCountNone, DnsZoneCountOne, DnsZoneCountMultiple} @@ -40,6 +40,7 @@ type OperatorVersion uint const ( OperatorVersion0_0_3 OperatorVersion = iota // use iota to number with earlier versions being lower numbers + OperatorVersion0_2_0 // OperatorVersionLatest represents the latest version of the operator which is essentially whatever code changes this test is running against OperatorVersionLatest = math.MaxUint // this must always be the last/largest value in the enum because we order by value @@ -49,6 +50,8 @@ func (o OperatorVersion) String() string { switch o { case OperatorVersion0_0_3: return "0.0.3" + case OperatorVersion0_2_0: + return "0.2.0" case OperatorVersionLatest: return "latest" default: @@ -99,6 +102,8 @@ func (o *OperatorConfig) image(latestImage string) string { switch o.Version { case OperatorVersion0_0_3: return "mcr.microsoft.com/aks/aks-app-routing-operator:0.0.3" + case OperatorVersion0_2_0: + return "mcr.microsoft.com/aks/aks-app-routing-operator:0.2.0" case OperatorVersionLatest: return latestImage default: @@ -289,7 +294,7 @@ func Operator(latestImage string, publicZones, privateZones []string, cfg *Opera baseDeployment.Spec.Template.Spec.Containers[0].VolumeMounts = nil baseDeployment.Spec.Template.Spec.Volumes = nil ret = append(ret, baseDeployment) - case OperatorVersionLatest: + default: ret = append(ret, baseDeployment) if cleanDeploy { diff --git a/testing/e2e/suites/basic.go b/testing/e2e/suites/basic.go index dd34e87b..95b44e0b 100644 --- a/testing/e2e/suites/basic.go +++ b/testing/e2e/suites/basic.go @@ -32,7 +32,7 @@ func basicSuite(in infra.Provisioned) []test { name: "basic ingress", cfgs: builderFromInfra(in). withOsm(in, false, true). - withVersions(manifests.AllOperatorVersions...). + withVersions(manifests.AllUsedOperatorVersions...). withZones(manifests.NonZeroDnsZoneCounts, manifests.NonZeroDnsZoneCounts). build(), run: func(ctx context.Context, config *rest.Config, operator manifests.OperatorConfig) error { @@ -47,7 +47,7 @@ func basicSuite(in infra.Provisioned) []test { name: "basic service", cfgs: builderFromInfra(in). withOsm(in, false, true). - withVersions(manifests.AllOperatorVersions...). + withVersions(manifests.AllUsedOperatorVersions...). withZones(manifests.NonZeroDnsZoneCounts, manifests.NonZeroDnsZoneCounts). build(), run: func(ctx context.Context, config *rest.Config, operator manifests.OperatorConfig) error { diff --git a/testing/e2e/suites/operatorConfig.go b/testing/e2e/suites/operatorConfig.go index 58e0268c..cf8cd754 100644 --- a/testing/e2e/suites/operatorConfig.go +++ b/testing/e2e/suites/operatorConfig.go @@ -26,17 +26,16 @@ type cfgBuilderWithOsm struct { } func (c cfgBuilder) withOsm(in infra.Provisioned, enabled ...bool) cfgBuilderWithOsm { - if len(enabled) == 0 { - enabled = []bool{false} - } - - osms := make([]bool, 0, len(enabled)) - osmCluster := false if _, ok := in.Cluster.GetOptions()[clients.OsmClusterOpt.Name]; ok { osmCluster = true } + if len(enabled) == 0 { + enabled = []bool{osmCluster} + } + + osms := make([]bool, 0, len(enabled)) for _, e := range enabled { // osm tests can only work if the cluster has osm installed. // filter out any enabled on clusters without osm @@ -44,6 +43,10 @@ func (c cfgBuilder) withOsm(in infra.Provisioned, enabled ...bool) cfgBuilderWit continue } + if osmCluster && !e { + continue + } + osms = append(osms, e) } diff --git a/testing/e2e/suites/osm.go b/testing/e2e/suites/osm.go index 317697e6..6b01ab42 100644 --- a/testing/e2e/suites/osm.go +++ b/testing/e2e/suites/osm.go @@ -20,7 +20,7 @@ func osmSuite(in infra.Provisioned) []test { name: "osm ingress", cfgs: builderFromInfra(in). withOsm(in, true). - withVersions(manifests.AllOperatorVersions...). + withVersions(manifests.AllUsedOperatorVersions...). withZones(manifests.AllDnsZoneCounts, manifests.AllDnsZoneCounts).build(), run: func(ctx context.Context, config *rest.Config, operator manifests.OperatorConfig) error { if err := clientServerTest(ctx, config, operator, osmNs, in, @@ -41,7 +41,7 @@ func osmSuite(in infra.Provisioned) []test { name: "osm service", cfgs: builderFromInfra(in). withOsm(in, true). - withVersions(manifests.AllOperatorVersions...). + withVersions(manifests.AllUsedOperatorVersions...). withZones(manifests.AllDnsZoneCounts, manifests.AllDnsZoneCounts).build(), run: func(ctx context.Context, config *rest.Config, operator manifests.OperatorConfig) error { if err := clientServerTest(ctx, config, operator, osmNs, in, diff --git a/testing/e2e/suites/prometheus.go b/testing/e2e/suites/prometheus.go index 624a63db..b31ad7d5 100644 --- a/testing/e2e/suites/prometheus.go +++ b/testing/e2e/suites/prometheus.go @@ -21,7 +21,7 @@ func promSuite(in infra.Provisioned) []test { name: "ingress prometheus metrics", cfgs: builderFromInfra(in). withOsm(in, false, true). - withVersions(manifests.AllOperatorVersions...). + withVersions(manifests.AllUsedOperatorVersions...). withZones(manifests.AllDnsZoneCounts, manifests.AllDnsZoneCounts). build(), run: func(ctx context.Context, config *rest.Config, operator manifests.OperatorConfig) error {