Skip to content

Commit c2bf0c5

Browse files
Merge pull request #1160 from rabi/cleanup_labels
Drop unnecessary labels from AEE job
2 parents 434f86f + 49297f7 commit c2bf0c5

File tree

15 files changed

+7
-271
lines changed

15 files changed

+7
-271
lines changed

apis/dataplane/v1beta1/openstackdataplanenodeset_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (instance *OpenStackDataPlaneNodeSet) InitConditions() {
197197
instance.Status.Conditions.Init(&cl)
198198
}
199199

200-
// GetAnsibleEESpec - get the fields that will be passed to AEE
200+
// GetAnsibleEESpec - get the fields that will be passed to AEE Job
201201
func (instance OpenStackDataPlaneNodeSet) GetAnsibleEESpec() AnsibleEESpec {
202202
return AnsibleEESpec{
203203
NetworkAttachments: instance.Spec.NetworkAttachments,

pkg/dataplane/util/ansibleee.go

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type EEJob struct {
2424
Playbook string `json:"playbook,omitempty"`
2525
// Image is the container image that will execute the ansible command
2626
Image string `json:"image,omitempty"`
27-
// Name is the name of the internal container inside the pod
27+
// Name is the name of the execution job
2828
Name string `json:"name,omitempty"`
2929
// Namespace - The kubernetes Namespace to create the job in
3030
Namespace string `json:"namespace,omitempty"`
@@ -67,14 +67,14 @@ type EEJob struct {
6767
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
6868
}
6969

70-
// JobForOpenStackAnsibleEE returns a openstackansibleee Job object
70+
// JobForOpenStackAnsibleEE returns a Job object
7171
func (a *EEJob) JobForOpenStackAnsibleEE(h *helper.Helper) (*batchv1.Job, error) {
7272
const (
7373
CustomPlaybook string = "playbook.yaml"
7474
CustomInventory string = "/runner/inventory/inventory.yaml"
7575
)
7676

77-
ls := labelsForOpenStackAnsibleEE(a.Name, a.Labels)
77+
ls := labelsForOpenStackAnsibleEE(a.Labels)
7878

7979
args := a.Args
8080

@@ -212,16 +212,10 @@ func (a *EEJob) JobForOpenStackAnsibleEE(h *helper.Helper) (*batchv1.Job, error)
212212
return job, nil
213213
}
214214

215-
// labelsForOpenStackAnsibleEE returns the labels for selecting the resources
216-
// belonging to the given openstackansibleee CR name.
217-
func labelsForOpenStackAnsibleEE(name string, labels map[string]string) map[string]string {
218-
const ansibleEELabel string = "openstackansibleee"
219-
215+
// labelsForOpenStackAnsibleEE returns the labels for ansible execution job.
216+
func labelsForOpenStackAnsibleEE(labels map[string]string) map[string]string {
220217
ls := map[string]string{
221-
"app": ansibleEELabel,
222-
"job-name": name,
223-
"openstackansibleee_cr": name,
224-
"osaee": "true",
218+
"app": "openstackansibleee",
225219
}
226220
for key, val := range labels {
227221
ls[key] = val

0 commit comments

Comments
 (0)