Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getting meta data #409

Merged
Merged
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
13 changes: 7 additions & 6 deletions pkg/prowgen/prowgen_konflux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Loading