Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass Run CR's timeout field as env var to the container running test suites #13

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion controllers/cnf-cert-job/cnfcertjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ type Config struct {
CertSuiteConfigRunName string
LabelsFilter string
LogLevel string
TimeOut string
ConfigMapName string
PreflightSecretName string
SideCarAppImage string
}

func NewConfig(podName, namespace, certSuiteConfigRunName, labelsFilter, logLevel, configMapName, preflightSecretName, sideCarAppImage string) *Config {
func NewConfig(podName, namespace, certSuiteConfigRunName, labelsFilter, logLevel, timeOut, configMapName, preflightSecretName, sideCarAppImage string) *Config {
return &Config{
PodName: podName,
Namespace: namespace,
CertSuiteConfigRunName: certSuiteConfigRunName,
LabelsFilter: labelsFilter,
LogLevel: logLevel,
TimeOut: timeOut,
ConfigMapName: configMapName,
PreflightSecretName: preflightSecretName,
SideCarAppImage: sideCarAppImage,
Expand Down Expand Up @@ -110,6 +112,10 @@ func New(config *Config) *corev1.Pod {
Name: "TNF_NON_INTRUSIVE_ONLY",
Value: "true",
},
{
Name: "TIMEOUT",
Value: config.TimeOut,
},
},
ImagePullPolicy: "Always",
VolumeMounts: []corev1.VolumeMount{
Expand Down
2 changes: 1 addition & 1 deletion controllers/cnfcertificationsuiterun_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ func (r *CnfCertificationSuiteRunReconciler) Reconcile(ctx context.Context, req
logrus.Infof("Reconciling CnfCertificationSuiteRun CRD.")

reqCertificationRun := certificationRun{name: req.Name, namespace: req.Namespace}

var cnfrun cnfcertificationsv1alpha1.CnfCertificationSuiteRun
if getErr := r.Get(ctx, req.NamespacedName, &cnfrun); getErr != nil {
logrus.Infof("CnfCertificationSuiteRun CR %s (ns %s) not found.", req.Name, req.NamespacedName)
Expand Down Expand Up @@ -241,6 +240,7 @@ func (r *CnfCertificationSuiteRunReconciler) Reconcile(ctx context.Context, req
cnfrun.Name,
cnfrun.Spec.LabelsFilter,
cnfrun.Spec.LogLevel,
cnfrun.Spec.TimeOut,
cnfrun.Spec.ConfigMapName,
cnfrun.Spec.PreflightSecretName,
sideCarImage)
Expand Down
Loading