-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(helm): add list of container images
Adds a list of container images which are used by the chart. This list is contained in file: charts/images.txt Sometimes the images can't be figured out using templates, and in such cases we need to manually add them. charts/dependencies-images.txt is covering the this for the dependencies. Signed-off-by: Tiago Castro <[email protected]>
- Loading branch information
1 parent
a4ca276
commit 6d37394
Showing
7 changed files
with
184 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# localpv-provisioner | ||
# todo: we need a way to fetch this from the dependencies | ||
docker.io/openebs/linux-utils:4.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
docker.io/grafana/promtail:2.8.3 | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
docker.io/openebs/mayastor-agent-ha-node:develop | ||
docker.io/openebs/mayastor-csi-node:develop | ||
registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.0 | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
docker.io/openebs/mayastor-metrics-exporter-io-engine:develop | ||
docker.io/openebs/mayastor-io-engine:develop | ||
openebs/provisioner-localpv:4.1.0 | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
docker.io/openebs/mayastor-agent-core:develop | ||
docker.io/openebs/mayastor-agent-ha-cluster:develop | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
docker.io/openebs/mayastor-api-rest:develop | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
registry.k8s.io/sig-storage/csi-provisioner:v3.5.0 | ||
registry.k8s.io/sig-storage/csi-attacher:v4.3.0 | ||
registry.k8s.io/sig-storage/csi-snapshotter:v6.3.3 | ||
registry.k8s.io/sig-storage/snapshot-controller:v6.3.3 | ||
registry.k8s.io/sig-storage/csi-resizer:v1.9.3 | ||
docker.io/openebs/mayastor-csi-controller:develop | ||
docker.io/openebs/mayastor-obs-callhome:develop | ||
docker.io/openebs/mayastor-obs-callhome-stats:develop | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
docker.io/openebs/mayastor-operator-diskpool:develop | ||
docker.io/openebs/alpine-bash:4.1.0 | ||
docker.io/bitnami/etcd:3.5.6-debian-11-r10 | ||
docker.io/openebs/alpine-sh:4.1.0 | ||
grafana/loki:2.6.1 | ||
nats:2.9.17-alpine | ||
natsio/nats-server-config-reloader:0.10.1 | ||
natsio/prometheus-nats-exporter:0.11.0 | ||
bats/bats:1.8.2 | ||
natsio/nats-box:0.13.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,4 +99,4 @@ else | |
set +x | ||
fi | ||
|
||
kubectl get pods -n mayastor -o wide | ||
kubectl get pods -n "$K8S_NAMESPACE" -o wide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]:-"$0"}")")" | ||
ROOT_DIR="$SCRIPT_DIR/../.." | ||
CHART_DIR="$ROOT_DIR/chart" | ||
IMAGES="$CHART_DIR/images.txt" | ||
|
||
EXIT_CODE= | ||
DRY_RUN= | ||
DEP_UPDATE= | ||
HELM="helm" | ||
ENABLE_ANALYTICS="eventing.enabled=true,obs.callhome.enabled=true,obs.callhome.sendReport=true,localpv-provisioner.analytics.enabled=true" | ||
|
||
help() { | ||
cat <<EOF | ||
Usage: $(basename "$0") [COMMAND] [OPTIONS] | ||
Options: | ||
-h, --help Display this text. | ||
--exit-code Exit with error code if the images file changed ($IMAGES). | ||
--dry-run Show which commands we'd run, but don't run them. | ||
--dependency-update Run helm dependency update as the first step. | ||
Examples: | ||
$(basename "$0") | ||
EOF | ||
} | ||
|
||
echo_stderr() { | ||
echo -e "${1}" >&2 | ||
} | ||
|
||
die() { | ||
local _return="${2:-1}" | ||
echo_stderr "$1" | ||
exit "${_return}" | ||
} | ||
|
||
while [ "$#" -gt 0 ]; do | ||
case $1 in | ||
-h|--help) | ||
help | ||
exit 0 | ||
shift;; | ||
--exit-code) | ||
EXIT_CODE="true" | ||
shift;; | ||
--dry-run) | ||
DRY_RUN="true" | ||
HELM="echo $HELM" | ||
shift;; | ||
--dependency-update) | ||
DEP_UPDATE="true" | ||
shift;; | ||
*) | ||
die "Unknown argument $1!" | ||
shift;; | ||
esac | ||
done | ||
|
||
cd "$CHART_DIR" | ||
|
||
if [ "$DEP_UPDATE" = "true" ]; then | ||
$HELM dependency update | ||
fi | ||
|
||
$HELM template . --set "$ENABLE_ANALYTICS" | grep "image:" | awk '{ print $2 }' | tr -d \" > "$IMAGES" | ||
|
||
if [ "$EXIT_CODE" = "true" ]; then | ||
git diff --exit-code "$IMAGES" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
|
||
SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]:-"$0"}")")" | ||
ROOT_DIR="$SCRIPT_DIR/../.." | ||
CHART_DIR="$ROOT_DIR/chart" | ||
HELM_TPL_IMAGES="$CHART_DIR/images.txt" | ||
HELM_DEP_IMAGES="$CHART_DIR/dependencies-images.txt" | ||
TMP_KIND="/tmp/kind/mayastor" | ||
KIND_IMAGES="kind-images.txt" | ||
DOCKER="docker" | ||
|
||
echo_stderr() { | ||
echo -e "${1}" >&2 | ||
} | ||
|
||
die() { | ||
local _return="${2:-1}" | ||
echo_stderr "$1" | ||
exit "${_return}" | ||
} | ||
|
||
grep_image() { | ||
local image="$1" | ||
local file="$2" | ||
|
||
grep -q "^$image$" "$file" || grep -q "^${image##docker.io/}$" "$file" | ||
} | ||
|
||
if ! [ -f "$HELM_TPL_IMAGES" ]; then | ||
die "Missing helm template images, please generate them" | ||
fi | ||
|
||
cd "$TMP_KIND" | ||
for worker in kind-worker*; do | ||
if ! [ -f "$worker/$KIND_IMAGES" ]; then | ||
die "Missing $KIND_IMAGES file" | ||
fi | ||
|
||
curr_images=$($DOCKER exec $worker crictl image | tail -n+2 | awk '{ print $1 ":" $2 }') | ||
for image in ${curr_images[@]}; do | ||
if grep_image "$image" "$worker/$KIND_IMAGES"; then | ||
# if it's there before the install, then ignore it. | ||
continue | ||
fi | ||
if ! grep_image "$image" "$HELM_TPL_IMAGES" && ! grep_image "$image" "$HELM_DEP_IMAGES"; then | ||
echo "$image not found" | ||
fi | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters