diff --git a/config/crd/bases/getporter.org_agentconfigs.yaml b/config/crd/bases/getporter.org_agentconfigs.yaml index a833c540..a42958c8 100644 --- a/config/crd/bases/getporter.org_agentconfigs.yaml +++ b/config/crd/bases/getporter.org_agentconfigs.yaml @@ -104,6 +104,7 @@ spec: determine what the storage class will be for the volume requested type: string ttlSecondsAfterFinished: + default: 600 description: TTLSecondsAfterFinished set the time limit of the lifetime of a Job that has finished execution. format: int32 diff --git a/controllers/agentaction_controller_test.go b/controllers/agentaction_controller_test.go index 33ade450..e1256fc8 100644 --- a/controllers/agentaction_controller_test.go +++ b/controllers/agentaction_controller_test.go @@ -405,6 +405,7 @@ func TestAgentActionReconciler_createAgentVolume(t *testing.T) { } spec := porterv1.NewAgentConfigSpecAdapter(agentCfg) pvc, err := controller.createAgentVolume(context.Background(), logr.Discard(), action, spec) + require.NoError(t, err) // Verify the pvc properties @@ -412,12 +413,12 @@ func TestAgentActionReconciler_createAgentVolume(t *testing.T) { assert.Equal(t, "porter-hello-", pvc.GenerateName, "incorrect pvc name") assert.Equal(t, []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}, pvc.Spec.AccessModes, "incorrect pvc access modes") assert.Equal(t, pvc.Spec.Resources.Requests[corev1.ResourceStorage], resource.MustParse("128Mi")) + assert.Equal(t, pvc.OwnerReferences[0].Name, action.Name) } else { assert.Equal(t, "existing-", pvc.GenerateName, "incorrect pvc name") assert.Equal(t, []corev1.PersistentVolumeAccessMode{corev1.ReadWriteMany}, pvc.Spec.AccessModes, "incorrect pvc access modes") assert.Equal(t, pvc.Spec.Resources.Requests[corev1.ResourceStorage], resource.MustParse("64Mi")) } - assert.Equal(t, pvc.OwnerReferences[0].Name, action.Name) assert.Equal(t, action.Namespace, pvc.Namespace, "incorrect pvc namespace") assertSharedAgentLabels(t, pvc.Labels) assertContains(t, pvc.Labels, "testLabel", "abc123", "incorrect label")