Skip to content

Commit 0be9b58

Browse files
committed
Rename podPath to path
1 parent c47080e commit 0be9b58

19 files changed

+69
-69
lines changed

api/v1beta2/appwrapper_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ type AppWrapperPodSet struct {
5959
//+optional
6060
Replicas *int32 `json:"replicas,omitempty"`
6161

62-
// PodPath is the path Component.Template to the PodTemplateSpec for this PodSet
63-
PodPath string `json:"podPath"`
62+
// Path is the path Component.Template to the PodTemplateSpec for this PodSet
63+
Path string `json:"path"`
6464
}
6565

6666
// AppWrapperPodSetInfo contains the data that Kueue wants to inject into an admitted PodSpecTemplate

config/crd/bases/workload.codeflare.dev_appwrappers.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ spec:
134134
description: AppWrapperPodSet describes an homogeneous set
135135
of pods
136136
properties:
137-
podPath:
138-
description: PodPath is the path Component.Template to
139-
the PodTemplateSpec for this PodSet
137+
path:
138+
description: Path is the path Component.Template to the
139+
PodTemplateSpec for this PodSet
140140
type: string
141141
replicas:
142142
description: Replicas is the number of pods in this PodSet
143143
format: int32
144144
type: integer
145145
required:
146-
- podPath
146+
- path
147147
type: object
148148
type: array
149149
template:

internal/controller/appwrapper/fixtures_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func pod(milliCPU int64) workloadv1beta2.AppWrapperComponent {
107107
jsonBytes, err := yaml.YAMLToJSON([]byte(yamlString))
108108
Expect(err).NotTo(HaveOccurred())
109109
return workloadv1beta2.AppWrapperComponent{
110-
PodSets: []workloadv1beta2.AppWrapperPodSet{{Replicas: ptr.To(int32(1)), PodPath: "template"}},
110+
PodSets: []workloadv1beta2.AppWrapperPodSet{{Replicas: ptr.To(int32(1)), Path: "template"}},
111111
Template: runtime.RawExtension{Raw: jsonBytes},
112112
}
113113
}
@@ -134,7 +134,7 @@ func malformedPod(milliCPU int64) workloadv1beta2.AppWrapperComponent {
134134
jsonBytes, err := yaml.YAMLToJSON([]byte(yamlString))
135135
Expect(err).NotTo(HaveOccurred())
136136
return workloadv1beta2.AppWrapperComponent{
137-
PodSets: []workloadv1beta2.AppWrapperPodSet{{Replicas: ptr.To(int32(1)), PodPath: "template"}},
137+
PodSets: []workloadv1beta2.AppWrapperPodSet{{Replicas: ptr.To(int32(1)), Path: "template"}},
138138
Template: runtime.RawExtension{Raw: jsonBytes},
139139
}
140140
}

internal/controller/appwrapper/resource_management.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (r *AppWrapperReconciler) createComponent(ctx context.Context, aw *workload
9797
}
9898
}
9999

100-
p, err := utils.GetRawTemplate(obj.UnstructuredContent(), podSet.PodPath)
100+
p, err := utils.GetRawTemplate(obj.UnstructuredContent(), podSet.Path)
101101
if err != nil {
102102
return nil, err, true // Should not happen, path validity is enforced by validateAppWrapperInvariants
103103
}

