Skip to content

OCPNODE-3029: WIP: add support for required minimum kubelet version #1948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,5 @@ require (
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
)

replace github.com/openshift/api => github.com/haircommander/api v0.0.0-20250320174534-2b1af833cc45
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
github.com/haircommander/api v0.0.0-20250320174534-2b1af833cc45 h1:ivGmEOdYPR9JGyfldR2kMpaBwDMx8yaXQjmCVx0ltXk=
github.com/haircommander/api v0.0.0-20250320174534-2b1af833cc45/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
Expand Down Expand Up @@ -203,8 +205,6 @@ github.com/opencontainers/runc v1.1.13 h1:98S2srgG9vw0zWcDpFMn5TRrh8kLxa/5OFUstu
github.com/opencontainers/runc v1.1.13/go.mod h1:R016aXacfp/gwQBYw2FDGa9m+n6atbLWrYY8hNMT/sA=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/openshift/api v0.0.0-20250124212313-a770960d61e0 h1:dCvNfygMrPLVNQ06bpHXrxKfrXHiprO4+etHrRUqI8g=
github.com/openshift/api v0.0.0-20250124212313-a770960d61e0/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw=
github.com/openshift/build-machinery-go v0.0.0-20250102153059-e85a1a7ecb5c h1:6XcszPFZpan4qll5XbdLll7n1So3IsPn28aw2j1obMo=
github.com/openshift/build-machinery-go v0.0.0-20250102153059-e85a1a7ecb5c/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
github.com/openshift/client-go v0.0.0-20250125113824-8e1f0b8fa9a7 h1:4iliLcvr1P9EUMZgIaSNEKNQQzBn+L6PSequlFOuB6Q=
Expand Down
19 changes: 14 additions & 5 deletions pkg/operator/configobserver/featuregates/featuregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@ type FeatureGate interface {
Enabled(key configv1.FeatureGateName) bool
// KnownFeatures returns a slice of strings describing the FeatureGate's known features.
KnownFeatures() []configv1.FeatureGateName
// RenderedMinimumComponentVersion returns the minimum component version that caused this set of features
// to be generated.
RenderedMinimumComponentVersions() []configv1.MinimumComponentVersion
}

type featureGate struct {
enabled []configv1.FeatureGateName
disabled []configv1.FeatureGateName
enabled []configv1.FeatureGateName
disabled []configv1.FeatureGateName
renderedVersion []configv1.MinimumComponentVersion
}

func NewFeatureGate(enabled, disabled []configv1.FeatureGateName) FeatureGate {
func NewFeatureGate(enabled, disabled []configv1.FeatureGateName, renderedVersion []configv1.MinimumComponentVersion) FeatureGate {
return &featureGate{
enabled: enabled,
disabled: disabled,
enabled: enabled,
disabled: disabled,
renderedVersion: renderedVersion,
}
}

Expand All @@ -46,3 +51,7 @@ func (f *featureGate) KnownFeatures() []configv1.FeatureGateName {

return allKnown
}

func (f *featureGate) RenderedMinimumComponentVersions() []configv1.MinimumComponentVersion {
return f.renderedVersion
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ func (c *hardcodedFeatureGateAccess) AreInitialFeatureGatesObserved() bool {
}

func (c *hardcodedFeatureGateAccess) CurrentFeatureGates() (FeatureGate, error) {
return NewFeatureGate(c.enabled, c.disabled), c.readErr
// TODO FIXME not hardcoded
return NewFeatureGate(c.enabled, c.disabled, nil), c.readErr
}

// NewHardcodedFeatureGateAccessFromFeatureGate returns a FeatureGateAccess that is static and initialised from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ type FeatureGateAccess interface {
}

type Features struct {
Enabled []configv1.FeatureGateName
Disabled []configv1.FeatureGateName
Enabled []configv1.FeatureGateName
Disabled []configv1.FeatureGateName
RenderedMinimumComponentVersions []configv1.MinimumComponentVersion
}

type FeatureChange struct {
Expand Down Expand Up @@ -263,10 +264,12 @@ func (c *defaultFeatureGateAccess) CurrentFeatureGates() (FeatureGate, error) {
}
retEnabled := make([]configv1.FeatureGateName, len(c.currentFeatures.Enabled))
retDisabled := make([]configv1.FeatureGateName, len(c.currentFeatures.Disabled))
retRenderedMinimumComponentVersions := make([]configv1.MinimumComponentVersion, len(c.currentFeatures.RenderedMinimumComponentVersions))
copy(retEnabled, c.currentFeatures.Enabled)
copy(retDisabled, c.currentFeatures.Disabled)
copy(retRenderedMinimumComponentVersions, c.currentFeatures.RenderedMinimumComponentVersions)

return NewFeatureGate(retEnabled, retDisabled), nil
return NewFeatureGate(retEnabled, retDisabled, retRenderedMinimumComponentVersions), nil
}

func (c *defaultFeatureGateAccess) runWorker(ctx context.Context) {
Expand Down Expand Up @@ -308,6 +311,11 @@ func featuresFromFeatureGate(featureGate *configv1.FeatureGate, desiredVersion s
features.Disabled = append(features.Disabled, disabled.Name)
}
break
features.RenderedMinimumComponentVersions = make([]configv1.MinimumComponentVersion, 0, len(featureGateValues.RenderedMinimumComponentVersions))
for _, cv := range featureGateValues.RenderedMinimumComponentVersions {
features.RenderedMinimumComponentVersions = append(features.RenderedMinimumComponentVersions, cv)
}

}

if !found {
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/openshift/api/.golangci.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/openshift/api/Dockerfile.ocp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion vendor/github.com/openshift/api/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 1 addition & 13 deletions vendor/github.com/openshift/api/OWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion vendor/github.com/openshift/api/cloudnetwork/v1/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions vendor/github.com/openshift/api/config/v1/types_feature.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/openshift/api/config/v1/types_image.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading