[OCPCLOUD-1070] Add observe external switch to cloudpovider observer#895
Conversation
909099b to
036f815
Compare
|
@Danil-Grigorev: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
45293b7 to
8fc60e1
Compare
|
/remove-lifecycle rotten |
|
|
||
| external, err := cloudprovider.IsCloudProviderExternal(infrastructure.Status.Platform, featureGate) | ||
| if err != nil { | ||
| recorder.Eventf("ObserveCloudProviderNames", "Invalid featuregate.%s/cluster format: %v", err) |
There was a problem hiding this comment.
This error description seems oddly specific given its for a call IsCloudProviderExternal, would it not make more sense for it to say something like Could not determine external cloud provider state: %v?
8fc60e1 to
e2e9965
Compare
e2e9965 to
c0ce7f5
Compare
|
/lgtm Code changes look ok to me, how has this been tested? |
cluster-bot allows to do that, with revendored change in openshift/cluster-kube-controller-manager-operator#450 I was using my branch until this moment. |
| if err := unstructured.SetNestedStringSlice(observedConfig, []string{"external"}, c.cloudProviderNamePath...); err != nil { | ||
| errs = append(errs, err) | ||
| } | ||
| return observedConfig, errs |
There was a problem hiding this comment.
You need to set if err := listers.ResourceSyncer().SyncConfigMap to the correct (empty I think) value, in this case.
There was a problem hiding this comment.
That is right, but #994 requires this cloud-config to be copied even for external cloud-config option, as there still will be a consumer in some cases, like for KCM.
There was a problem hiding this comment.
That is right, but #994 requires this cloud-config to be copied even for
externalcloud-config option, as there still will be a consumer in some cases, like for KCM.
Coding by side-effect is bad practice. As I see it, if you want to rely on the same configmap, it makes sense to produce a separate configobserver function which both of these methods can rely upon.
As coded here, you aren't doing any copy when you start external anyway, so this broke the active resource sync.
There was a problem hiding this comment.
You are right, sorry for confusion. We definitely don't need a side effect on configobserver which will copy cloud-config to destination for the --external-cloud-provider-plugin flag in another PR, it will do this separately. But we should not remove it from there as well, so I think that this part is currently correct. It won't remove cloud-config which some other observer might place there. #994 will address that.
|
how this change affects ^ ? |
We discussed this with Stefan on a call. For now, the observer has a side effect where for certain platforms, it will synchronise the configmap as part of the config observation. We have created this PR so that we don't change the logic here and this side effect is still in place. In the longer term, anything that actually needs the configmap to be synced will have to do this explicitly. Eg using the resourcesynccontroller directly in their own sync loops. Because we still need the configmap for KCM, we will implement the sync there as part of 4.9. Then the plan is to remove this sync so that this method is side effect free. We will also be syncing it directly in our CCCMO. I think by the time we fully migrate, only CCCMO and storage will actually need this and KCM/KAS/MCO will no longer need them. |
This list is unaffected, until IsCloudProvider says otherwise. |
This method is used in KCMO and KAPIO to set the cloud-provider flags. FeatureGate will short-circuit logic to "external" for supported platforms. - Adds fg dependency in cloudprovider observer
5b0e868 to
372794f
Compare
elmiko
left a comment
There was a problem hiding this comment.
looks good to me @Danil-Grigorev , given our discussion with the team today will we add another patch on top of this for the upcoming changes to IsCloudProviderExternal ?
/lgtm
Yes, there will be a signature change coming short after for Azure and Azure Stack Hub support, but this PR depends on API change which didn't merge yet, so it could wait. This PR could merge first, and then #1077 could also update the usage in cloud provider observer. |
|
/lgtm |
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Danil-Grigorev, elmiko, Fedosin, JoelSpeed, lobziik, soltysh, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This method is used in KCMO and KAPIO to set the cloud-provider flags.
FeatureGate"ExternalCloudProvider" will short-circuit logic to "external" for supported platforms.This PR is the main blocker for work on CCM integration in Openshift: https://issues.redhat.com/browse/OCPCLOUD-1070