From 39e1a0759d5cfa503ad325e470ac6075aa80b1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20St=C3=A4bler?= Date: Wed, 6 Nov 2024 14:10:21 +0100 Subject: [PATCH] Fix getting meta data --- pkg/prowgen/prowgen_konflux.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/prowgen/prowgen_konflux.go b/pkg/prowgen/prowgen_konflux.go index 0565238f..f15fe737 100644 --- a/pkg/prowgen/prowgen_konflux.go +++ b/pkg/prowgen/prowgen_konflux.go @@ -65,12 +65,6 @@ func GenerateKonflux(ctx context.Context, openshiftRelease Repository, configs [ versionLabel := soBranchName var buildArgs []string - soProjectYamlPath := filepath.Join(soRepo.RepositoryDirectory(), - "olm-catalog", "serverless-operator", "project.yaml") - soMetadata, err := project.ReadMetadataFile(soProjectYamlPath) - if err != nil { - return err - } if err := GitCheckout(ctx, soRepo, soBranchName); err != nil { if !strings.Contains(err.Error(), "failed to run git [checkout") { return err @@ -81,6 +75,13 @@ func GenerateKonflux(ctx context.Context, openshiftRelease Repository, configs [ } // For non-existent branches we keep going and use downstreamVersion for versionLabel. } else { + soProjectYamlPath := filepath.Join(soRepo.RepositoryDirectory(), + "olm-catalog", "serverless-operator", "project.yaml") + soMetadata, err := project.ReadMetadataFile(soProjectYamlPath) + if err != nil { + return err + } + versionLabel = soMetadata.Project.Version } log.Println("Version label:", versionLabel)