Skip to content

Commit

Permalink
Merge pull request #4229 from twz123/kube-pre-release-constant
Browse files Browse the repository at this point in the history
Have a constant to indicate Kubernetes pre-releases
  • Loading branch information
twz123 authored Apr 11, 2024
2 parents 750e9df + 0422dcb commit 6fd781e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inttest/kubectl/kubectl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,12 @@ func checkClientVersion(t *testing.T, v map[string]any) {
}

func checkServerVersion(t *testing.T, v map[string]any) {
expectedVersion := constant.KubernetesMajorMinorVersion
if constant.KubernetesPreRelease {
expectedVersion += "+"
}
assert.Equal(t,
constant.KubernetesMajorMinorVersion,
expectedVersion,
fmt.Sprintf("%v.%v", requiredValue[string](t, v, "major"), requiredValue[string](t, v, "minor")),
)
assert.Contains(t,
Expand Down
2 changes: 2 additions & 0 deletions pkg/constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ const (

// KubernetesMajorMinorVersion defines the current embedded major.minor version info
KubernetesMajorMinorVersion = "1.29"
// Indicates if k0s is using a Kubernetes pre-release or a GA version.
KubernetesPreRelease = false

/* Image Constants */

Expand Down

0 comments on commit 6fd781e

Please sign in to comment.