change default feature gate value of IndexedJob

This commit is contained in:
Mengxue Zhang
2021-04-26 19:59:55 +00:00
parent 5fd4ab3dc3
commit 2d2ee6bc3a
11 changed files with 27 additions and 20 deletions

View File

@@ -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

View File

@@ -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}
}

View File

@@ -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),
},
},
},