Repository navigation
CNI Plugin Integration Test #760
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,40 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # setup.sh - Setup a calico cluster as per the instructions: | ||
| # https://k3d.io/v5.8.3/usage/advanced/calico/#1-create-the-cluster-without-flannel | ||
| # | ||
| # 1. ensure the kube config current context is set | ||
| # 2. install the calico tigera operator + poll/wait for deployment | ||
| # 3. install calico CRDs + poll/wait for availability | ||
| # 4. poll/wait for calico kube controllers and node rollout | ||
| printf '# calico/setup.sh\n' | ||
|
|
||
| kube_ctx=$(kubectl config current-context 2>/dev/null) | ||
| if [ -z "${kube_ctx}" ]; | ||
| then | ||
| printf "%s requires current context be set\n" "${BASH_SOURCE[0]}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.31.0/manifests/tigera-operator.yaml | ||
| kubectl --namespace tigera-operator rollout status --timeout=5m deploy/tigera-operator | ||
|
|
||
| until kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.31.0/manifests/custom-resources.yaml 1>/dev/null 2>&1; do | ||
| echo "retrying calico custom resources installation..." | ||
| sleep 2 | ||
| done | ||
| for resource in apiserver calico goldmane ippools whisker; do | ||
| until kubectl wait --for=condition=available --timeout=120s tigerastatus "$resource" 1>/dev/null 2>&1; do | ||
| echo "retrying tigerastatus/$resource availability check..." | ||
| sleep 2 | ||
| done | ||
| done | ||
| for rollout in deployment/calico-kube-controllers daemonset/calico-node; | ||
| do | ||
| until kubectl rollout status --namespace calico-system --timeout=2m "${rollout}" 1>/dev/null 2>&1; | ||
| do | ||
| echo "retry calico-system/${rollout} rollout check..." | ||
| sleep 2 | ||
| done | ||
| done |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why this change? Previously a missing
TEST_CTXwas handled gracefully; with this changekubectl config use-contextwill fail.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.
Looking at all of the places it was called (w/in the justfile) TEST_CTX was always provided. So the branching was not required.
It make the script simpler to understand that TEST_CTX was not optional, and we set it for the entire run.