Skip to content

Conversation

vflaux
Copy link
Contributor

@vflaux vflaux commented Sep 30, 2025

What does it do ?

Fix a panic when building the OCI provider with missing config fields.

I would have liked to add tests for successful OCI provider builds, but this query the instance metadata API or require a config file, so it's not easy to test as is.

Motivation

fix #5849

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

@k8s-ci-robot k8s-ci-robot added the controller Issues or PRs related to the controller label Sep 30, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign raffo for approval. For more information see the Code Review Process.

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 30, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @vflaux. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 30, 2025
@mloiseleur
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 30, 2025
@coveralls
Copy link

coveralls commented Sep 30, 2025

Pull Request Test Coverage Report for Build 18260285977

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.06%) to 78.613%

Files with Coverage Reduction New Missed Lines %
openshift_route.go 1 79.49%
Totals Coverage Status
Change from base Build 18242454154: 0.06%
Covered Lines: 15813
Relevant Lines: 20115

💛 - Coveralls

Copy link
Collaborator

@mloiseleur mloiseleur left a comment

Choose a reason for hiding this comment

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

@vflaux The error handling for oci hurt my eyes. Wdyt of my suggestions ?

@mloiseleur
Copy link
Collaborator

@jrosinsk @anders-swanson Any comments on this PR ? Do you think you can review it ?

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Oct 5, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 5, 2025
@vflaux
Copy link
Contributor Author

vflaux commented Oct 5, 2025

@vflaux The error handling for oci hurt my eyes. Wdyt of my suggestions ?

I wanted to minimize changes, but yes, it's better.

@mloiseleur
Copy link
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 5, 2025
@jrosinsk
Copy link
Contributor

jrosinsk commented Oct 5, 2025

@jrosinsk @anders-swanson Any comments on this PR ? Do you think you can review it ?

taking a look.

}
}
config.ZoneCacheDuration = cfg.OCIZoneCacheDuration
if err == nil {
Copy link
Contributor

@jrosinsk jrosinsk Oct 5, 2025

Choose a reason for hiding this comment

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

the panic happens on the access to the non-existant ZoneCacheDuration.
another way to fix this would be to just protect that call when there is no config loaded:

`

         if err == nil {
                    config.ZoneCacheDuration = cfg.OCIZoneCacheDuration
                    p, err = oci.NewOCIProvider(*config, domainFilter, zoneIDFilter, cfg.OCIZoneScope, cfg.DryRun)
            }
    case "rfc2136":

`

Seems a bit more confusing with the break statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. controller Issues or PRs related to the controller lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External DNS is failing in Oracle Cloud OKE with version v1.33.1
5 participants