This is an automated email from the ASF dual-hosted git repository.
manirajv06 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-k8shim.git
The following commit(s) were added to refs/heads/master by this push:
new 0a68cb4c [YUNIKORN-3315] Remove old placeholder flags and processing
(#1056)
0a68cb4c is described below
commit 0a68cb4ce7cb3eba15c428d0981fcf708a789836
Author: PoiBlackTea <[email protected]>
AuthorDate: Fri Jul 24 18:14:36 2026 +0530
[YUNIKORN-3315] Remove old placeholder flags and processing (#1056)
Remove deprecated placeholder flags (OldLabelPlaceholderFlag and
OldAnnotationPlaceholderFlag) and their associated fallback logic in
yunikorn-k8shim.
Closes: #1056
Signed-off-by: Manikandan R <[email protected]>
---
pkg/common/constants/constants.go | 5 -----
pkg/common/utils/utils.go | 22 --------------------
pkg/common/utils/utils_test.go | 43 ---------------------------------------
3 files changed, 70 deletions(-)
diff --git a/pkg/common/constants/constants.go
b/pkg/common/constants/constants.go
index 4ebfdc56..a46fac01 100644
--- a/pkg/common/constants/constants.go
+++ b/pkg/common/constants/constants.go
@@ -77,11 +77,6 @@ const PlaceholderContainerImage = "registry.k8s.io/pause:3.7"
const PlaceholderContainerName = "pause"
const PlaceholderPodRestartPolicy = "Never"
-// Deprecated: should remove old placeholder flags in 1.7.0
-const OldLabelPlaceholderFlag = "placeholder"
-
-// Deprecated: should remove old placeholder flags in 1.7.0
-const OldAnnotationPlaceholderFlag = DomainYuniKorn + "placeholder"
const AnnotationPlaceholderFlag = DomainYuniKornInternal + "placeholder"
const AnnotationTaskGroupName = DomainYuniKorn + "task-group-name"
const AnnotationTaskGroups = DomainYuniKorn + "task-groups"
diff --git a/pkg/common/utils/utils.go b/pkg/common/utils/utils.go
index a5d5a1d1..3eecedac 100644
--- a/pkg/common/utils/utils.go
+++ b/pkg/common/utils/utils.go
@@ -421,27 +421,5 @@ func GetPlaceholderFlagFromPodSpec(pod *v1.Pod) bool {
}
}
- // Deprecated: Support for old placeholder flags should be removed in
version 1.7.0.
- if value := GetPodAnnotationValue(pod,
constants.OldAnnotationPlaceholderFlag); value != "" { // nolint:staticcheck
- if v, err := strconv.ParseBool(value); err == nil {
- log.Log(log.ShimUtils).Warn("Using deprecated
placeholder annotation. The support for old placeholder flag will be removed in
version 1.7.0",
- zap.String("podName", pod.Name),
- zap.String("annotation",
constants.OldAnnotationPlaceholderFlag), // nolint:staticcheck
- zap.String("value", value))
- return v
- }
- }
-
- // Deprecated: Support for old placeholder flags should be removed in
version 1.7.0.
- if value := GetPodLabelValue(pod, constants.OldLabelPlaceholderFlag);
value != "" { // nolint:staticcheck
- if v, err := strconv.ParseBool(value); err == nil {
- log.Log(log.ShimUtils).Warn("Using deprecated
placeholder label. The support for old placeholder flag will be removed in
version 1.7.0",
- zap.String("podName", pod.Name),
- zap.String("label",
constants.OldLabelPlaceholderFlag), // nolint:staticcheck
- zap.String("value", value))
- return v
- }
- }
-
return false
}
diff --git a/pkg/common/utils/utils_test.go b/pkg/common/utils/utils_test.go
index fb03ce9d..5b619a8f 100644
--- a/pkg/common/utils/utils_test.go
+++ b/pkg/common/utils/utils_test.go
@@ -1199,49 +1199,6 @@ func TestGetPlaceholderFlagFromPodSpec(t *testing.T) {
},
},
}, true},
- {"Setting by deprecated annotation", &v1.Pod{
- TypeMeta: metav1.TypeMeta{
- Kind: "Pod",
- APIVersion: "v1",
- },
- ObjectMeta: metav1.ObjectMeta{
- Name: "pod-01",
- UID: "UID-01",
- Annotations: map[string]string{
- constants.OldAnnotationPlaceholderFlag:
"true", // nolint:staticcheck
- },
- },
- }, true},
- {"Setting by deprecated label", &v1.Pod{
- TypeMeta: metav1.TypeMeta{
- Kind: "Pod",
- APIVersion: "v1",
- },
- ObjectMeta: metav1.ObjectMeta{
- Name: "pod-01",
- UID: "UID-01",
- Labels: map[string]string{
- constants.OldLabelPlaceholderFlag:
"true", // nolint:staticcheck
- },
- },
- }, true},
- {"Set new placeholder annotation and old placeholder
label/annotation together, new annotation has higher priority", &v1.Pod{
- TypeMeta: metav1.TypeMeta{
- Kind: "Pod",
- APIVersion: "v1",
- },
- ObjectMeta: metav1.ObjectMeta{
- Name: "pod-01",
- UID: "UID-01",
- Labels: map[string]string{
- constants.OldLabelPlaceholderFlag:
"false", // nolint:staticcheck
- },
- Annotations: map[string]string{
- constants.AnnotationPlaceholderFlag:
"true",
- constants.OldAnnotationPlaceholderFlag:
"false", // nolint:staticcheck
- },
- },
- }, true},
{"Pod without placeholder annotation", &v1.Pod{
TypeMeta: metav1.TypeMeta{
Kind: "Pod",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]