Skip to content

Commit

Permalink
Changes rock bases to bare
Browse files Browse the repository at this point in the history
The whereabouts image is supposed to install the binaries on the host
it's running on. For this, it runs a bash script, which is why we still
need a few stage packages. Note that the helm chart uses pgrep in a
readiness / liveness probe.
  • Loading branch information
claudiubelu committed Oct 23, 2024
1 parent 2fe3070 commit 5e60e42
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
8 changes: 7 additions & 1 deletion 0.5.4/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: |
license: Apache-2.0
version: 0.5.4

base: [email protected]
base: bare
build-base: [email protected]

platforms:
Expand All @@ -33,6 +33,12 @@ parts:
source-type: git
source-tag: v${CRAFT_PROJECT_VERSION}
source-depth: 1
stage-packages:
- bash
- coreutils
- sed
# Needed for pgrep, which is used as a liveness / readiness probe.
- procps
build-snaps:
- go/1.16/stable
build-environment:
Expand Down
8 changes: 7 additions & 1 deletion 0.6.1/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: |
license: Apache-2.0
version: 0.6.1

base: [email protected]
base: bare
build-base: [email protected]

platforms:
Expand All @@ -33,6 +33,12 @@ parts:
source-type: git
source-tag: v${CRAFT_PROJECT_VERSION}
source-depth: 1
stage-packages:
- bash
- coreutils
- sed
# Needed for pgrep, which is used as a liveness / readiness probe.
- procps
build-snaps:
- go/1.19/stable
build-environment:
Expand Down
8 changes: 7 additions & 1 deletion 0.6.3/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: |
license: Apache-2.0
version: 0.6.3

base: [email protected]
base: bare
build-base: [email protected]

platforms:
Expand All @@ -33,6 +33,12 @@ parts:
source-type: git
source-tag: v${CRAFT_PROJECT_VERSION}
source-depth: 1
stage-packages:
- bash
- coreutils
- sed
# Needed for pgrep, which is used as a liveness / readiness probe.
- procps
build-snaps:
- go/1.20/stable
build-environment:
Expand Down
9 changes: 3 additions & 6 deletions tests/sanity/test_whereabouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ def _test_whereabouts_rock(image_version, expected_files):
)
image = rock.image

# check rock filesystem
docker_util.ensure_image_contains_paths(image, expected_files)

# check binary name and version.
version = docker_util.get_image_version(image)
# check binary name and version (running the command will also pull the image).
process = docker_util.run_in_docker(image, ["/whereabouts", "version"])
version = docker_util.get_image_version(image)
output = process.stderr
assert "whereabouts" in output and version in output

Expand All @@ -33,7 +30,7 @@ def _test_whereabouts_rock(image_version, expected_files):
assert "KUBERNETES_SERVICE_HOST" in process.stderr

# check script. It expects serviceaccount token to exist.
process = docker_util.run_in_docker(image, ["/install-cni.sh"], False)
process = docker_util.run_in_docker(image, ["bash", "-x", "/install-cni.sh"], False)
assert (
"cat: /var/run/secrets/kubernetes.io/serviceaccount/token: No such file or directory"
in process.stderr
Expand Down

0 comments on commit 5e60e42

Please sign in to comment.