Skip to content

Commit

Permalink
Fix ci - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
harishsurf authored and openshift-merge-bot[bot] committed Jan 19, 2024
1 parent 106d1de commit 2bc8da1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ bin
tmp
cover.out
kubeconfig
.DS_Store
.DS_Store
.vscode
.idea
9 changes: 9 additions & 0 deletions apis/quay/v1/quayregistry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,15 @@ func ComponentIsManaged(components []Component, name ComponentKind) bool {
return false
}

func ComponentIsExplicitlyDefined(components []Component, name ComponentKind) bool {
for _, c := range components {
if c.Kind == name {
return true
}
}
return false
}

// RequiredComponent returns whether the given component is required for Quay or not.
func RequiredComponent(component ComponentKind) bool {
for _, c := range requiredComponents {
Expand Down
11 changes: 10 additions & 1 deletion controllers/quay/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,18 @@ func (r *QuayRegistryReconciler) checkRoutesAvailable(
qctx.ServerHostname = fieldGroup.ServerHostname
}

// for _, c := range quay.Spec.Components {
// if c.Kind == v1.ComponentRoute {
// // return c.Managed
// fmt.Println()
// }
// }

routeExplicitlyDefined := v1.ComponentIsExplicitlyDefined(quay.Spec.Components, v1.ComponentRoute)

// If route is unmanaged, skip routes check
routeManaged := v1.ComponentIsManaged(quay.Spec.Components, v1.ComponentRoute)
if !routeManaged {
if routeExplicitlyDefined && !routeManaged {
return nil
}

Expand Down

0 comments on commit 2bc8da1

Please sign in to comment.