mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-22 10:27:56 +00:00
change default feature gate value of IndexedJob
This commit is contained in:
@@ -160,7 +160,7 @@ func getCompletionIndex(annotations map[string]string) int {
|
||||
if annotations == nil {
|
||||
return unknownCompletionIndex
|
||||
}
|
||||
v, ok := annotations[batch.JobCompletionIndexAnnotationAlpha]
|
||||
v, ok := annotations[batch.JobCompletionIndexAnnotation]
|
||||
if !ok {
|
||||
return unknownCompletionIndex
|
||||
}
|
||||
@@ -193,7 +193,7 @@ func addCompletionIndexEnvVariable(container *v1.Container) {
|
||||
Name: completionIndexEnvName,
|
||||
ValueFrom: &v1.EnvVarSource{
|
||||
FieldRef: &v1.ObjectFieldSelector{
|
||||
FieldPath: fmt.Sprintf("metadata.annotations['%s']", batch.JobCompletionIndexAnnotationAlpha),
|
||||
FieldPath: fmt.Sprintf("metadata.annotations['%s']", batch.JobCompletionIndexAnnotation),
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -203,7 +203,7 @@ func addCompletionIndexAnnotation(template *v1.PodTemplateSpec, index int) {
|
||||
if template.Annotations == nil {
|
||||
template.Annotations = make(map[string]string, 1)
|
||||
}
|
||||
template.Annotations[batch.JobCompletionIndexAnnotationAlpha] = strconv.Itoa(index)
|
||||
template.Annotations[batch.JobCompletionIndexAnnotation] = strconv.Itoa(index)
|
||||
}
|
||||
|
||||
type byCompletionIndex []*v1.Pod
|
||||
|
@@ -249,7 +249,7 @@ func hollowPodsWithIndexPhase(descs []indexPhase) []*v1.Pod {
|
||||
}
|
||||
if desc.Index != noIndex {
|
||||
p.Annotations = map[string]string{
|
||||
batch.JobCompletionIndexAnnotationAlpha: desc.Index,
|
||||
batch.JobCompletionIndexAnnotation: desc.Index,
|
||||
}
|
||||
}
|
||||
pods = append(pods, p)
|
||||
@@ -267,7 +267,7 @@ func toIndexPhases(pods []*v1.Pod) []indexPhase {
|
||||
for i, p := range pods {
|
||||
index := noIndex
|
||||
if p.Annotations != nil {
|
||||
index = p.Annotations[batch.JobCompletionIndexAnnotationAlpha]
|
||||
index = p.Annotations[batch.JobCompletionIndexAnnotation]
|
||||
}
|
||||
result[i] = indexPhase{index, p.Status.Phase}
|
||||
}
|
||||
|
@@ -149,7 +149,7 @@ func setPodsStatusesWithIndexes(podIndexer cache.Indexer, job *batch.Job, status
|
||||
p.Status = v1.PodStatus{Phase: s.Phase}
|
||||
if s.Index != noIndex {
|
||||
p.Annotations = map[string]string{
|
||||
batch.JobCompletionIndexAnnotationAlpha: s.Index,
|
||||
batch.JobCompletionIndexAnnotation: s.Index,
|
||||
}
|
||||
}
|
||||
podIndexer.Add(p)
|
||||
@@ -2151,7 +2151,7 @@ func checkJobCompletionEnvVariable(t *testing.T, spec *v1.PodSpec) {
|
||||
Name: "JOB_COMPLETION_INDEX",
|
||||
ValueFrom: &v1.EnvVarSource{
|
||||
FieldRef: &v1.ObjectFieldSelector{
|
||||
FieldPath: fmt.Sprintf("metadata.annotations['%s']", batch.JobCompletionIndexAnnotationAlpha),
|
||||
FieldPath: fmt.Sprintf("metadata.annotations['%s']", batch.JobCompletionIndexAnnotation),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user