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

Calico for windows AutoCreateServiceAccountTokenSecret param handling is inconsistent #8290

Closed
p-v-a opened this issue Dec 7, 2023 · 1 comment · Fixed by #8365
Closed

Comments

@p-v-a
Copy link

p-v-a commented Dec 7, 2023

It looks like there is inconsistency in how AutoCreateServiceAccountTokenSecret is handled in install-calico-windows.ps1 script
According to params it should be string, at least it gets default value of 'yes'

Later in the code it gets checked as boolean

Expected Behavior

/install-calico-windows.ps1 -DownloadOnly 'yes' -KubeVersion 1.25.9 -ServiceCidr 10.0.0.0/16 -DNSServerIPs 10.0.0.10 -CalicoBackend vxlan -AutoCreateServiceAccountTokenSecret 'No' -Datastore 'kubernetes'

and

/install-calico-windows.ps1 -DownloadOnly 'yes' -KubeVersion 1.25.9 -ServiceCidr 10.0.0.0/16 -DNSServerIPs 10.0.0.10 -CalicoBackend vxlan -AutoCreateServiceAccountTokenSecret 'Yes' -Datastore 'kubernetes'

should be threaded differently, according to parameter value

Current Behavior

Currently there is no difference between Yes or Now, because code checks parameter as boolean, so it always evaluate true.
One can set parameter to $true or $false, and then it works as expected

/install-calico-windows.ps1 -DownloadOnly 'yes' -KubeVersion 1.25.9 -ServiceCidr 10.0.0.0/16 -DNSServerIPs 10.0.0.10 -CalicoBackend vxlan -AutoCreateServiceAccountTokenSecret $false -Datastore 'kubernetes'

Possible Solution

Solution would be to treat parameter same way as DownloadOnly is threaded

Steps to Reproduce (for bugs)

Commands in Expected Behaviour reproduces bug reliably.

Your Environment

  • Calico version 3.26.4
  • Orchestrator version (e.g. kubernetes, mesos, rkt): kubernetes
@coutinhop
Copy link
Member

Thanks @p-v-a for spotting this! It definitely is inconsistent at best, we'll fix this. As a side note, Calico v3.27.0 is releasing soon, and will make Calico for Windows installation and operations much easier, getting rid of the install-calico-windows.ps1 script. We'll fix the script as it will still be supported for a while, but just a heads up that it will be deprecated in the future. Stay tuned and check it out when it releases!

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