Skip to content

Commit

Permalink
Add omitempty to Konflux config struct (#164)
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
  • Loading branch information
pierDipi committed Jun 18, 2024
1 parent 7515806 commit b8471d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/action/update_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func UpdateAction(cfg Config) error {

for _, r := range inConfig.Repositories {
for branchName, b := range inConfig.Config.Branches {
if b.Konflux.Enabled {
if b.Konflux != nil && b.Konflux.Enabled {

// Special case "release-next"
targetBranch := branchName
Expand Down
6 changes: 3 additions & 3 deletions pkg/prowgen/prowgen_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ type Branch struct {
OpenShiftVersions []OpenShift `json:"openShiftVersions,omitempty" yaml:"openShiftVersions,omitempty"`
SkipE2EMatches []string `json:"skipE2EMatches,omitempty" yaml:"skipE2EMatches,omitempty"`
SkipDockerFilesMatches []string `json:"skipDockerFilesMatches,omitempty" yaml:"skipDockerFilesMatches,omitempty"`
Konflux Konflux `json:"konflux,omitempty" yaml:"konflux,omitempty"`
Konflux *Konflux `json:"konflux,omitempty" yaml:"konflux,omitempty"`
}

type Konflux struct {
Enabled bool
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`

Nudges []string
Nudges []string `json:"nudges,omitempty" yaml:"nudges,omitempty"`
}

type OpenShift struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/prowgen/prowgen_konflux.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func GenerateKonflux(ctx context.Context, openshiftRelease Repository, config *C

for _, r := range config.Repositories {
for branchName, b := range config.Config.Branches {
if b.Konflux.Enabled {
if b.Konflux != nil && b.Konflux.Enabled {

if err := GitMirror(ctx, r); err != nil {
return err
Expand Down

0 comments on commit b8471d9

Please sign in to comment.