From 029c9c2e6b9fcf724dcef04610191fabd69e9966 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Tue, 10 Sep 2024 11:01:17 +0300 Subject: [PATCH] Fixes sanity tests (#12) Removes pebble from the list of files to check in sanity tests. support-bundle-kit binary doesn't have the version set in the binary, as it should. This commit addresses this issue. --- tests/sanity/test_longhorn_share_manager.py | 1 - tests/sanity/test_longhorn_ui.py | 1 - tests/sanity/test_support_bundle_kit.py | 1 - v1.7.0/support-bundle-kit/v0.0.41/rockcraft.yaml | 10 +++++----- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/sanity/test_longhorn_share_manager.py b/tests/sanity/test_longhorn_share_manager.py index b198238..43f22aa 100644 --- a/tests/sanity/test_longhorn_share_manager.py +++ b/tests/sanity/test_longhorn_share_manager.py @@ -6,7 +6,6 @@ from k8s_test_harness.util import docker_util, env_util ROCK_EXPECTED_FILES = [ - "/bin/pebble", "/etc/dbus-1/system.d/org.ganesha.nfsd.conf", "/etc/ld.so.conf.d/local_libs.conf", "/etc/mtab", diff --git a/tests/sanity/test_longhorn_ui.py b/tests/sanity/test_longhorn_ui.py index 6375fa6..05da4ad 100644 --- a/tests/sanity/test_longhorn_ui.py +++ b/tests/sanity/test_longhorn_ui.py @@ -6,7 +6,6 @@ from k8s_test_harness.util import docker_util, env_util ROCK_EXPECTED_FILES = [ - "/bin/pebble", "/etc/nginx/nginx.conf.template", "/entrypoint.sh", "/var/config/nginx", diff --git a/tests/sanity/test_support_bundle_kit.py b/tests/sanity/test_support_bundle_kit.py index 20f20c0..e5f344e 100644 --- a/tests/sanity/test_support_bundle_kit.py +++ b/tests/sanity/test_support_bundle_kit.py @@ -6,7 +6,6 @@ from k8s_test_harness.util import docker_util, env_util ROCK_EXPECTED_FILES = [ - "/bin/pebble", "/tmp/common", "/usr/bin/entrypoint.sh", "/usr/bin/collector-harvester", diff --git a/v1.7.0/support-bundle-kit/v0.0.41/rockcraft.yaml b/v1.7.0/support-bundle-kit/v0.0.41/rockcraft.yaml index 742b879..a27bd45 100644 --- a/v1.7.0/support-bundle-kit/v0.0.41/rockcraft.yaml +++ b/v1.7.0/support-bundle-kit/v0.0.41/rockcraft.yaml @@ -46,7 +46,7 @@ parts: - yq add-support-bundle-kit: - plugin: go + plugin: nil source: https://github.com/rancher/support-bundle-kit source-type: git source-tag: $CRAFT_PROJECT_VERSION @@ -58,14 +58,14 @@ parts: - GOARCH: $CRAFT_ARCH_BUILD_FOR - CGO_ENABLED: 0 - VERSION: $CRAFT_PROJECT_VERSION - go-buildtags: - - "ldflags='-extldflags -static -s -X github.com/rancher/support-bundle-kit/cmd.AppVersion=$VERSION'" organize: bin/support-bundle-kit: usr/bin/ override-build: | - craftctl default - mkdir -p "${CRAFT_PART_INSTALL}/usr/bin/" "${CRAFT_PART_INSTALL}/tmp" + + LINKFLAGS="-extldflags -static -s -X github.com/rancher/support-bundle-kit/cmd.AppVersion=$VERSION" + go build -o $CRAFT_PART_INSTALL/usr/bin/ -ldflags "$LINKFLAGS" + cp package/entrypoint.sh "${CRAFT_PART_INSTALL}/usr/bin/" cp hack/support-bundle-collector.sh hack/collector-* "${CRAFT_PART_INSTALL}/usr/bin/" cp hack/common "${CRAFT_PART_INSTALL}/tmp"