Skip to content

Commit

Permalink
Merge pull request #1709 from SaschaSchwarze0/sascha-fix-npe
Browse files Browse the repository at this point in the history
Set Build to empty object because GetBuildObject will fill but not initialize it
  • Loading branch information
openshift-merge-bot[bot] authored Oct 31, 2024
2 parents 0f53a71 + e4849d4 commit 868ee59
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/e2e/v1beta1/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,13 @@ func amendBuild(identifier string, b *buildv1beta1.Build) {

// retrieveBuildAndBuildRun will retrieve the build and buildRun
func retrieveBuildAndBuildRun(testBuild *utils.TestBuild, namespace string, buildRunName string) (*buildv1beta1.Build, *buildv1beta1.BuildRun, error) {
var build *buildv1beta1.Build

buildrun, err := testBuild.LookupBuildRun(types.NamespacedName{Name: buildRunName, Namespace: namespace})
if err != nil {
Logf("Failed to get BuildRun %q: %s", buildRunName, err)
return nil, nil, err
}

build := &buildv1beta1.Build{}
if err := resources.GetBuildObject(testBuild.Context, testBuild.ControllerRuntimeClient, buildrun, build); err != nil {
Logf("Failed to get Build from BuildRun %s: %s", buildRunName, err)
return nil, buildrun, err
Expand Down

0 comments on commit 868ee59

Please sign in to comment.