• Kubernetes Submit Queue's avatar
    Merge pull request #49299 from dims/delay-looking-for-instance-id · 4560beb2
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 49420, 49296, 49299, 49371, 46514)
    
    Avoid looking up instance id until we need it
    
    **What this PR does / why we need it**:
    
    currently kube-controller-manager cannot run outside of a vm started
    by openstack (with --cloud-provider=openstack params). We try to read
    the instance id from the metadata provider or the config drive or the
    file location only when we really need it. In the normal scenario, the
    controller-manager uses the node name to get the instance id.
    https://github.com/kubernetes/kubernetes/blob/41541910e1699975a8f9202a89b6865e45921194/pkg/volume/cinder/attacher.go#L149
    
    The localInstanceID is currently used only in the test case, so let
    us not read it until it is really needed.
    
    So let's try to find the instance-id only when we need it.
    
    **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
    
    **Special notes for your reviewer**:
    
    **Release note**:
    
    ```release-note
    NONE
    ```
    4560beb2
Name
Last commit
Last update
..
providers Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
README.md Loading commit data...
cloud.go Loading commit data...
doc.go Loading commit data...
plugins.go Loading commit data...