Skip to content

Commit

Permalink
Drop EEInterface
Browse files Browse the repository at this point in the history
It's not used anywhere. If we've multiple structs implementing the
same methods, we can have an interface and call the methods on the
interface.

Also adds call to addEnvFrom().

Signed-off-by: rabi <[email protected]>
  • Loading branch information
rabi committed Sep 20, 2024
1 parent 26a4939 commit f414569
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 4 additions & 0 deletions pkg/dataplane/util/ansible_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ func AnsibleExecution(
return fmt.Errorf("failed to create NetworkAttachment annotation. Error: %w", err)
}

// (rabi) Add API to set this to custom values, this just
// brings compatibility to what we had before.
ansibleEE.EnvConfigMapName = "openstack-aee-default-env"

ansibleEE.BuildAeeJobSpec(aeeSpec, deployment, service, nodeSet)

ansibleEEMounts := storage.VolMounts{}
Expand Down
8 changes: 1 addition & 7 deletions pkg/dataplane/util/ansibleee.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ type EEJob struct {
Env []corev1.EnvVar `json:"env,omitempty"`
}

// EEJobInterface defines the functions required to format AnsibleEE kubernetes jobs
type EEJobInterface interface {
JobForOpenStackAnsibleEE(h *helper.Helper) (*batchv1.Job, error)
addEnvFrom(job *batchv1.Job)
addMounts(job *batchv1.Job)
}

// JobForOpenStackAnsibleEE returns a openstackansibleee Job object
func (a *EEJob) JobForOpenStackAnsibleEE(h *helper.Helper) (*batchv1.Job, error) {
const (
Expand Down Expand Up @@ -186,6 +179,7 @@ func (a *EEJob) JobForOpenStackAnsibleEE(h *helper.Helper) (*batchv1.Job, error)
}

a.addMounts(job)
a.addEnvFrom(job)

// if we have any extra vars for ansible to use set them in the RUNNER_EXTRA_VARS
if len(a.ExtraVars) > 0 {
Expand Down

0 comments on commit f414569

Please sign in to comment.