Skip to content

Commit

Permalink
fix the configuration test and removal of folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso committed May 10, 2024
1 parent 1865ec4 commit 697c798
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controllers/configuration_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func TestConfigurationReconciler(t *testing.T) {
},
{
name: "error while running configurator",
expectError: "configurator error: error while doing cascade with: processing template adjustments: unresolved nodes:\n\t(( nope ))\tin template adjustments\tadjustments.[0].value\t(adjustments.name:subst-0.value)\t*'nope' not found",
expectError: "failed to apply config ref: failed to configure resource: configurator error: error while doing cascade with: processing template ocmAdjustmentsTemplateKey: unresolved nodes:\n\t(( nope ))\tin template ocmAdjustmentsTemplateKey\tocmAdjustmentsTemplateKey.[0].value\t(ocmAdjustmentsTemplateKey.name:subst-0.value)\t*'nope' not found",
componentVersion: func() *v1alpha1.ComponentVersion {
cv := DefaultComponent.DeepCopy()
cv.Status.ObservedGeneration = 5
Expand Down Expand Up @@ -794,7 +794,7 @@ configuration:
},
},
}
for i, tt := range testCases[len(testCases)-1:] {
for i, tt := range testCases {
t.Run(fmt.Sprintf("%d: %s", i, tt.name), func(t *testing.T) {
cv := tt.componentVersion()
conditions.MarkTrue(cv, meta.ReadyCondition, meta.SucceededReason, "test")
Expand Down
2 changes: 1 addition & 1 deletion controllers/mutation_reconcile_looper.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,13 +968,13 @@ func (m *MutationReconcileLooper) mutatePatchStrategicMerge(
mutationSpec *v1alpha1.MutationSpec,
sourceData []byte,
) (string, ocmmetav1.Identity, error) {
// DO NOT Defer remove this, it will be removed once it has been tarred.
tmpDir, err := os.MkdirTemp("", "kustomization-")
if err != nil {
err = fmt.Errorf("tmp dir error: %w", err)

return "", ocmmetav1.Identity{}, err
}
defer os.RemoveAll(tmpDir)

gitSource, err := m.getSource(ctx, mutationSpec.PatchStrategicMerge.Source.SourceRef)
if err != nil {
Expand Down

0 comments on commit 697c798

Please sign in to comment.