-
Notifications
You must be signed in to change notification settings - Fork 461
MCO-1092: Adapt the MCO's featuregate usage to new API #4275
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
Conversation
|
@dkhater-redhat: This pull request references MCO-1092 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
24ce75e to
eeb92c5
Compare
|
integrated api migration cleanup into this PR. |
817ae18 to
dbdbf6b
Compare
|
/retest-required |
|
build a cluster based on this PR $ oc get featuregates/cluster -o yaml
apiVersion: config.openshift.io/v1
kind: FeatureGate
metadata:
annotations:
include.release.openshift.io/self-managed-high-availability: "true"
creationTimestamp: "2024-03-27T07:10:40Z"
generation: 1
name: cluster
resourceVersion: "1694"
uid: 4bb3004e-f7fa-46c3-8e59-8418d6f5ce06
spec: {}
status:
featureGates:
- disabled:
- name: AdminNetworkPolicy
- name: AlertingRules
- name: AutomatedEtcdBackup
- name: CSIDriverSharedResource
- name: ClusterAPIInstall
- name: DNSNameResolver
- name: DisableKubeletCloudCredentialProviders
- name: DynamicResourceAllocation
- name: EventedPLEG
- name: Example
- name: ExternalOIDC
- name: ExternalRouteCertificate
- name: GCPClusterHostedDNS
- name: GCPLabelsTags
- name: GatewayAPI
- name: HardwareSpeed
- name: ImagePolicy
- name: InsightsConfig
- name: InsightsConfigAPI
- name: InsightsOnDemandDataGather
- name: InstallAlternateInfrastructureAWS
- name: MachineAPIOperatorDisableMachineHealthCheckController
- name: MachineAPIProviderOpenStack
- name: MachineConfigNodes
- name: ManagedBootImages
- name: MaxUnavailableStatefulSet
- name: MetricsServer
- name: MixedCPUsAllocation
- name: NewOLM
- name: NodeDisruptionPolicy
- name: NodeSwap
- name: OnClusterBuild
- name: PinnedImages
- name: PlatformOperators
- name: RouteExternalCertificate
- name: SignatureStores
- name: SigstoreImageVerification
- name: TranslateStreamCloseWebsocketRequests
- name: UpgradeStatus
- name: ValidatingAdmissionPolicy
- name: VolumeGroupSnapshot
enabled:
- name: AlibabaPlatform
- name: AzureWorkloadIdentity
- name: BareMetalLoadBalancer
- name: BuildCSIVolumes
- name: CloudDualStackNodeIPs
- name: ExternalCloudProvider
- name: ExternalCloudProviderAzure
- name: ExternalCloudProviderExternal
- name: ExternalCloudProviderGCP
- name: KMSv1
- name: NetworkLiveMigration
- name: OpenShiftPodSecurityAdmission
- name: PrivateHostedZoneAWS
- name: VSphereControlPlaneMachineSet
- name: VSphereStaticIPs
version: 4.16.0-0.test-2024-03-27-070003-ci-ln-3mw3sct-latestupdate featuregate/cluster to disable featuregate $ oc get featuregate cluster -o yaml | yq -y '.spec'
customNoUpgrade:
disabled:
- AlibabaPlatform
featureSet: CustomNoUpgradethe featuregate can be disabled successfully $ oc get featuregate cluster -o yaml | yq '.status.featureGates[0].disabled' | grep -i alibaba
"name": "AlibabaPlatform"@dkhater-redhat @yuqi-zhang is there any other testing needed for this PR? |
hexfusion
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good start can we bump to the current latest openshift/api? I am also missing the changes required to bring in the new crds. I believe you will need to update the tools.go and crds-sync.sh to do this. See an example in [1] cc @cdoern
| if len(mcs) > 0 { | ||
| t.Errorf("expected no machine config generated with the default feature gate, got %d configs", len(mcs)) | ||
| if len(mcs) == 0 { | ||
| t.Errorf("expected machine configs to be generated, but none were produced") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this it seems like the result should be the same? is there a reason why they are not the same? maybe add a note on what the later means
createNewDefaultFeatureGateAccess()
featuregates.NewHardcodedFeatureGateAccess(nil, nil)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the comparison-
If the function is expected to generate machine configs even with default or minimal configuration, then the original assertion is correct.
If the function should not generate any machine configs when default feature gate settings are applied, then the revised assertion would be the correct one.
running the test with > 0 fails the test, as it generates 2 machine configs
The original test checks if any machine configs were generated by evaluating the length of the returned slice of machine configs. The test expects no machine configs to be generated. If any are generated, the test fails, indicating that machine configs were unexpectedly produced under default feature gate settings.
But now, we do not have a concept of "default" feature gates, meaning that a machine config should be generated regardless.
It does not imply a "default" state in the sense of applying no configurations, it means that there's no specific guidance on which features should or should not be considered, leaving RunFeatureGateBootstrap to operate based on its internal logic or other inputs.
in reference to featuregates.NewHardcodedFeatureGateAccess(nil, nil), it creates a FeatureGateAccess object with no explicitly enabled or disabled features. the previous function created also did the same (output enabled and disabled featuregates), however its functionality depended on a predefined list of default features. this dependency broke with the new api bump, as our method of obtaining default feature was deprecated.
a86c601 to
ec6598a
Compare
| updateOriginalKubeConfigwithNodeConfig(nodeConfig, originalKubeConfig) | ||
| } | ||
|
|
||
| defaultFeatures, err := generateFeatureMap(createNewDefaultFeatureGateAccess(), openshiftOnlyFeatureGates...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic also exists in the kubeletconfig generation, so we should clean this up (but not as part of this PR)
We should also look to remove this whole sub-controller if that's possible with the new workflow
…ture gates from featureGateAccessor
ec6598a to
a98c275
Compare
@rioliu-rh I think that looks correct from an API perspective. Would you be able to test whether the kubelet itself on-disk has the right featuregates? We are removing the hard-coded ones, I'm not sure how this shoud look like |
|
/retest-required |
|
compare the featuregates with kubelet.conf on cluster node debug node/ip-10-0-60-48.us-west-2.compute.internal -- chroot /host cat /etc/kubernetes/kubelet.conf | yq '.featureGates' > /tmp/fg.json
$ cat /tmp/fg.json
{
"AdminNetworkPolicy": false,
"AlertingRules": false,
"AlibabaPlatform": true,
"AutomatedEtcdBackup": false,
"AzureWorkloadIdentity": true,
"BareMetalLoadBalancer": true,
"BuildCSIVolumes": true,
"CSIDriverSharedResource": false,
"CloudDualStackNodeIPs": true,
"ClusterAPIInstall": false,
"DNSNameResolver": false,
"DisableKubeletCloudCredentialProviders": false,
"DynamicResourceAllocation": false,
"EventedPLEG": false,
"Example": false,
"ExternalCloudProvider": true,
"ExternalCloudProviderAzure": true,
"ExternalCloudProviderExternal": true,
"ExternalCloudProviderGCP": true,
"ExternalOIDC": false,
"ExternalRouteCertificate": false,
"GCPClusterHostedDNS": false,
"GCPLabelsTags": false,
"GatewayAPI": false,
"HardwareSpeed": false,
"ImagePolicy": false,
"InsightsConfig": false,
"InsightsConfigAPI": false,
"InsightsOnDemandDataGather": false,
"InstallAlternateInfrastructureAWS": false,
"KMSv1": true,
"MachineAPIOperatorDisableMachineHealthCheckController": false,
"MachineAPIProviderOpenStack": false,
"MachineConfigNodes": false,
"ManagedBootImages": false,
"MaxUnavailableStatefulSet": false,
"MetricsServer": false,
"MixedCPUsAllocation": false,
"NetworkLiveMigration": true,
"NewOLM": false,
"NodeDisruptionPolicy": false,
"NodeSwap": false,
"OnClusterBuild": false,
"OpenShiftPodSecurityAdmission": true,
"PinnedImages": false,
"PlatformOperators": false,
"PrivateHostedZoneAWS": true,
"RouteExternalCertificate": false,
"SignatureStores": false,
"SigstoreImageVerification": false,
"TranslateStreamCloseWebsocketRequests": false,
"UpgradeStatus": false,
"VSphereControlPlaneMachineSet": true,
"VSphereStaticIPs": true,
"ValidatingAdmissionPolicy": false,
"VolumeGroupSnapshot": false
}compare total featuregates number with exported file $ oc get featuregate cluster -o yaml | yq -y '.status.featureGates' | egrep -v 'disabled|enabled|version' | wc -l
56
$ cat /tmp/fg.json | egrep -v '{|}' | wc -l
56compare enabled featuregates with exported file $ for fg in $( oc get featuregate cluster -o yaml | yq '.status.featureGates[].enabled[].name');do grep $fg /tmp/fg.json;done
"AlibabaPlatform": true,
"AzureWorkloadIdentity": true,
"BareMetalLoadBalancer": true,
"BuildCSIVolumes": true,
"CloudDualStackNodeIPs": true,
"ExternalCloudProvider": true,
"ExternalCloudProviderAzure": true,
"ExternalCloudProviderExternal": true,
"ExternalCloudProviderGCP": true,
"KMSv1": true,
"NetworkLiveMigration": true,
"OpenShiftPodSecurityAdmission": true,
"PrivateHostedZoneAWS": true,
"VSphereControlPlaneMachineSet": true,
"VSphereStaticIPs": true,compare disabled featuregates with exported file $ for fg in $( oc get featuregate cluster -o yaml | yq '.status.featureGates[].disabled[].name');do grep $fg /tmp/fg.json;done
"AdminNetworkPolicy": false,
"AlertingRules": false,
"AutomatedEtcdBackup": false,
"CSIDriverSharedResource": false,
"ClusterAPIInstall": false,
"DNSNameResolver": false,
"DisableKubeletCloudCredentialProviders": false,
"DynamicResourceAllocation": false,
"EventedPLEG": false,
"Example": false,
"ExternalOIDC": false,
"ExternalRouteCertificate": false,
"GCPClusterHostedDNS": false,
"GCPLabelsTags": false,
"GatewayAPI": false,
"HardwareSpeed": false,
"ImagePolicy": false,
"InsightsConfig": false,
"InsightsConfigAPI": false,
"InsightsOnDemandDataGather": false,
"InstallAlternateInfrastructureAWS": false,
"MachineAPIOperatorDisableMachineHealthCheckController": false,
"MachineAPIProviderOpenStack": false,
"MachineConfigNodes": false,
"ManagedBootImages": false,
"MaxUnavailableStatefulSet": false,
"MetricsServer": false,
"MixedCPUsAllocation": false,
"NewOLM": false,
"NodeDisruptionPolicy": false,
"NodeSwap": false,
"OnClusterBuild": false,
"PinnedImages": false,
"PlatformOperators": false,
"RouteExternalCertificate": false,
"SignatureStores": false,
"SigstoreImageVerification": false,
"TranslateStreamCloseWebsocketRequests": false,
"UpgradeStatus": false,
"ValidatingAdmissionPolicy": false,
"VolumeGroupSnapshot": false |
|
/retest-required |
1 similar comment
|
/retest-required |
|
@dkhater-redhat: 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. |
yuqi-zhang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Will create follow up cards for hard-coded tests + removal of kubeletconfigfeatures
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dkhater-redhat, yuqi-zhang 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 |
|
[ART PR BUILD NOTIFIER] This PR has been included in build ose-machine-config-operator-container-v4.16.0-202403281715.p0.g7f0beb8.assembly.stream.el8 for distgit ose-machine-config-operator. |
|
/label qe-approved |
TRT-1587: Revert #4275 "MCO-1092: Adapt the MCO's featuregate usage to new API"
…aturegate usage to new API""
…aturegate usage to new API""
…aturegate usage to new API""
…aturegate usage to new API""
…aturegate usage to new API""
…aturegate usage to new API""
…aturegate usage to new API""
…aturegate usage to new API""
…aturegate usage to new API""
…aturegate usage to new API""
…aturegate usage to new API""
- What I did
- How to verify it
- Description for the changelog