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

Provide an override on the go version for eks snaps #1581

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions jobs/build-snaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
default: ''
description: |
Snap base to use as an override while building snaps
- string:
name: eks_go_override
default: ''
description: |
Snap go version to use as an override while building snaps
MUST be in format 'go/\d+\.\d+/stable'
- string:
name: k8s_tag
default: 'v{version}'
Expand Down
6 changes: 6 additions & 0 deletions jobs/build-snaps/build-release-eks-snaps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def _find_eks_base(version, override){
}
def eks_base_override = params.eks_base_override
def EKS_BASE = _find_eks_base(kube_version, eks_base_override)
def GO_VERSION = params.eks_go_override

pipeline {
agent {
Expand Down Expand Up @@ -68,6 +69,11 @@ pipeline {
-e "s/^base: .*/base: ${EKS_BASE}/" \
-e "s/install-mode: .*/install-mode: disable/" snapcraft.yaml

# update the go version if overriden
if [ -n "${GO_VERSION}" ]; then
sed -i -e "s#go/.*#${GO_VERSION}#g" snapcraft.yaml
fi

# if we don't have any base defined at this point, add one
grep -q "^base: " snapcraft.yaml || echo "base: ${EKS_BASE}" >> snapcraft.yaml

Expand Down