Skip to content

Commit

Permalink
Map the snap base core to the eks version number (#1393)
Browse files Browse the repository at this point in the history
* Map the snap base core to the eks version number

* simplify eks base logic
  • Loading branch information
addyess authored Aug 4, 2023
1 parent 9391b98 commit 3d98590
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions jobs/build-snaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
- string:
name: build_node
default: 'runner-{arch}'
- string:
name: eks_base_override
default: ''
description: |
Snap base to use as an override while building snaps
- string:
name: k8s_tag
default: 'v{version}'
Expand Down
11 changes: 10 additions & 1 deletion jobs/build-snaps/build-release-eks-snaps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
def kube_version = params.k8s_tag
def kube_ersion = kube_version.substring(1)
def lxc_name = env.JOB_NAME+"-"+env.BUILD_NUMBER
def _find_eks_base(version, override){
if (override.length())
return override

// assumes the version looks like r'v\d.\d+.\d+'
def f_version = Float.parseFloat(version.substring(1, version.lastIndexOf('.')))
return f_version >= 1.28 ? "core22" : "core20";
}
def eks_base_override = params.eks_base_override
def EKS_BASE = _find_eks_base(kube_version, eks_base_override)

pipeline {
agent {
Expand All @@ -14,7 +24,6 @@ pipeline {
environment {
PATH = "${utils.cipaths}"
CK_SNAPS = "kubectl kubelet kubernetes-test kube-proxy"
EKS_BASE = "core20"
EKS_SUFFIX = "-eks"
}
options {
Expand Down

0 comments on commit 3d98590

Please sign in to comment.