Skip to content
Open
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
10 changes: 8 additions & 2 deletions pkg/steps/multi_stage/multi_stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,16 @@ func (s *multiStageTestStep) Requires() (ret []api.StepLink) {
}
}
if s.profile != "" {
needsReleasePayload = true
_, hasLatestRelease := s.config.Releases[api.LatestReleaseName]
hasReleaseTagConfig := s.config.ReleaseTagConfiguration != nil
if hasLatestRelease || hasReleaseTagConfig {
needsReleasePayload = true
}
for _, env := range envForProfile {
if link, ok := utils.LinkForEnv(env); ok {
ret = append(ret, link)
if hasLatestRelease || hasReleaseTagConfig {
ret = append(ret, link)
}
}
}
}
Expand Down
41 changes: 40 additions & 1 deletion pkg/steps/multi_stage/multi_stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,50 @@ func TestRequires(t *testing.T) {
leaseProxyServerAvailable bool
req []api.StepLink
}{{
name: "step has a cluster profile and requires a release image, should not have ReleaseImagesLink",
name: "step has a cluster profile with releases configured and requires a release image",
config: api.ReleaseBuildConfiguration{
InputConfiguration: api.InputConfiguration{
Releases: map[string]api.UnresolvedRelease{
api.LatestReleaseName: {Release: &api.Release{Channel: api.ReleaseChannelStable, Version: "4.20"}},
},
},
},
steps: api.MultiStageTestConfigurationLiteral{
ClusterProfile: api.ClusterProfileAWS,
Test: []api.LiteralTestStep{{From: "from-release"}},
},
req: []api.StepLink{
api.ReleasePayloadImageLink(api.LatestReleaseName),
api.ImagesReadyLink(),
},
}, {
name: "step has a cluster profile without releases configured, should not require release payload",
steps: api.MultiStageTestConfigurationLiteral{
ClusterProfile: api.ClusterProfileAWS,
Test: []api.LiteralTestStep{{From: "from-release"}},
},
req: []api.StepLink{
api.ReleaseImagesLink(api.LatestReleaseName),
},
}, {
name: "cluster profile only without releases should not require any release links",
steps: api.MultiStageTestConfigurationLiteral{
ClusterProfile: api.ClusterProfileAWS,
},
req: nil,
}, {
name: "cluster profile with tag_specification should require release payload",
config: api.ReleaseBuildConfiguration{
InputConfiguration: api.InputConfiguration{
ReleaseTagConfiguration: &api.ReleaseTagConfiguration{
Namespace: "ocp",
Name: "4.20",
},
},
},
steps: api.MultiStageTestConfigurationLiteral{
ClusterProfile: api.ClusterProfileAWS,
},
req: []api.StepLink{
api.ReleasePayloadImageLink(api.LatestReleaseName),
api.ImagesReadyLink(),
Expand Down
Loading