From 2e3170e460db05b269b111c596a18d2859c6486a Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Tue, 3 Dec 2024 11:47:10 -0500 Subject: [PATCH] WIP --- .../configobservation/node/observe_authorization_mode.go | 7 +++++++ .../node/observe_minimum_kubelet_version.go | 3 +++ 2 files changed, 10 insertions(+) diff --git a/pkg/operator/configobservation/node/observe_authorization_mode.go b/pkg/operator/configobservation/node/observe_authorization_mode.go index d908f58b0..7c31da0bb 100644 --- a/pkg/operator/configobservation/node/observe_authorization_mode.go +++ b/pkg/operator/configobservation/node/observe_authorization_mode.go @@ -6,6 +6,7 @@ import ( "github.com/openshift/library-go/pkg/operator/configobserver/featuregates" "github.com/openshift/library-go/pkg/operator/events" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/klog/v2" ) // There are scopes authorizer tests that fail if this order is changed. @@ -41,19 +42,24 @@ func (o *authorizationModeObserver) ObserveAuthorizationMode(genericListers conf ret = configobserver.Pruned(ret, authModePath) }() + klog.Infof("XXXXX auth mode called") if !o.featureGateAccessor.AreInitialFeatureGatesObserved() { + klog.Infof("XXXXX not initialized") return existingConfig, nil } featureGates, err := o.featureGateAccessor.CurrentFeatureGates() if err != nil { + klog.Infof("XXXXX gates nil") return existingConfig, append(errs, err) } ret = map[string]interface{}{} if err := AddAuthorizationModes(ret, featureGates.Enabled(features.FeatureGateMinimumKubeletVersion)); err != nil { + klog.Infof("XXXXX auth mode failed") return existingConfig, append(errs, err) } + klog.Infof("XXXXX auth modesuccess") return ret, nil } @@ -65,6 +71,7 @@ func (o *authorizationModeObserver) ObserveAuthorizationMode(genericListers conf func AddAuthorizationModes(observedConfig map[string]interface{}, isMinimumKubeletVersionEnabled bool) error { modes := defaultAuthenticationModes if isMinimumKubeletVersionEnabled { + klog.Infof("XXXXX auth mode on") modes = append(modes, ModeMinimumKubeletVersion) } diff --git a/pkg/operator/configobservation/node/observe_minimum_kubelet_version.go b/pkg/operator/configobservation/node/observe_minimum_kubelet_version.go index 44b84695a..80679d74c 100644 --- a/pkg/operator/configobservation/node/observe_minimum_kubelet_version.go +++ b/pkg/operator/configobservation/node/observe_minimum_kubelet_version.go @@ -44,6 +44,7 @@ func (o *minimumKubeletVersionObserver) ObserveMinimumKubeletVersion(genericList } if !featureGates.Enabled(features.FeatureGateMinimumKubeletVersion) { + klog.Infof("XXXXX disabled 2") return existingConfig, nil } @@ -66,12 +67,14 @@ func (o *minimumKubeletVersionObserver) ObserveMinimumKubeletVersion(genericList // return empty set of configs, this helps to unset the config // values related to the minimumKubeletVersion. // Also, ensures that this observer doesn't break cluster upgrades/downgrades + klog.Infof("XXXXX off 2") return ret, errs } if err := unstructured.SetNestedField(ret, configNode.Spec.MinimumKubeletVersion, minimumKubeletVersionConfigPath); err != nil { return existingConfig, append(errs, err) } + klog.Infof("XXXXX set %s", configNode.Spec.MinimumKubeletVersion) return ret, errs }