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

🐛 Fix OCI client configuration logic #252

Merged

Conversation

jimmidyson
Copy link
Member

@jimmidyson jimmidyson commented Jun 1, 2024

This commit fixes the logic deciding to create a TLS client for OCI
charts.

The existing code was creating a non-TLS configured client if either the CA file
was unspecified or if insecureSkipTLSVerify was set to false. If a CA
file was specified then insecureSkipTLSVerify is always false, which meant
that a non-TLS client was always created, causing cert validation
failures if the OCI registry is served over TLS.

This commit changes the logic to create a non-TLS configured client if
both CA file is unset AND insecureSkipTLSVerify is false.

This commit fixes the logic deciding to create a TLS client for OCI
charts.

The existing code was creating a non-TLS configured client if either the CA file
was unspecified or if `insecureSkipTLSVerify` was set to false. If a CA
file was specified then `insecureSkipTLSVerify` is false, which meant
that a non-TLS client was always created, causing cert validation
failures if the OCI registry is served over TLS.

This commit changes the logic to create a non-TLS configured client if
both CA file is unset and `insecureSkipTLSVerify` is false.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 1, 2024
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 1, 2024
@jimmidyson
Copy link
Member Author

/cc @mboersma

@jimmidyson
Copy link
Member Author

Sorry I introduced this bug in #238 😞. @Jont828 @mboersma Would appreciate getting this merged and released ASAP if possible 🙏

Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 3, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jimmidyson, mboersma

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 3, 2024
@k8s-ci-robot k8s-ci-robot merged commit a95e8c5 into kubernetes-sigs:main Jun 3, 2024
16 checks passed
@jimmidyson jimmidyson deleted the jimmi/fix-oci-ca-logic branch June 3, 2024 19:07
faiq added a commit to nutanix-cloud-native/cluster-api-runtime-extensions-nutanix that referenced this pull request Jun 12, 2024
**What problem does this PR solve?**:
Upgrade CAAPH to 0.2.4
This release includes fixes needed for supporting CAAPH in airgap
environment.

🌱 Use upstream cluster RESTConfig utility by @jimmidyson in
kubernetes-sigs/cluster-api-addon-provider-helm#248
🐛 Fix OCI client configuration logic by @jimmidyson in
kubernetes-sigs/cluster-api-addon-provider-helm#252
🐛 pointer checks if user doesn't specify CASecret by @faiq in
kubernetes-sigs/cluster-api-addon-provider-helm#253
**Which issue(s) this PR fixes**:
Fixes #

**How Has This Been Tested?**:
<!--
Please describe the tests that you ran to verify your changes.
Provide output from the tests and any manual steps needed to replicate
the tests.
-->

**Special notes for your reviewer**:
<!--
Use this to provide any additional information to the reviewers.
This may include:
- Best way to review the PR.
- Where the author wants the most review attention on.
- etc.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants