CSI controller and node drivers never call EnableInstanceMetadataServiceLookup(), so they cannot resolve regions the SDK does not know
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read cmd/oci-csi-controller-driver/main.go and cmd/oci-csi-node-driver/main.go, then compare startup setup with the CCM call to common.EnableInstanceMetadataServiceLookup() in pkg/cloudprovider/providers/oci/ccm.go. Check the existing tests and run the relevant Go tests. Done means both CSI binaries enable IMDS region lookup so unknown regions can resolve their realm domain without extra configuration.
Written by the indexing model from the issue text.
Description
Summary
The cloud controller manager enables the OCI Go SDK's instance-metadata (IMDS)
region lookup; the CSI controller and node drivers do not. In a realm or region
that the vendored SDK has no entry for, the CCM can still resolve its region
from IMDS, but the CSI drivers fall back to the commercial oraclecloud.com
domain and build endpoints that do not exist — unless OCI_REGION_METADATA or
~/.oci/regions-config.json is supplied.
Detail
Checked at 93969b53c3a17ea558b98ed31605cf69de9f37a5 (release-1.36), vendored
oci-go-sdk/v65 v65.110.0.
The only non-vendored call to common.EnableInstanceMetadataServiceLookup() is
in the init() of the CCM provider package:
Because it is in init(), any binary importing that package would get it. The
CSI binaries do not import it:
$ for c in oci-cloud-controller-manager oci-csi-controller-driver oci-csi-node-driver; do
printf '%s: ' "$c"
GOFLAGS=-mod=vendor go list -deps ./cmd/$c \
| grep -cx 'github.com/oracle/oci-cloud-controller-manager/pkg/cloudprovider/providers/oci'
done
oci-cloud-controller-manager: 1
oci-csi-controller-driver: 0
oci-csi-node-driver: 0
In the vendored SDK, StringToRegion resolves an unrecognised region through
checkAndAddRegionMetadata, which tries the regions config file, then
OCI_REGION_METADATA, then setRegionFromInstanceMetadataService. That last
step returns immediately unless visitIMDS is set, and only
EnableInstanceMetadataServiceLookup() sets it. With no match,
Region.SecondLevelDomain() returns OCI_DEFAULT_REALM if set, otherwise the
oc1 domain.
So for a region the SDK does not know, with no config file or environment
variable:
| Component | Region resolution |
|---|---|
| CCM | Falls through to IMDS and gets the correct realm domain |
| CSI controller and node drivers | Skip IMDS, fall back to oraclecloud.com, and call endpoints that do not exist |
Why it matters
This affects isolated and dedicated realms newer than the vendored SDK. Today
deployments have to inject OCI_REGION_METADATA into the CSI pods for storage
to work, while the CCM in the same cluster works without it. The OpenShift on
OCI Terraform stack (oracle-quickstart/oci-openshift) does this injection into
its CSI template for exactly this reason.
We found this by reading the source while adding isolated-realm support to that
stack, not by watching the driver fail: we already inject the variable, so we
have not run the CSI driver without it in an affected realm.
Suggested change
Call common.EnableInstanceMetadataServiceLookup() at startup in
cmd/oci-csi-controller-driver/main.go and cmd/oci-csi-node-driver/main.go,
or move the call somewhere both the CCM and the CSI drivers import. The CSI
drivers already rely on the instance metadata endpoint: the shared config code
in pkg/cloudprovider/providers/oci/config/config.go, which they use, queries
it to fill in the region or compartment when either is missing.
If the asymmetry is deliberate, it would help to document that the CSI drivers
require OCI_REGION_METADATA or a regions config file in realms the SDK does
not know.
Happy to send a PR for the first option if you would take it.
- Dominant language
- Go
- Stars
- 160
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from oracle/oci-cloud-controller-manager
-
Established connections are dropped when cluster-autoscaler scales down a load balancer backend nodeOpen
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
oracle/oci-cloud-controller-manager#546 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 75/100
All issues in oracle/oci-cloud-controller-manager
Similar issues
-
[Bug] Custom tool truncation leaves unused stream copies openPossibly taken @OUAO-FRANK claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[v3] KeyBindingManager calls (Add/Remove) are not converted into a case-insensitive accelerator.KeyOpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
crmne/hyprmoncfg#114 · 1 comment ·
Maintainers usually reply within 1 day
-
runtime: usleep sleeps nanoseconds instead of microseconds on linux/mips and linux/mips64Possibly taken @BRobertson7 claimed this today. Opencompiler/runtime
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day