Merge pull request #104075 from kerthcet/cleanup/revert-dynamickubeconfig-metric

revert Bump DynamicKubeConfig metric deprecation to 1.23 by delta update
This commit is contained in:
Kubernetes Prow Robot 2021-08-05 08:18:40 -07:00 committed by GitHub
commit 3b84cc9e6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 4 deletions

View File

@ -367,7 +367,7 @@ var (
Subsystem: KubeletSubsystem, Subsystem: KubeletSubsystem,
Name: AssignedConfigKey, Name: AssignedConfigKey,
Help: "The node's understanding of intended config. The count is always 1.", Help: "The node's understanding of intended config. The count is always 1.",
DeprecatedVersion: "1.23.0", DeprecatedVersion: "1.22.0",
StabilityLevel: metrics.ALPHA, StabilityLevel: metrics.ALPHA,
}, },
[]string{ConfigSourceLabelKey, ConfigUIDLabelKey, ConfigResourceVersionLabelKey, KubeletConfigKeyLabelKey}, []string{ConfigSourceLabelKey, ConfigUIDLabelKey, ConfigResourceVersionLabelKey, KubeletConfigKeyLabelKey},
@ -378,7 +378,7 @@ var (
Subsystem: KubeletSubsystem, Subsystem: KubeletSubsystem,
Name: ActiveConfigKey, Name: ActiveConfigKey,
Help: "The config source the node is actively using. The count is always 1.", Help: "The config source the node is actively using. The count is always 1.",
DeprecatedVersion: "1.23.0", DeprecatedVersion: "1.22.0",
StabilityLevel: metrics.ALPHA, StabilityLevel: metrics.ALPHA,
}, },
[]string{ConfigSourceLabelKey, ConfigUIDLabelKey, ConfigResourceVersionLabelKey, KubeletConfigKeyLabelKey}, []string{ConfigSourceLabelKey, ConfigUIDLabelKey, ConfigResourceVersionLabelKey, KubeletConfigKeyLabelKey},
@ -390,7 +390,7 @@ var (
Subsystem: KubeletSubsystem, Subsystem: KubeletSubsystem,
Name: LastKnownGoodConfigKey, Name: LastKnownGoodConfigKey,
Help: "The config source the node will fall back to when it encounters certain errors. The count is always 1.", Help: "The config source the node will fall back to when it encounters certain errors. The count is always 1.",
DeprecatedVersion: "1.23.0", DeprecatedVersion: "1.22.0",
StabilityLevel: metrics.ALPHA, StabilityLevel: metrics.ALPHA,
}, },
[]string{ConfigSourceLabelKey, ConfigUIDLabelKey, ConfigResourceVersionLabelKey, KubeletConfigKeyLabelKey}, []string{ConfigSourceLabelKey, ConfigUIDLabelKey, ConfigResourceVersionLabelKey, KubeletConfigKeyLabelKey},
@ -401,7 +401,7 @@ var (
Subsystem: KubeletSubsystem, Subsystem: KubeletSubsystem,
Name: ConfigErrorKey, Name: ConfigErrorKey,
Help: "This metric is true (1) if the node is experiencing a configuration-related error, false (0) otherwise.", Help: "This metric is true (1) if the node is experiencing a configuration-related error, false (0) otherwise.",
DeprecatedVersion: "1.23.0", DeprecatedVersion: "1.22.0",
StabilityLevel: metrics.ALPHA, StabilityLevel: metrics.ALPHA,
}, },
) )

View File

@ -106,6 +106,10 @@ var _ = SIGDescribe("[Feature:DynamicKubeletConfig][NodeFeature:DynamicKubeletCo
framework.ExpectNoError(err) framework.ExpectNoError(err)
beforeKC = kc beforeKC = kc
} }
// show hidden metrics for release 1.22
beforeKC = updateShowHiddenMetricsForVersion(beforeKC, "1.22")
// reset the node's assigned/active/last-known-good config by setting the source to nil, // reset the node's assigned/active/last-known-good config by setting the source to nil,
// so each test starts from a clean-slate // so each test starts from a clean-slate
(&nodeConfigTestCase{ (&nodeConfigTestCase{
@ -118,6 +122,9 @@ var _ = SIGDescribe("[Feature:DynamicKubeletConfig][NodeFeature:DynamicKubeletCo
framework.ExpectNoError(err) framework.ExpectNoError(err)
localKC = kc localKC = kc
} }
// show hidden metrics for release 1.22
localKC = updateShowHiddenMetricsForVersion(localKC, "1.22")
}) })
ginkgo.AfterEach(func() { ginkgo.AfterEach(func() {
@ -1191,3 +1198,14 @@ func (tc *nodeConfigTestCase) checkConfigMetrics(f *framework.Framework) {
return nil return nil
}, timeout, interval).Should(gomega.BeNil()) }, timeout, interval).Should(gomega.BeNil())
} }
func updateShowHiddenMetricsForVersion(cfg *kubeletconfig.KubeletConfiguration, version string) *kubeletconfig.KubeletConfiguration {
if cfg == nil {
return &kubeletconfig.KubeletConfiguration{
ShowHiddenMetricsForVersion: version,
}
}
cfg.ShowHiddenMetricsForVersion = version
return cfg
}