Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#1088 from rabi/interface
Browse files Browse the repository at this point in the history
Drop EEJobInterface
  • Loading branch information
openshift-merge-bot[bot] authored Sep 24, 2024
2 parents e81d756 + ccf6020 commit e054da2
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 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 Expand Up @@ -231,13 +225,12 @@ func labelsForOpenStackAnsibleEE(name string, labels map[string]string) map[stri

func (a *EEJob) addEnvFrom(job *batchv1.Job) {
// Add optional config map

optional := true
job.Spec.Template.Spec.Containers[0].EnvFrom = []corev1.EnvFromSource{
{
ConfigMapRef: &corev1.ConfigMapEnvSource{
LocalObjectReference: corev1.LocalObjectReference{Name: a.EnvConfigMapName},
Optional: &(optional),
Optional: &optional,
},
},
}
Expand Down

0 comments on commit e054da2

Please sign in to comment.