-
Notifications
You must be signed in to change notification settings - Fork 83
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
base: redhat-3.8
Are you sure you want to change the base?
Conversation
- Only roll out HPA component for managed components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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
var filteredResources []client.Object | ||
for _, resource := range resources { | ||
if resource == nil { | ||
continue | ||
} | ||
filteredResources = append(filteredResources, resource) | ||
} |
There was a problem hiding this comment.
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?
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 { |
There was a problem hiding this comment.
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
This is an automated cherry-pick of #885
/assign jonathankingfc