Skip to content
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

[Backport release-1.26] Fix workerprofile data types on the generated CRD #3376

Merged
merged 1 commit into from
Aug 14, 2023

Commits on Aug 14, 2023

  1. Fix workerprofile data types on the generated CRD

    Using json.RawMessage creates the data type in CRD as `string` which is obviously wrong. Although in the Golang side it work perfectly it results into case where a k0s config cannot be created in the API when dynamic config is enabled and the config has worker profiles:
    ```
    level=info msg="E0810 18:28:49.753959      60 fieldmanager.go:152] \"[SHOULD NOT HAPPEN] failed to update managedFields\" err=\"failed to convert new object (kube-system/k0s; k0s.k0sproject.io/v1beta1, Kind=ClusterConfig) to smd typed: .spec.workerProfiles[0].values: expected string, got &value.valueUnstructured{Value:map[string]interface {}{}}\" versionKind=\"k0s.k0sproject.io/v1beta1, Kind=ClusterConfig\" namespace=\"kube-system\" name=\"k0s\"" component=kube-apiserver stream=stderr
    ```
    
    Many projects (e.g. ArgoCD) using generic maps for data use runtime.RawExtension and so does the controller-gen maintainers seem to advise.
    https://github.com/argoproj/argo-cd/blob/master/pkg/apis/application/v1alpha1/types.go#L325-L326
    
    Added also a test in `configchange` smoke that actually verifies the workerprofiles are usable with dynamic config and can be used for workers.
    
    Signed-off-by: Jussi Nummelin <[email protected]>
    jnummelin committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    d6ce15a View commit details
    Browse the repository at this point in the history