Skip to content

Commit

Permalink
Adapt acceptance tests for checking read access on run images
Browse files Browse the repository at this point in the history
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Signed-off-by: Ralf Pannemans <ralf.pannemans@sap.com>
  • Loading branch information
kulhadia and c0d1ngm0nk3y committed May 9, 2023
1 parent 3274cc2 commit 96843c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions acceptance/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func TestAnalyzer(t *testing.T) {
analyzeDaemonFixtures = analyzeTest.targetDaemon.fixtures
analyzeRegFixtures = analyzeTest.targetRegistry.fixtures

for _, platformAPI := range api.Platform.Supported {
spec.Run(t, "acceptance-analyzer/"+platformAPI.String(), testAnalyzerFunc(platformAPI.String()), spec.Parallel(), spec.Report(report.Terminal{}))
for _, platformAPI := range []string{"0.12"} {
spec.Run(t, "acceptance-analyzer/"+platformAPI, testAnalyzerFunc(platformAPI), spec.Parallel(), spec.Report(report.Terminal{}))
}
}

Expand Down Expand Up @@ -271,7 +271,7 @@ func testAnalyzerFunc(platformAPI string) func(t *testing.T, when spec.G, it spe
output, err := cmd.CombinedOutput()

h.AssertNotNil(t, err)
expected := "ensure registry read access to some-run-image-from-run-toml"
expected := "failed to find accessible run image"
h.AssertStringContains(t, string(output), expected)
})
})
Expand Down
2 changes: 1 addition & 1 deletion acceptance/creator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func testCreatorFunc(platformAPI string) func(t *testing.T, when spec.G, it spec
output, err := cmd.CombinedOutput()

h.AssertNotNil(t, err)
expected := "ensure registry read access to some-run-image-from-run-toml"
expected := "failed to resolve inputs: failed to find accessible run image"
h.AssertStringContains(t, string(output), expected)
})
})
Expand Down
5 changes: 1 addition & 4 deletions platform/resolve_inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,7 @@ func fillRunImageFromRunTOMLIfNeeded(i *LifecycleInputs, logger log.Logger) erro
return errors.New(ErrRunImageRequiredWhenNoRunMD)
}
i.RunImageRef, err = runMD.Images[0].BestRunImageMirror(targetRegistry, i.AccessChecker)
if err != nil {
return errors.New(ErrRunImageRequiredWhenNoRunMD)
}
return nil
return err
}

// fillRunImageFromStackTOMLIfNeeded updates the provided lifecycle inputs to include the run image from stack.toml if the run image input it is missing.
Expand Down

0 comments on commit 96843c8

Please sign in to comment.