Skip to content

Commit

Permalink
chore: support kube-scheduler config version
Browse files Browse the repository at this point in the history
Support kube-scheduler config version.

Signed-off-by: Noel Georgi <git@frezbo.dev>
  • Loading branch information
frezbo committed Nov 10, 2023
1 parent 68bf392 commit 1372125
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kubernetes/compatibility/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ func (v Version) FeatureFlagSeccompDefaultEnabledByDefault() bool {
// see https://github.com/kubernetes/kubernetes/pull/110805
return semver.Version(v).GTE(semver.Version{Major: 1, Minor: 25})
}

func (v Version) SupportsV1KubeSchedulerConfiguration() bool {
// see https://v1-24.docs.kubernetes.io/docs/reference/scheduling/config/
return semver.Version(v).GTE(semver.Version{Major: 1, Minor: 24})
}
4 changes: 4 additions & 0 deletions kubernetes/compatibility/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func TestFeatures(t *testing.T) {

expectedSupportsKubeletConfigContainerRuntimeEndpoint bool
expectedFeatureFlagSeccompDefaultEnabledByDefault bool
expectedSupportsV1KubeSchedulerConfiguration bool
}{
{
versions: []compatibility.Version{
Expand All @@ -26,6 +27,7 @@ func TestFeatures(t *testing.T) {

expectedSupportsKubeletConfigContainerRuntimeEndpoint: false,
expectedFeatureFlagSeccompDefaultEnabledByDefault: false,
expectedSupportsV1KubeSchedulerConfiguration: false,
},
{
versions: []compatibility.Version{
Expand All @@ -34,6 +36,7 @@ func TestFeatures(t *testing.T) {
},
expectedSupportsKubeletConfigContainerRuntimeEndpoint: false,
expectedFeatureFlagSeccompDefaultEnabledByDefault: true,
expectedSupportsV1KubeSchedulerConfiguration: true,
},
{
versions: []compatibility.Version{
Expand All @@ -44,6 +47,7 @@ func TestFeatures(t *testing.T) {
},
expectedSupportsKubeletConfigContainerRuntimeEndpoint: true,
expectedFeatureFlagSeccompDefaultEnabledByDefault: true,
expectedSupportsV1KubeSchedulerConfiguration: true,
},
} {
for _, version := range test.versions {
Expand Down

0 comments on commit 1372125

Please sign in to comment.