Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
bc332ac6
Commit
bc332ac6
authored
Aug 04, 2023
by
Brad Davidson
Committed by
Brad Davidson
Aug 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'go list -m' instead of grep to look up versions
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
53fc3eef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
version.sh
scripts/version.sh
+11
-7
No files found.
scripts/version.sh
View file @
bc332ac6
...
@@ -22,40 +22,44 @@ if [ -d .git ]; then
...
@@ -22,40 +22,44 @@ if [ -d .git ]; then
fi
fi
fi
fi
VERSION_CONTAINERD
=
$(
grep
github.com/containerd/containerd go.mod |
head
-n1
|
awk
'{print $4}'
)
get-module-version
(){
go list
-m
-f
'{{if .Replace}}{{.Replace.Version}}{{else}}{{.Version}}{{end}}'
$1
}
VERSION_CONTAINERD
=
$(
get-module-version github.com/containerd/containerd
)
if
[
-z
"
$VERSION_CONTAINERD
"
]
;
then
if
[
-z
"
$VERSION_CONTAINERD
"
]
;
then
VERSION_CONTAINERD
=
"v0.0.0"
VERSION_CONTAINERD
=
"v0.0.0"
fi
fi
VERSION_CRICTL
=
$(
g
rep
github.com/kubernetes-sigs/cri-tools go.mod |
head
-n1
|
awk
'{print $4}'
)
VERSION_CRICTL
=
$(
g
et-module-version github.com/kubernetes-sigs/cri-tools
)
if
[
-z
"
$VERSION_CRICTL
"
]
;
then
if
[
-z
"
$VERSION_CRICTL
"
]
;
then
VERSION_CRICTL
=
"v0.0.0"
VERSION_CRICTL
=
"v0.0.0"
fi
fi
VERSION_K8S_K3S
=
$(
g
rep
'k8s.io/kubernetes =>'
go.mod |
head
-n1
|
awk
'{print $4}'
)
VERSION_K8S_K3S
=
$(
g
et-module-version k8s.io/kubernetes
)
VERSION_K8S
=
${
VERSION_K8S_K3S
%
"-k3s1"
}
VERSION_K8S
=
${
VERSION_K8S_K3S
%
"-k3s1"
}
if
[
-z
"
$VERSION_K8S
"
]
;
then
if
[
-z
"
$VERSION_K8S
"
]
;
then
VERSION_K8S
=
"v0.0.0"
VERSION_K8S
=
"v0.0.0"
fi
fi
VERSION_RUNC
=
$(
g
rep
github.com/opencontainers/runc go.mod |
head
-n1
|
awk
'{print $4}'
)
VERSION_RUNC
=
$(
g
et-module-version github.com/opencontainers/runc
)
if
[
-z
"
$VERSION_RUNC
"
]
;
then
if
[
-z
"
$VERSION_RUNC
"
]
;
then
VERSION_RUNC
=
"v0.0.0"
VERSION_RUNC
=
"v0.0.0"
fi
fi
VERSION_FLANNEL
=
$(
g
rep
github.com/flannel-io/flannel go.mod |
head
-n1
|
awk
'{print $2}'
)
VERSION_FLANNEL
=
$(
g
et-module-version github.com/flannel-io/flannel
)
if
[
-z
"
$VERSION_FLANNEL
"
]
;
then
if
[
-z
"
$VERSION_FLANNEL
"
]
;
then
VERSION_FLANNEL
=
"v0.0.0"
VERSION_FLANNEL
=
"v0.0.0"
fi
fi
VERSION_CRI_DOCKERD
=
$(
g
rep
github.com/Mirantis/cri-dockerd go.mod |
head
-n1
|
awk
'{print $4}'
)
VERSION_CRI_DOCKERD
=
$(
g
et-module-version github.com/Mirantis/cri-dockerd
)
if
[
-z
"
$VERSION_CRI_DOCKERD
"
]
;
then
if
[
-z
"
$VERSION_CRI_DOCKERD
"
]
;
then
VERSION_CRI_DOCKERD
=
"v0.0.0"
VERSION_CRI_DOCKERD
=
"v0.0.0"
fi
fi
VERSION_CNIPLUGINS
=
"v1.3.0-k3s1"
VERSION_CNIPLUGINS
=
"v1.3.0-k3s1"
VERSION_KUBE_ROUTER
=
$(
g
rep
github.com/k3s-io/kube-router go.mod |
head
-n1
|
awk
'{print $4}'
)
VERSION_KUBE_ROUTER
=
$(
g
et-module-version github.com/cloudnativelabs/kube-router/v2
)
if
[
-z
"
$VERSION_KUBE_ROUTER
"
]
;
then
if
[
-z
"
$VERSION_KUBE_ROUTER
"
]
;
then
VERSION_KUBE_ROUTER
=
"v0.0.0"
VERSION_KUBE_ROUTER
=
"v0.0.0"
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment