-
Notifications
You must be signed in to change notification settings - Fork 242
OCPBUGS-57627: cert-inspection: create stubs for in-memory certificates #1994
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
base: master
Are you sure you want to change the base?
Conversation
@vrutkovs: This pull request references Jira Issue OCPBUGS-57627, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
for i, pod := range podList.Items { | ||
certKeyPair := certgraphapi.CertKeyPair{ | ||
Name: fmt.Sprintf("%s-%d::1", detail.NamePrefix, i), | ||
Description: "apiserver loopback certificate", |
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.
The description is hardcoded as "apiserver loopback certificate". This limits the function's reusability. It would be better to add a Description field to the InMemoryCertDetail
struct to allow callers to provide context-specific descriptions.
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.
Good idea
list = &certgraphapi.PKIList{} | ||
} | ||
|
||
if list.InMemoryResourceData.CertKeyPairs == nil { |
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.
We checking for nil on list.InMemoryResourceData.CertKeyPairs but then initializing list.CertKeyPairs.Items. This might likely be:
if list.InMemoryResourceData.CertKeyPairs == nil {
list.InMemoryResourceData.CertKeyPairs = []certgraphapi.PKIRegistryInMemoryCertKeyPair{}
}
// and separately
if list.CertKeyPairs.Items == nil {
list.CertKeyPairs.Items = []certgraphapi.CertKeyPair{}
}
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.
Great find
Add Unit Tests The new functionality, especially in collector.go and deduplication.go, is not covered by new tests. Advice:
|
e240400
to
96400ee
Compare
We have no method to detect those, we have to create stub entries for every instance of apiserver
96400ee
to
68b8074
Compare
@vrutkovs: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vrutkovs, wangke19 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
We have no method to detect those, we have to create stub entries for every instance of apiserver.
Tested in openshift/origin#30005