Skip to content
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

tests.e2e: Install kustomize from a release tarball #402

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/e2e/ansible/install_test_deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@
ignore_errors: yes
- name: Install kustomize
shell: |
curl -s --retry 3 --retry-delay 10 -u ${USER}:${GITHUB_TOKEN} "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
cp -f ./kustomize /usr/local/bin
version=$(curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases | grep '"tag_name":' | grep "kustomize" | head -n 1 | cut -d '"' -f 4 | cut -d "/" -f 2)
arch=$(dpkg --print-architecture)
tarball="kustomize_${version}_linux_${arch}.tar.gz"
curl -Lf -o "$tarball" "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F${version}/kustomize_${version}_linux_${arch}.tar.gz"
tar -xvzf "${tarball}" -C /usr/local/bin
command -v kustomize >/dev/null 2>&1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea although it changes the behaviour from install latest master to install latest release. If we are changing the behaviour I'd probably go with pinned known-to-work version rather than potentially unstable query for the latest release. Alternatively we could first install go and then use GOBIN=$(pwd)/ GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@latest

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ldoktor ok let me try it by using your proposal...I will change the script

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw the GOBIN should be /usr/local/bin, the previous command was taken from kustomize documentation ;-)

args:
creates: /usr/local/bin/kustomize
retries: 3
Expand Down
Loading