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

KThreesControlPlane ServerConfig always reverts to defaults #120

Closed
anmazzotti opened this issue May 22, 2024 · 6 comments · Fixed by #121
Closed

KThreesControlPlane ServerConfig always reverts to defaults #120

anmazzotti opened this issue May 22, 2024 · 6 comments · Fixed by #121

Comments

@anmazzotti
Copy link
Contributor

Using the v1beta2 and configuring for example:

apiVersion: controlplane.cluster.x-k8s.io/v1beta2
kind: KThreesControlPlane
metadata:
  name: k3s-control-plane
  namespace: default
spec:
  kthreesConfigSpec:
    serverConfig:
      disableCloudController: false
      cloudProviderName: ""
  machineTemplate:
    infrastructureRef:
      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
      kind: InfraMachineTemplate
      name: infra-cluster-k3s-control-plane
  replicas: 1
  version: v1.28.5+k3s1

After applying this config, the KThreesControlPlane defaults back to:

        serverConfig:
          cloudProviderName: external
          disableCloudController: true

This was reported in the Slack channel in this thread.

@anmazzotti
Copy link
Contributor Author

I'm already having a look at this, trying to fix it asap.
I wonder if the CustomDefaulter we recently activated is the related to this, but I'm having some hard time solving it at the moment.

@nasusoba
Copy link
Contributor

I tried to add some breakpoint to the CustomDefaulter, and I observed the value remains disableCloudController=false. It seems that it is not the CustomDefaulter causing the issue. This is really weird...

@nasusoba
Copy link
Contributor

@anmazzotti Could you check if this would help golang omitempty , it seems that we should use *bool when using with omitempty

@anmazzotti
Copy link
Contributor Author

I'm indeed using pointers in the PR I opened yesterday to fix this.
It's indeed odd, but I was able to reproduce it.

Somehow the kubebuilder defaults are a bit too sticky, but setting everything in the custom defaulter seem to work just fine.

@nasusoba
Copy link
Contributor

Does the issue got fixed? I have not tried with your PR yet, I have not noticed it has been changed to pointer XD

@anmazzotti
Copy link
Contributor Author

I tested it locally and it seems to be fixed.

I should be adding some e2e test, but I think that also needs porting of all current tests to v1beta2 manifests, so may take a bit.
I added a new issue for that and I'll try to prioritize it: #123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants