@@ -7,13 +7,26 @@ import (
77 "testing"
88 "time"
99
10+ "github.com/Masterminds/semver/v3"
1011 "github.com/replicatedhq/embedded-cluster/e2e/cluster"
12+ "github.com/replicatedhq/embedded-cluster/pkg/versions"
1113 "github.com/stretchr/testify/require"
1214)
1315
16+ // SkipProxyTest returns true if the k0s version in use does not support
17+ // proxied environments.
18+ func SkipProxyTest () bool {
19+ supportedVersion := semver .MustParse ("1.29.0" )
20+ currentVersion := semver .MustParse (versions .K0sVersion )
21+ return currentVersion .LessThan (supportedVersion )
22+ }
23+
1424// TestProxiedEnvironment tests the installation behind a proxy server
1525func TestProxiedEnvironment (t * testing.T ) {
1626 t .Parallel ()
27+ if SkipProxyTest () {
28+ t .Skip ("skipping test for k0s versions < 1.29.0" )
29+ }
1730
1831 tc := cluster .NewTestCluster (& cluster.Input {
1932 T : t ,
@@ -125,6 +138,9 @@ func TestProxiedEnvironment(t *testing.T) {
125138// TestProxiedCustomCIDR tests the installation behind a proxy server while using a custom pod and service CIDR
126139func TestProxiedCustomCIDR (t * testing.T ) {
127140 t .Parallel ()
141+ if SkipProxyTest () {
142+ t .Skip ("skipping test for k0s versions < 1.29.0" )
143+ }
128144
129145 tc := cluster .NewTestCluster (& cluster.Input {
130146 T : t ,
@@ -244,6 +260,10 @@ func TestProxiedCustomCIDR(t *testing.T) {
244260}
245261
246262func TestInstallWithMITMProxy (t * testing.T ) {
263+ if SkipProxyTest () {
264+ t .Skip ("skipping test for k0s versions < 1.29.0" )
265+ }
266+
247267 tc := cluster .NewTestCluster (& cluster.Input {
248268 T : t ,
249269 Nodes : 4 ,
0 commit comments