internal/controller/workload/workload_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (aw *AppWrapper) PodSets() []kueue.PodSet {
8585
}
8686
for psIdx, podSet := range component.PodSets {
8787
replicas := utils.Replicas(podSet)
88-
if template, err := utils.GetPodTemplateSpec(obj, podSet.PodPath); err == nil {
88+
if template, err := utils.GetPodTemplateSpec(obj, podSet.Path); err == nil {
8989
podSets = append(podSets, kueue.PodSet{
9090
Name: fmt.Sprintf("%s-%v-%v", aw.Name, componentIdx, psIdx),
9191
Template: *template,

internal/webhook/appwrapper_fixtures_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func pod(milliCPU int64) workloadv1beta2.AppWrapperComponent {
8181
jsonBytes, err := yaml.YAMLToJSON([]byte(yamlString))
8282
Expect(err).NotTo(HaveOccurred())
8383
return workloadv1beta2.AppWrapperComponent{
84-
PodSets: []workloadv1beta2.AppWrapperPodSet{{PodPath: "template"}},
84+
PodSets: []workloadv1beta2.AppWrapperPodSet{{Path: "template"}},
8585
Template: runtime.RawExtension{Raw: jsonBytes},
8686
}
8787
}
@@ -111,7 +111,7 @@ func namespacedPod(namespace string, milliCPU int64) workloadv1beta2.AppWrapperC
111111
jsonBytes, err := yaml.YAMLToJSON([]byte(yamlString))
112112
Expect(err).NotTo(HaveOccurred())
113113
return workloadv1beta2.AppWrapperComponent{
114-
PodSets: []workloadv1beta2.AppWrapperPodSet{{PodPath: "template"}},
114+
PodSets: []workloadv1beta2.AppWrapperPodSet{{Path: "template"}},
115115
Template: runtime.RawExtension{Raw: jsonBytes},
116116
}
117117
}
@@ -174,7 +174,7 @@ func deployment(replicaCount int, milliCPU int64) workloadv1beta2.AppWrapperComp
174174
jsonBytes, err := yaml.YAMLToJSON([]byte(yamlString))
175175
Expect(err).NotTo(HaveOccurred())
176176
return workloadv1beta2.AppWrapperComponent{
177-
PodSets: []workloadv1beta2.AppWrapperPodSet{{Replicas: ptr.To(int32(replicaCount)), PodPath: "template.spec.template"}},
177+
PodSets: []workloadv1beta2.AppWrapperPodSet{{Replicas: ptr.To(int32(replicaCount)), Path: "template.spec.template"}},
178178
Template: runtime.RawExtension{Raw: jsonBytes},
179179
}
180180
}
@@ -364,8 +364,8 @@ func rayCluster(workerCount int, milliCPU int64) workloadv1beta2.AppWrapperCompo
364364
Expect(err).NotTo(HaveOccurred())
365365
return workloadv1beta2.AppWrapperComponent{
366366
PodSets: []workloadv1beta2.AppWrapperPodSet{
367-
{Replicas: ptr.To(int32(1)), PodPath: "template.spec.headGroupSpec.template"},
368-
{Replicas: ptr.To(int32(workerCount)), PodPath: "template.spec.workerGroupSpecs[0].template"},
367+
{Replicas: ptr.To(int32(1)), Path: "template.spec.headGroupSpec.template"},
368+
{Replicas: ptr.To(int32(workerCount)), Path: "template.spec.workerGroupSpecs[0].template"},
369369
},
370370
Template: runtime.RawExtension{Raw: jsonBytes},
371371
}
@@ -420,8 +420,8 @@ func jobSet(replicasWorker int, milliCPUWorker int64) workloadv1beta2.AppWrapper
420420
Expect(err).NotTo(HaveOccurred())
421421
return workloadv1beta2.AppWrapperComponent{
422422
PodSets: []workloadv1beta2.AppWrapperPodSet{
423-
{PodPath: "template.spec.replicatedJobs[0].template.spec.template"},
424-
{Replicas: ptr.To(int32(replicasWorker)), PodPath: "template.spec.replicatedJobs[1].template.spec.template"},
423+
{Path: "template.spec.replicatedJobs[0].template.spec.template"},
424+
{Replicas: ptr.To(int32(replicasWorker)), Path: "template.spec.replicatedJobs[1].template.spec.template"},
425425
},
426426
Template: runtime.RawExtension{Raw: jsonBytes},
427427
}

internal/webhook/appwrapper_webhook.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ func (w *AppWrapperWebhook) validateAppWrapperCreate(ctx context.Context, aw *wo
173173
podSetsPath := compPath.Child("podSets")
174174
for psIdx, ps := range component.PodSets {
175175
podSetPath := podSetsPath.Index(psIdx)
176-
if ps.PodPath == "" {
177-
allErrors = append(allErrors, field.Required(podSetPath.Child("podPath"), "podspec must specify path"))
176+
if ps.Path == "" {
177+
allErrors = append(allErrors, field.Required(podSetPath.Child("path"), "podspec must specify path"))
178178
}
179-
if _, err := utils.GetPodTemplateSpec(unstruct, ps.PodPath); err != nil {
180-
allErrors = append(allErrors, field.Invalid(podSetPath.Child("podPath"), ps.PodPath,
179+
if _, err := utils.GetPodTemplateSpec(unstruct, ps.Path); err != nil {
180+
allErrors = append(allErrors, field.Invalid(podSetPath.Child("path"), ps.Path,
181181
fmt.Sprintf("path does not refer to a v1.PodSpecTemplate: %v", err)))
182182
}
183183
podSpecCount += 1
@@ -217,8 +217,8 @@ func (w *AppWrapperWebhook) validateAppWrapperUpdate(old *workloadv1beta2.AppWra
217217
if utils.Replicas(oldComponent.PodSets[psIdx]) != utils.Replicas(newComponent.PodSets[psIdx]) {
218218
allErrors = append(allErrors, field.Forbidden(compPath.Child("podsets").Index(psIdx).Child("replicas"), msg))
219219
}
220-
if oldComponent.PodSets[psIdx].PodPath != newComponent.PodSets[psIdx].PodPath {
221-
allErrors = append(allErrors, field.Forbidden(compPath.Child("podsets").Index(psIdx).Child("podPath"), msg))
220+
if oldComponent.PodSets[psIdx].Path != newComponent.PodSets[psIdx].Path {
221+
allErrors = append(allErrors, field.Forbidden(compPath.Child("podsets").Index(psIdx).Child("path"), msg))
222222
}
223223
}
224224
}

internal/webhook/appwrapper_webhook_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,53 +60,53 @@ var _ = Describe("AppWrapper Webhook Tests", func() {
6060

6161
It("Non-existent PodSpec paths are rejected", func() {
6262
comp := deployment(4, 100)
63-
comp.PodSets[0].PodPath = "template.spec.missing"
63+
comp.PodSets[0].Path = "template.spec.missing"
6464
aw := toAppWrapper(comp)
6565
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
6666

67-
comp.PodSets[0].PodPath = ""
67+
comp.PodSets[0].Path = ""
6868
aw = toAppWrapper(comp)
6969
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
7070
})
7171

7272
It("PodSpec paths must refer to a PodSpecTemplate", func() {
7373
comp := deployment(4, 100)
74-
comp.PodSets[0].PodPath = "template.spec.template.metadata"
74+
comp.PodSets[0].Path = "template.spec.template.metadata"
7575
aw := toAppWrapper(comp)
7676
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
7777
})
7878

7979
It("Validation of Array and Map path elements", func() {
8080
comp := jobSet(2, 100)
81-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs.template.spec.template"
81+
comp.PodSets[0].Path = "template.spec.replicatedJobs.template.spec.template"
8282
aw := toAppWrapper(comp)
8383
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
8484

85-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs"
85+
comp.PodSets[0].Path = "template.spec.replicatedJobs"
8686
aw = toAppWrapper(comp)
8787
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
8888

89-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[0].template[0].spec.template"
89+
comp.PodSets[0].Path = "template.spec.replicatedJobs[0].template[0].spec.template"
9090
aw = toAppWrapper(comp)
9191
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
9292

93-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[10].template.spec.template"
93+
comp.PodSets[0].Path = "template.spec.replicatedJobs[10].template.spec.template"
9494
aw = toAppWrapper(comp)
9595
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
9696

97-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[-1].template.spec.template"
97+
comp.PodSets[0].Path = "template.spec.replicatedJobs[-1].template.spec.template"
9898
aw = toAppWrapper(comp)
9999
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
100100

101-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[a10].template.spec.template"
101+
comp.PodSets[0].Path = "template.spec.replicatedJobs[a10].template.spec.template"
102102
aw = toAppWrapper(comp)
103103
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
104104

105-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[1"
105+
comp.PodSets[0].Path = "template.spec.replicatedJobs[1"
106106
aw = toAppWrapper(comp)
107107
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
108108

109-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[1]].template.spec.template"
109+
comp.PodSets[0].Path = "template.spec.replicatedJobs[1]].template.spec.template"
110110
aw = toAppWrapper(comp)
111111
Expect(k8sClient.Create(ctx, aw)).ShouldNot(Succeed())
112112
})
@@ -161,7 +161,7 @@ var _ = Describe("AppWrapper Webhook Tests", func() {
161161
Expect(k8sClient.Update(ctx, aw)).ShouldNot(Succeed())
162162

163163
aw = getAppWrapper(awName)
164-
aw.Spec.Components[0].PodSets[0].PodPath = "bad"
164+
aw.Spec.Components[0].PodSets[0].Path = "bad"
165165
Expect(k8sClient.Update(ctx, aw)).ShouldNot(Succeed())
166166

167167
aw = getAppWrapper(awName)

samples/wrapped-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
components:
99
- podSets:
1010
- replicas: 1
11-
podPath: template.spec.template
11+
path: template.spec.template
1212
template:
1313
apiVersion: apps/v1
1414
kind: Deployment

samples/wrapped-failing-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
components:
1212
- podSets:
1313
- replicas: 1
14-
podPath: template.spec.template
14+
path: template.spec.template
1515
template:
1616
apiVersion: batch/v1
1717
kind: Job

samples/wrapped-failing-pod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
components:
1313
- podSets:
1414
- replicas: 1
15-
podPath: template
15+
path: template
1616
template:
1717
apiVersion: v1
1818
kind: Pod

samples/wrapped-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
components:
99
- podSets:
1010
- replicas: 1
11-
podPath: template.spec.template
11+
path: template.spec.template
1212
template:
1313
apiVersion: batch/v1
1414
kind: Job

samples/wrapped-pod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
components:
99
- podSets:
1010
- replicas: 1
11-
podPath: template
11+
path: template
1212
template:
1313
apiVersion: v1
1414
kind: Pod

samples/wrapped-pytorch-job.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ spec:
88
components:
99
- podSets:
1010
- replicas: 1
11-
podPath: template.spec.pytorchReplicaSpecs.Master.template
11+
path: template.spec.pytorchReplicaSpecs.Master.template
1212
- replicas: 1
13-
podPath: template.spec.pytorchReplicaSpecs.Worker.template
13+
path: template.spec.pytorchReplicaSpecs.Worker.template
1414
template:
1515
apiVersion: "kubeflow.org/v1"
1616
kind: PyTorchJob

site/_pages/appwrapper.v1beta2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ arbitrary metadata about the Component to customize its treatment by the AppWrap
126126
<p>Replicas is the number of pods in this PodSet</p>
127127
</td>
128128
</tr>
129-
<tr><td><code>podPath</code> <B>[Required]</B><br/>
129+
<tr><td><code>path</code> <B>[Required]</B><br/>
130130
<code>string</code>
131131
</td>
132132
<td>
133-
<p>PodPath is the path Component.Template to the PodTemplateSpec for this PodSet</p>
133+
<p>Path is the path Component.Template to the PodTemplateSpec for this PodSet</p>
134134
</td>
135135
</tr>
136136
</tbody>

site/_pages/sample-batch-job.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
components:
1717
- podSets:
1818
- replicas: 1
19-
podPath: template.spec.template
19+
path: template.spec.template
2020
template:
2121
apiVersion: batch/v1
2222
kind: Job

site/_pages/sample-pytorch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ spec:
1616
components:
1717
- podSets:
1818
- replicas: 1
19-
podPath: template.spec.pytorchReplicaSpecs.Master.template
19+
path: template.spec.pytorchReplicaSpecs.Master.template
2020
- replicas: 1
21-
podPath: template.spec.pytorchReplicaSpecs.Worker.template
21+
path: template.spec.pytorchReplicaSpecs.Worker.template
2222
template:
2323
apiVersion: "kubeflow.org/v1"
2424
kind: PyTorchJob

test/e2e/appwrapper_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,53 +104,53 @@ var _ = Describe("AppWrapper E2E Test", func() {
104104

105105
It("Non-existent PodSpec paths are rejected", func() {
106106
comp := deployment(4, 100)
107-
comp.PodSets[0].PodPath = "template.spec.missing"
107+
comp.PodSets[0].Path = "template.spec.missing"
108108
aw := toAppWrapper(comp)
109109
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
110110

111-
comp.PodSets[0].PodPath = ""
111+
comp.PodSets[0].Path = ""
112112
aw = toAppWrapper(comp)
113113
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
114114
})
115115

116116
It("PodSpec paths must refer to a PodSpecTemplate", func() {
117117
comp := deployment(4, 100)
118-
comp.PodSets[0].PodPath = "template.spec.template.metadata"
118+
comp.PodSets[0].Path = "template.spec.template.metadata"
119119
aw := toAppWrapper(comp)
120120
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
121121
})
122122

123123
It("Validation of Array and Map path elements", func() {
124124
comp := jobSet(2, 100)
125-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs.template.spec.template"
125+
comp.PodSets[0].Path = "template.spec.replicatedJobs.template.spec.template"
126126
aw := toAppWrapper(comp)
127127
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
128128

129-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs"
129+
comp.PodSets[0].Path = "template.spec.replicatedJobs"
130130
aw = toAppWrapper(comp)
131131
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
132132

133-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[0].template[0].spec.template"
133+
comp.PodSets[0].Path = "template.spec.replicatedJobs[0].template[0].spec.template"
134134
aw = toAppWrapper(comp)
135135
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
136136

137-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[10].template.spec.template"
137+
comp.PodSets[0].Path = "template.spec.replicatedJobs[10].template.spec.template"
138138
aw = toAppWrapper(comp)
139139
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
140140

141-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[-1].template.spec.template"
141+
comp.PodSets[0].Path = "template.spec.replicatedJobs[-1].template.spec.template"
142142
aw = toAppWrapper(comp)
143143
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
144144

145-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[a10].template.spec.template"
145+
comp.PodSets[0].Path = "template.spec.replicatedJobs[a10].template.spec.template"
146146
aw = toAppWrapper(comp)
147147
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
148148

149-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[1"
149+
comp.PodSets[0].Path = "template.spec.replicatedJobs[1"
150150
aw = toAppWrapper(comp)
151151
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
152152

153-
comp.PodSets[0].PodPath = "template.spec.replicatedJobs[1]].template.spec.template"
153+
comp.PodSets[0].Path = "template.spec.replicatedJobs[1]].template.spec.template"
154154
aw = toAppWrapper(comp)
155155
Expect(getClient(ctx).Create(ctx, aw)).ShouldNot(Succeed())
156156
})
@@ -190,7 +190,7 @@ var _ = Describe("AppWrapper E2E Test", func() {
190190
})).ShouldNot(Succeed())
191191

192192
Expect(updateAppWrapper(ctx, awName, func(aw *workloadv1beta2.AppWrapper) {
193-
aw.Spec.Components[0].PodSets[0].PodPath = "bad"
193+
aw.Spec.Components[0].PodSets[0].Path = "bad"
194194
})).ShouldNot(Succeed())
195195

196196
Expect(updateAppWrapper(ctx, awName, func(aw *workloadv1beta2.AppWrapper) {

0 commit comments

Comments
 (0)