-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix pod logs in case in case empty data from odh-ca-bundle.crt key #264
Fix pod logs in case in case empty data from odh-ca-bundle.crt key #264
Conversation
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.
Did we test this in a cluster, i feel this would result in volumemount of empty bit.
components/odh-notebook-controller/controllers/notebook_webhook.go
Outdated
Show resolved
Hide resolved
components/odh-notebook-controller/controllers/notebook_webhook.go
Outdated
Show resolved
Hide resolved
components/odh-notebook-controller/controllers/notebook_webhook.go
Outdated
Show resolved
Hide resolved
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.
On lines 301 and 316 of this file, there is following code:
if err := certValidator(cm, "odh-ca-bundle.crt", log); err == nil {
log.Info("Validating certificates for odh-ca-bundle.crt")
Do I understand correctly that by that time the validation had been done already? So shouldn't we rather say something like:
Certificates in 'odh-ca-bundle.crt' are valid and can be mounted.
Just a proposal.
I put a few comments. Basically it can be merged as is, just maybe some of them make sense so the code/logs are slightly clearer.
components/odh-notebook-controller/controllers/notebook_webhook.go
Outdated
Show resolved
Hide resolved
components/odh-notebook-controller/controllers/notebook_webhook.go
Outdated
Show resolved
Hide resolved
components/odh-notebook-controller/controllers/notebook_webhook.go
Outdated
Show resolved
Hide resolved
Thank you very much for your patience and your review! 🙂 I believe we are now in a good state. To address the scenario of empty data, I have introduced a boolean variable isEmpty to handle this situation. Now, when encountering empty data, the code will navigate to this section: https://github.com/atheo89/kubeflow/blob/RHOAIENG-4165/components/odh-notebook-controller/controllers/notebook_webhook.go#L322 @jstourac and @harshad16 could you take a look? |
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.
Thank you LGTM and if it really behaves like described in the description, I love it 😍
Yeah, I updated the description as well! |
Does this need any further automated testing? |
Nope, this pr only fixes the displayed logs on the odh-notebook-operator |
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
/approve
thank you 💯
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: harshad16, jstourac The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
aaf4934
into
opendatahub-io:v1.7-branch
/cherrypick stable |
@harshad16: new pull request created: #271 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 kubernetes/test-infra repository. |
Related to: https://issues.redhat.com/browse/RHOAIENG-4165
Description
This pull request resolves the issue with pod logs by adjusting it to display an informative message instead of raising an error when encountering the
odh-ca-bundle.crt
key, as there might be instances where the data associated with this key is empty.How Has This Been Tested?
quay.io/opendatahub/odh-notebook-controller:pr-264
In case of empty odh-ca-bundle.crt
Mounts only the valid cert
In case of wrong cert
Mounts only the valid one
In case of both certs are valid
Mounts both cert
Merge criteria: