-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(helm): add list of container images #549
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
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 |
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 |
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" | ||||||||||||||||||||||||
Comment on lines
+64
to
+68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It requires more changes :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Less no of helm commands :). No advantage as such. |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
if [ "$EXIT_CODE" = "true" ]; then | ||||||||||||||||||||||||
git diff --exit-code "$IMAGES" | ||||||||||||||||||||||||
fi |
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}" | ||
} | ||
Comment on lines
+15
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's /scripts/utils/log.sh you could source and use log_fatal or log_error. |
||
|
||
grep_image() { | ||
local image="$1" | ||
local file="$2" | ||
|
||
grep -q "^$image$" "$file" || grep -q "^${image##docker.io/}$" "$file" | ||
niladrih marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
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 | ||
niladrih marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable analytics is not needed, the analytics code is embedded in the csi-controller image. But anyway since this is helm template should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's safer to enable all many options as we can, maybe tomorrow that can change, who knows.
Also we can enable jaeger here, just for completeness, though it's again tricky because it's operator based :(