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 acdf6861 [YUNIKORN-3324] Remove pod "ignore-application" annotation
(#1055)
acdf6861 is described below
commit acdf686149dd5028d2c4f233f87a4d84319bd9cf
Author: PoiBlackTea <[email protected]>
AuthorDate: Fri Jul 24 18:18:35 2026 +0530
[YUNIKORN-3324] Remove pod "ignore-application" annotation (#1055)
Remove AnnotationIgnoreApplication constant, disableYuniKorn admission
controller logic, and related unit tests as
yunikorn.apache.org/ignore-application annotation is no longer supported.
Closes: #1055
Signed-off-by: Manikandan R <[email protected]>
---
pkg/admission/admission_controller.go | 19 -------------------
pkg/common/constants/constants.go | 3 ---
pkg/common/utils/utils_test.go | 18 ------------------
3 files changed, 40 deletions(-)
diff --git a/pkg/admission/admission_controller.go
b/pkg/admission/admission_controller.go
index c0c34326..82ee5427 100644
--- a/pkg/admission/admission_controller.go
+++ b/pkg/admission/admission_controller.go
@@ -199,8 +199,6 @@ func (c *AdmissionController) processPod(req
*admissionv1.AdmissionRequest, name
if c.shouldLabelNamespace(namespace) {
patch = c.updateLabels(namespace, &pod, patch)
patch = c.updatePreemptionInfo(&pod, patch)
- } else {
- patch = disableYuniKorn(namespace, &pod, patch)
}
log.Log(log.Admission).Info("generated patch",
zap.String("namespace", namespace),
@@ -434,23 +432,6 @@ func (c *AdmissionController) updateLabels(namespace
string, pod *v1.Pod, patch
return patch
}
-func disableYuniKorn(namespace string, pod *v1.Pod, patch
[]common.PatchOperation) []common.PatchOperation {
- log.Log(log.Admission).Info("disabling yunikorn on pod since namespace
is set to no-label",
- zap.String("podName", pod.Name),
- zap.String("generateName", pod.GenerateName),
- zap.String("namespace", namespace))
-
- result := updatePodAnnotation(pod,
constants.AnnotationIgnoreApplication, constants.True)
-
- patch = append(patch, common.PatchOperation{
- Op: "add",
- Path: "/metadata/annotations",
- Value: result,
- })
-
- return patch
-}
-
func (c *AdmissionController) validateConf(req *admissionv1.AdmissionRequest)
*admissionv1.AdmissionResponse {
if req == nil {
log.Log(log.Admission).Warn("empty request received")
diff --git a/pkg/common/constants/constants.go
b/pkg/common/constants/constants.go
index a46fac01..ca338f85 100644
--- a/pkg/common/constants/constants.go
+++ b/pkg/common/constants/constants.go
@@ -107,9 +107,6 @@ const NamespaceMaxApps = DomainYuniKorn +
"namespace.maxApps"
// AnnotationAllowPreemption set on PriorityClass, opt out of preemption for
pods with this priority class
const AnnotationAllowPreemption = DomainYuniKorn + "allow-preemption"
-// AnnotationIgnoreApplication set on Pod prevents by admission controller,
prevents YuniKorn from honoring application ID
-const AnnotationIgnoreApplication = DomainYuniKorn + "ignore-application"
-
// AnnotationGenerateAppID adds application ID to workloads in the namespace
even if not set in the admission config.
// Overrides the regexp behaviour if set, checked before the regexp is
evaluated.
// true: add an application ID label
diff --git a/pkg/common/utils/utils_test.go b/pkg/common/utils/utils_test.go
index 5b619a8f..895d0836 100644
--- a/pkg/common/utils/utils_test.go
+++ b/pkg/common/utils/utils_test.go
@@ -686,24 +686,6 @@ func TestGetApplicationIDFromPod(t *testing.T) {
},
Spec: v1.PodSpec{SchedulerName: "default"},
}, "", false},
- {"AppID defined but ignore-application set", &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Annotations: map[string]string{
- constants.AnnotationApplicationID:
appIDInAnnotation,
- constants.AnnotationIgnoreApplication:
"true",
- },
- },
- Spec: v1.PodSpec{SchedulerName:
constants.SchedulerName},
- }, appIDInAnnotation, false},
- {"AppID defined and ignore-application invalid", &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Annotations: map[string]string{
- constants.AnnotationApplicationID:
appIDInAnnotation,
- constants.AnnotationIgnoreApplication:
"invalid",
- },
- },
- Spec: v1.PodSpec{SchedulerName:
constants.SchedulerName},
- }, appIDInAnnotation, false},
}
for _, tc := range testCases {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]