Skip to content

Commit

Permalink
Place workaround for kube-vip, update docs
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Squizzato <[email protected]>
  • Loading branch information
squizzi committed Nov 7, 2024
1 parent 10afcfc commit 07fe7b9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
11 changes: 10 additions & 1 deletion docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,13 @@ CSI expects single Secret with configuration in `ini` format
Options are similar to CCM and same defaults/considerations are applicable.

## Generating the airgap bundle
Use the `make airgap-package` target to manually generate the airgap bundle.
Use the `make airgap-package` target to manually generate the airgap bundle,
to ensure the correctly tagged HMC controller image is present in the bundle
prefix the `IMG` env var with the desired image, for example:

```bash
IMG="ghcr.io/mirantis/hmc:0.0.3" make airgap-package
```

Not setting an `IMG` var will use the default image name/tag generated by the
Makefile.
27 changes: 17 additions & 10 deletions scripts/bundle-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ do
exit 1
fi

if [[ $image == "localhost/hmc/controller:latest" ]]; then
# Don't try to pull and package the local controller image.
if [[ $image == *"hmc"* ]]; then
# Don't try to pull the controller image.
continue
fi

Expand Down Expand Up @@ -187,18 +187,25 @@ do
fi

# Use 'helm template' to get the images used by the extension.
template_output=$(${HELM} template --repo ${url} --version ${version} ${name} --values ${name}-values.yaml)
if [[ $? -ne 0 ]]; then
echo "Error: Failed to get images from Helm template for ${name}, trying to output values with debug..."

template_output=$(${HELM} template --repo ${url} --version ${version} ${name} --values ${name}-values.yaml --debug)
if [[ $name == "kube-vip" ]]; then
# FIXME: This is a temporary workaround for kube-vip, if we use
# a custom image tag in the future we'll need to update this.
# kube-vip is a special case where our yaml values result in invalid
# Helm template output, for now render the YAML without values.
template_output=$(${HELM} template --repo ${url} --version ${version} ${name})
else
template_output=$(${HELM} template --repo ${url} --version ${version} ${name} --values ${name}-values.yaml)
if [[ $? -ne 0 ]]; then
echo "Error: Failed to get images from Helm template for ${name} with debug output"
exit 1
echo "Error: Failed to get images from Helm template for ${name}, trying to output values with debug..."

template_output=$(${HELM} template --repo ${url} --version ${version} ${name} --values ${name}-values.yaml --debug)
if [[ $? -ne 0 ]]; then
echo "Error: Failed to get images from Helm template for ${name} with debug output"
exit 1
fi
fi
fi


for image in $(${HELM} template --repo ${url} --version ${version} ${name} --values ${name}-values.yaml | $YQ -N e .spec.template.spec.containers[].image);
do
docker pull ${image}
Expand Down

0 comments on commit 07fe7b9

Please sign in to comment.