Skip to content

Commit

Permalink
Bump supported K8s version
Browse files Browse the repository at this point in the history
The support policy of Weave GitOps is to "test Weave GitOps against
the latest supported Kubernetes releases" which means that only 1.26,
1.27 and 1.28 are supported at this point.

This change doesn't prevent Weave GitOps from being run on older
versions of Kubernetes as the constraint is only used by the
`gitops check` command which is purely informational.

Signed-off-by: Max Jonas Werner <mail@makk.es>
  • Loading branch information
Max Jonas Werner committed Dec 6, 2023
1 parent 53f0779 commit 0781d7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/services/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
kubernetesConstraints = ">=1.20.6-0"
kubernetesConstraints = ">=1.26"
)

// KubernetesVersion checks if the Kubernetes version of the client is recent enough and
Expand All @@ -30,5 +30,5 @@ func KubernetesVersion(c discovery.DiscoveryInterface) (string, error) {
return "", fmt.Errorf("✗ kubernetes version %s does not match %s", sv.Original(), kubernetesConstraints)
}

return fmt.Sprintf("✔ Kubernetes %s %s", sv.String(), kubernetesConstraints), nil
return fmt.Sprintf("✔ Kubernetes %s %s", sv, kubernetesConstraints), nil
}
6 changes: 3 additions & 3 deletions pkg/services/check/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ func TestKubernetesVersion(t *testing.T) {
{
name: "server version satisfies constraint",
serverVersion: "v1.28.4",
expectedRes: `✔ Kubernetes 1.28.4 >=1.20.6-0`,
expectedRes: `^✔ Kubernetes 1.28.4 >=1.`,
},
{
name: "server version too low",
serverVersion: "v1.20.5",
expectedErr: `✗ kubernetes version v1\.20\.5 does not match >=1\.20\.6-0`,
expectedErr: `✗ kubernetes version v1\.20\.5 does not match >=1\.`,
},
{
name: "server version not semver compliant",
Expand Down Expand Up @@ -72,7 +72,7 @@ func TestKubernetesVersion(t *testing.T) {
g.Expect(err).To(MatchError(MatchRegexp(tt.expectedErr)))
}

g.Expect(res).To(Equal(tt.expectedRes))
g.Expect(res).To(MatchRegexp(tt.expectedRes))
})
}
}

0 comments on commit 0781d7c

Please sign in to comment.