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

[redhat-3.8] hpa: Do not roll out HPA for unmanage componenets (PROJQUAY-5086) #887

Open
wants to merge 1 commit into
base: redhat-3.8
Choose a base branch
from

Conversation

openshift-cherrypick-robot

This is an automated cherry-pick of #885

/assign jonathankingfc

- Only roll out HPA component for managed components
Copy link
Collaborator

@jonathankingfc jonathankingfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@arborite-rh arborite-rh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a comment that I think we can do this in one pass instead of two

Comment on lines +621 to +627
var filteredResources []client.Object
for _, resource := range resources {
if resource == nil {
continue
}
filteredResources = append(filteredResources, resource)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't we do this in one pass?

Suggested change
var filteredResources []client.Object
for _, resource := range resources {
if resource == nil {
continue
}
filteredResources = append(filteredResources, resource)
}
var filteredResources []client.Object
for _, resource := range resources {
if resource == nil {
continue
}
res, err := v1.EnsureOwnerReference(quay, resource)
if err != nil {
log.Error().Err(err).Msg(...)
continue
}
filteredResources = append(filteredResources, res)
}
return filteredResources, err

filteredResources = append(filteredResources, resource)
}

for index, resource := range filteredResources {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following the suggestion above we could delete the second loop and build our slice in the first loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants