-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(kubernetes): update agent-sandbox to v0.5.4 #2937
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
base: main
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 |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ PRELOAD_SANDBOX_IMAGE="${HELM_K3S_PRELOAD_SANDBOX_IMAGE-${DEFAULT_SANDBOX_PRELOA | |
| # The Kubernetes driver supports the v1beta1 Sandbox API introduced in v0.5.0 | ||
| # and falls back to v1alpha1 for v0.4.6 clusters. Override this env var to | ||
| # exercise the v1alpha1 controller release. | ||
| AGENT_SANDBOX_VERSION="${AGENT_SANDBOX_VERSION:-v0.5.0}" | ||
| AGENT_SANDBOX_VERSION="${AGENT_SANDBOX_VERSION:-v0.5.4}" | ||
|
Member
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. Out of scope for this PR: Do we have thoughts on how we could better specify the default version here so that we track it consistently? |
||
|
|
||
| default_kubeconfig="${ROOT}/kubeconfig" | ||
| if [[ -n "${HELM_K3S_KUBECONFIG:-}" ]]; then | ||
|
|
@@ -142,8 +142,28 @@ merge_kubeconfig() { | |
| apply_base_manifests() { | ||
| require_kubectl | ||
| local base="https://github.com/kubernetes-sigs/agent-sandbox/releases/download/${AGENT_SANDBOX_VERSION}" | ||
| local manifest | ||
| manifest="$(agent_sandbox_manifest_asset "${AGENT_SANDBOX_VERSION}")" | ||
| echo "Applying agent-sandbox manifest (${AGENT_SANDBOX_VERSION})..." | ||
| kubectl --kubeconfig="${KUBECONFIG_TARGET}" apply -f "${base}/manifest.yaml" | ||
| kubectl --kubeconfig="${KUBECONFIG_TARGET}" apply -f "${base}/${manifest}" | ||
| } | ||
|
|
||
| agent_sandbox_manifest_asset() { | ||
| local version="${1#v}" | ||
| local major minor patch | ||
| IFS=. read -r major minor patch <<<"${version}" | ||
| patch="${patch%%[-+]*}" | ||
|
|
||
| if [[ ! "${major}" =~ ^[0-9]+$ || ! "${minor}" =~ ^[0-9]+$ || ! "${patch}" =~ ^[0-9]+$ ]]; then | ||
| echo "error: invalid Agent Sandbox release version: $1" >&2 | ||
| return 1 | ||
| fi | ||
|
|
||
| if (( 10#${major} > 0 || 10#${minor} > 5 || (10#${minor} == 5 && 10#${patch} >= 2) )); then | ||
| echo "sandbox.yaml" | ||
| else | ||
| echo "manifest.yaml" | ||
| fi | ||
| } | ||
|
Comment on lines
+151
to
167
Member
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. We're repeating the logic here. That's probably ok in the context of this change, but maybe we want to pull |
||
|
|
||
| configure_ghcr_credentials() { | ||
|
|
||
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.
Would it be simpler to just return the full URL here?
Also, would it make sense to make it clearer that we're defaulting to
sandbox.yamlinstead by inverting the conditional checks? An alternative would be to check an explicit list of versions since we're only dealing with a relatively small set here (v0.4.6,v0.5.0, andv0.5.4).