diff --git a/README.md b/README.md index 20af2ddc..a54462f7 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,11 @@ This command runs the entire test suite against the minimum supported `ServiceMe #### Running against a specific Operator version -By default, maistra-test-tool assumes that the OSSM Operator version is `2.5.0` and runs tests against the `v2.3`, `v2.4`, and `v2.5` version of the ServiceMeshControlPlane. -To run against the '2.4.x' version of the Operator, run the tests with the `OPERATOR_VERSION` environment variable set to `2.4.x`. For example, for Operator version `2.4.2`, run the tests as follows: +By default, maistra-test-tool assumes that the OSSM Operator version is `2.6.0` and runs tests against the `v2.4`, `v2.5`, and `v2.6` version of the ServiceMeshControlPlane. +To run against the '2.5.x' version of the Operator, run the tests with the `OPERATOR_VERSION` environment variable set to `2.5.x`. For example, for Operator version `2.5.2`, run the tests as follows: ```console -OPERATOR_VERSION=2.4.2 make test +OPERATOR_VERSION=2.5.2 make test ``` ### Running a group of tests diff --git a/pkg/tests/tasks/extensions/threescale_wasm_plugin_test.go b/pkg/tests/tasks/extensions/threescale_wasm_plugin_test.go index ab6258d0..d56cd6af 100644 --- a/pkg/tests/tasks/extensions/threescale_wasm_plugin_test.go +++ b/pkg/tests/tasks/extensions/threescale_wasm_plugin_test.go @@ -76,7 +76,7 @@ func TestThreeScaleWasmPlugin(t *testing.T) { t.LogStep("Deploy httpbin and configure its gateway and routing") app.InstallAndWaitReady(t, app.Httpbin(ns.Foo)) - oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.4/samples/httpbin/httpbin-gateway.yaml") + oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.6/samples/httpbin/httpbin-gateway.yaml") t.LogStep("Verify that a request to the ingress gateway with token returns 200") ingressGatewayHost := istio.GetIngressGatewayHost(t, meshNamespace) diff --git a/pkg/tests/tasks/observability/federated_openshift_monitoring_test.go b/pkg/tests/tasks/observability/federated_openshift_monitoring_test.go index af60d174..820a1417 100644 --- a/pkg/tests/tasks/observability/federated_openshift_monitoring_test.go +++ b/pkg/tests/tasks/observability/federated_openshift_monitoring_test.go @@ -49,7 +49,7 @@ func TestFederatedOpenShiftMonitoring(t *testing.T) { oc.WaitAllPodsReady(t, ns.Foo) t.LogStep("Generate some ingress traffic") - oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.5/samples/httpbin/httpbin-gateway.yaml") + oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.6/samples/httpbin/httpbin-gateway.yaml") httpbinURL := fmt.Sprintf("http://%s/headers", istio.GetIngressGatewayHost(t, meshNamespace)) retry.UntilSuccess(t, func(t test.TestHelper) { curl.Request(t, httpbinURL, nil, assert.ResponseStatus(http.StatusOK)) diff --git a/pkg/tests/tasks/observability/openshift_monitoring_test.go b/pkg/tests/tasks/observability/openshift_monitoring_test.go index 403cb116..fb88bd5d 100644 --- a/pkg/tests/tasks/observability/openshift_monitoring_test.go +++ b/pkg/tests/tasks/observability/openshift_monitoring_test.go @@ -177,7 +177,7 @@ func waitKialiAndVerifyIsReconciled(t test.TestHelper) { func generateTrafficAndcheckMetrics(t test.TestHelper, thanosToken string) { t.LogStep("Generate some ingress traffic") - oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.5/samples/httpbin/httpbin-gateway.yaml") + oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.6/samples/httpbin/httpbin-gateway.yaml") httpbinURL := fmt.Sprintf("http://%s/headers", istio.GetIngressGatewayHost(t, meshNamespace)) retry.UntilSuccess(t, func(t test.TestHelper) { curl.Request(t, httpbinURL, nil, assert.ResponseStatus(http.StatusOK)) diff --git a/pkg/tests/tasks/security/certmanager/istio_csr_test.go b/pkg/tests/tasks/security/certmanager/istio_csr_test.go index 68b5ae85..5dac2fae 100644 --- a/pkg/tests/tasks/security/certmanager/istio_csr_test.go +++ b/pkg/tests/tasks/security/certmanager/istio_csr_test.go @@ -103,7 +103,7 @@ func TestIstioCsr(t *testing.T) { app.AssertSleepPodRequestSuccess(t, ns.Foo, "http://httpbin:8000/ip") t.LogStep("Check mTLS traffic from ingress gateway to httpbin") - oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.5/samples/httpbin/httpbin-gateway.yaml") + oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.6/samples/httpbin/httpbin-gateway.yaml") httpbinURL := fmt.Sprintf("http://%s/headers", istio.GetIngressGatewayHost(t, meshNamespace)) retry.UntilSuccess(t, func(t test.TestHelper) { curl.Request(t, httpbinURL, nil, assert.ResponseStatus(http.StatusOK)) diff --git a/pkg/tests/tasks/security/certmanager/plugin_ca_test.go b/pkg/tests/tasks/security/certmanager/plugin_ca_test.go index a713ab0b..d22cdbe9 100644 --- a/pkg/tests/tasks/security/certmanager/plugin_ca_test.go +++ b/pkg/tests/tasks/security/certmanager/plugin_ca_test.go @@ -80,7 +80,7 @@ func TestPluginCaCert(t *testing.T) { app.AssertSleepPodRequestSuccess(t, ns.Foo, "http://httpbin:8000/ip") t.LogStep("Check mTLS traffic from ingress gateway to httpbin") - oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.5/samples/httpbin/httpbin-gateway.yaml") + oc.ApplyFile(t, ns.Foo, "https://raw.githubusercontent.com/maistra/istio/maistra-2.6/samples/httpbin/httpbin-gateway.yaml") httpbinURL := fmt.Sprintf("http://%s/headers", istio.GetIngressGatewayHost(t, meshNamespace)) retry.UntilSuccess(t, func(t test.TestHelper) { curl.Request(t, httpbinURL, nil, assert.ResponseStatus(http.StatusOK)) diff --git a/pkg/tests/tasks/traffic/ingress/gatewayapi_test.go b/pkg/tests/tasks/traffic/ingress/gatewayapi_test.go index c99996f6..de9afea9 100644 --- a/pkg/tests/tasks/traffic/ingress/gatewayapi_test.go +++ b/pkg/tests/tasks/traffic/ingress/gatewayapi_test.go @@ -13,7 +13,6 @@ import ( "github.com/maistra/maistra-test-tool/pkg/util/oc" "github.com/maistra/maistra-test-tool/pkg/util/pod" "github.com/maistra/maistra-test-tool/pkg/util/retry" - "github.com/maistra/maistra-test-tool/pkg/util/shell" "github.com/maistra/maistra-test-tool/pkg/util/version" . "github.com/maistra/maistra-test-tool/pkg/util/test" @@ -30,8 +29,7 @@ func TestGatewayApi(t *testing.T) { ossm.DeployControlPlane(t) t.LogStep("Install Gateway API CRD's") - shell.Executef(t, "kubectl get crd gateways.gateway.networking.k8s.io &> /dev/null && echo 'Gateway API CRDs already installed' || kubectl apply -k github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=%s", - gatewayapi.GetSupportedVersion(env.GetSMCPVersion())) + gatewayapi.InstallSupportedVersion(t, env.GetSMCPVersion()) oc.CreateNamespace(t, ns.Foo) diff --git a/pkg/util/env/env.go b/pkg/util/env/env.go index 0cf86026..19f00b87 100644 --- a/pkg/util/env/env.go +++ b/pkg/util/env/env.go @@ -50,11 +50,11 @@ func GetDefaultMeshNamespace() string { } func GetSMCPVersion() version.Version { - return version.ParseVersion(getenv("SMCP_VERSION", "v2.5")) + return version.ParseVersion(getenv("SMCP_VERSION", "v2.6")) } func GetOperatorVersion() version.Version { - return version.ParseVersion(getenv("OPERATOR_VERSION", "v2.5")) + return version.ParseVersion(getenv("OPERATOR_VERSION", "v2.6")) } func GetArch() string { diff --git a/pkg/util/gatewayapi/gatewayapi.go b/pkg/util/gatewayapi/gatewayapi.go index df0c0eef..5cea5b3d 100644 --- a/pkg/util/gatewayapi/gatewayapi.go +++ b/pkg/util/gatewayapi/gatewayapi.go @@ -1,19 +1,27 @@ package gatewayapi import ( + "github.com/maistra/maistra-test-tool/pkg/util/shell" + "github.com/maistra/maistra-test-tool/pkg/util/test" "github.com/maistra/maistra-test-tool/pkg/util/version" ) -func GetSupportedVersion(smcp version.Version) string { +func InstallSupportedVersion(t test.TestHelper, smcp version.Version) { + shell.Executef(t, "kubectl get crd gateways.gateway.networking.k8s.io &> /dev/null && echo 'Gateway API CRDs already installed' || kubectl apply -k %s", getSupportedVersion(smcp)) +} + +func getSupportedVersion(smcp version.Version) string { switch smcp { case version.SMCP_2_3: - return "v0.5.1" + return "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v0.5.1" case version.SMCP_2_4: - return "v0.5.1" + return "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v0.5.1" case version.SMCP_2_5: - return "v0.6.2" + return "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v0.6.2" + case version.SMCP_2_6: + return "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v1.0.0" default: - return "v0.6.2" + return "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v1.0.0" } } @@ -25,6 +33,8 @@ func GetDefaultServiceName(smcp version.Version, gatewayName string, className s return gatewayName case version.SMCP_2_5: return gatewayName + "-" + className + case version.SMCP_2_6: + return gatewayName + "-" + className default: return gatewayName + "-" + className } @@ -38,6 +48,8 @@ func GetWaitingCondition(smcp version.Version) string { return "Ready" case version.SMCP_2_5: return "Programmed" + case version.SMCP_2_6: + return "Programmed" default: return "Programmed" } diff --git a/pkg/util/version/smcp_version.go b/pkg/util/version/smcp_version.go index 0aff78ac..246a2e60 100644 --- a/pkg/util/version/smcp_version.go +++ b/pkg/util/version/smcp_version.go @@ -7,4 +7,5 @@ var ( SMCP_2_3 = ParseVersion("v2.3") SMCP_2_4 = ParseVersion("v2.4") SMCP_2_5 = ParseVersion("v2.5") + SMCP_2_6 = ParseVersion("v2.6") ) diff --git a/scripts/runtests.sh b/scripts/runtests.sh index 2e43a526..d4440b47 100755 --- a/scripts/runtests.sh +++ b/scripts/runtests.sh @@ -2,7 +2,7 @@ set -e -OPERATOR_VERSION=${OPERATOR_VERSION:-"2.5.0"} +OPERATOR_VERSION=${OPERATOR_VERSION:-"2.6.0"} OPERATOR_VERSION="${OPERATOR_VERSION#v}" # remove "v" prefix if necessary echo "OSSM Operator version is $OPERATOR_VERSION" @@ -11,7 +11,8 @@ case "$OPERATOR_VERSION" in 2.3.*) SUPPORTED_VERSIONS=("v2.1" "v2.2" "v2.3") ;; 2.4.*) SUPPORTED_VERSIONS=("v2.2" "v2.3" "v2.4") ;; 2.5.*) SUPPORTED_VERSIONS=("v2.3" "v2.4" "v2.5") ;; - *) echo "ERROR: unknown operator version: $OPERATOR_VERSION; expect either 2.3.x, 2.4.x or 2.5.x"; exit 1 ;; + 2.6.*) SUPPORTED_VERSIONS=("v2.4" "v2.5" "v2.6") ;; + *) echo "ERROR: unknown operator version: $OPERATOR_VERSION; expect either 2.3.x, 2.4.x, 2.5.x or 2.6.x"; exit 1 ;; esac log() { diff --git a/templates/smcp-templates/v2.6/cr_2.6_default_template.yaml b/templates/smcp-templates/v2.6/cr_2.6_default_template.yaml new file mode 100644 index 00000000..c3835270 --- /dev/null +++ b/templates/smcp-templates/v2.6/cr_2.6_default_template.yaml @@ -0,0 +1,25 @@ +apiVersion: maistra.io/v2 +kind: ServiceMeshControlPlane +metadata: + name: {{ .Name }} +spec: + version: v2.6 + tracing: + type: Jaeger + sampling: 10000 + policy: + type: Istiod + addons: + grafana: + enabled: true + jaeger: + install: + storage: + type: Memory + kiali: + enabled: true + prometheus: + enabled: true + + telemetry: + type: Istiod