diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 95624b1926037..18e1a49a48a55 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -185,6 +185,7 @@ jobs: test: - cni-calico-deep - deep + - deep-native-sidecar runs-on: ubuntu-22.04 timeout-minutes: 15 steps: diff --git a/bin/_test-helpers.sh b/bin/_test-helpers.sh index 09604648bc085..1081f10efe47b 100644 --- a/bin/_test-helpers.sh +++ b/bin/_test-helpers.sh @@ -12,7 +12,7 @@ testdir="$bindir"/../test/integration ##### Test setup helpers ##### -export default_test_names=(deep viz external helm-upgrade uninstall upgrade-edge default-policy-deny rsa-ca) +export default_test_names=(deep deep-native-sidecar viz external helm-upgrade uninstall upgrade-edge default-policy-deny rsa-ca) export external_resource_test_names=(external-resources) export all_test_names=(cluster-domain cni-calico-deep multicluster "${default_test_names[*]}" "${external_resource_test_names[*]}") images_load_default=(proxy controller policy-controller web metrics-api tap) @@ -23,7 +23,7 @@ tests_usage() { Optionally specify a test with the --name flag: [${all_test_names[*]}] -Note: The cluster-domain, cni-calico-deep and multicluster tests require a custom cluster configuration (see bin/_test-helpers.sh) +Note: The cluster-domain, deep-native-sidecar cni-calico-deep and multicluster tests require a custom cluster configuration (see bin/_test-helpers.sh) Usage: ${progname} [--images docker|archive|skip] [--name test-name] [--skip-cluster-create] /path/to/linkerd @@ -444,6 +444,10 @@ run_deep_test() { run_test "$testdir/deep/..." } +run_deep-native-sidecar_test() { + run_test "$testdir/deep/..." --native-sidecar +} + run_default-policy-deny_test() { export default_inbound_policy='deny' run_test "$testdir/install/..." diff --git a/test/integration/deep/install_test.go b/test/integration/deep/install_test.go index 2124d797c5c77..d29d9fdefa9f1 100644 --- a/test/integration/deep/install_test.go +++ b/test/integration/deep/install_test.go @@ -122,6 +122,10 @@ func TestInstall(t *testing.T) { cmd = append(cmd, "--linkerd-cni-enabled") } + if TestHelper.NativeSidecar() { + cmd = append(cmd, "--set", "proxy.nativeSidecar=true") + } + // Pipe cmd & args to `linkerd` out, err = TestHelper.LinkerdRun(cmd...) if err != nil { @@ -134,5 +138,9 @@ func TestInstall(t *testing.T) { "'kubectl apply' command failed\n%s", out) } - TestHelper.WaitRollout(t, testutil.LinkerdDeployReplicasEdge) + out, err = TestHelper.LinkerdRun("check", "--wait=3m") + if err != nil { + testutil.AnnotatedFatalf(t, "'linkerd check' command failed", + "'linkerd check' command failed\n%s", out) + } } diff --git a/test/integration/viz/install_test.go b/test/integration/viz/install_test.go index e6ccd16c7917e..6c2c4ba482750 100644 --- a/test/integration/viz/install_test.go +++ b/test/integration/viz/install_test.go @@ -84,6 +84,10 @@ func TestInstallVizHA(t *testing.T) { "--ha", } + if TestHelper.NativeSidecar() { + cmd = append(cmd, "--set", "proxy.nativeSidecar=true") + } + out, err := TestHelper.LinkerdRun(cmd...) if err != nil { testutil.AnnotatedFatal(t, "'linkerd viz install' command failed", err) diff --git a/testutil/test_helper.go b/testutil/test_helper.go index 74f2d8415c18d..e19e8e233c9b9 100644 --- a/testutil/test_helper.go +++ b/testutil/test_helper.go @@ -38,6 +38,7 @@ type TestHelper struct { uninstall bool cni bool calico bool + nativeSidecar bool defaultInboundPolicy string httpClient http.Client KubernetesHelper @@ -207,6 +208,7 @@ func NewTestHelper() *TestHelper { uninstall := flag.Bool("uninstall", false, "whether to run the 'linkerd uninstall' integration test") cni := flag.Bool("cni", false, "whether to install linkerd with CNI enabled") calico := flag.Bool("calico", false, "whether to install calico CNI plugin") + nativeSidecar := flag.Bool("native-sidecar", false, "whether to install using native sidecar injection") defaultInboundPolicy := flag.String("default-inbound-policy", "", "if non-empty, passed to --set proxy.defaultInboundPolicy at linkerd's install time") flag.Parse() @@ -252,6 +254,7 @@ func NewTestHelper() *TestHelper { externalPrometheus: *externalPrometheus, cni: *cni, calico: *calico, + nativeSidecar: *nativeSidecar, uninstall: *uninstall, defaultInboundPolicy: *defaultInboundPolicy, } @@ -396,6 +399,11 @@ func (h *TestHelper) Calico() bool { return h.calico } +// NativeSidecar determines whether native sidecar injection is enabled +func (h *TestHelper) NativeSidecar() bool { + return h.nativeSidecar +} + // AddInstalledExtension adds an extension name to installedExtensions to // track the currently installed linkerd extensions. func (h *TestHelper) AddInstalledExtension(extensionName string) {