-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
reorganize var defaults #11840
base: master
Are you sure you want to change the base?
reorganize var defaults #11840
Conversation
Signed-off-by: KubeKyrie <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: KubeKyrie The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @KubeKyrie. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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 kubernetes-sigs/prow repository. |
Unless this is taking care of all the instances ( I don't think so ? ) please remove the `fixes` to avoid auto closing the issue.
Also, I don't think we should have null checksum, we should rather figure out how to obtain the correct ones.
/ok-to-test
|
@@ -9,7 +9,7 @@ | |||
- name: Generate etcd certs | |||
include_tasks: "gen_certs_script.yml" | |||
when: | |||
- cert_management | d('script') == "script" | |||
- cert_management == "script" |
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.
would it fails if cert_management is undefined ?
If yes that would change the behavior of using script by default when undefined
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.
Yeah, this would need a default value for cert_management in kubespray-defaults
@@ -437,15 +437,15 @@ argocd_enabled: false | |||
|
|||
## When OpenStack is used, Cinder version can be explicitly specified if autodetection fails (Fixed in 1.9: https://github.com/kubernetes/kubernetes/issues/50461) | |||
# openstack_blockstorage_version: "v1/v2/auto (default)" | |||
openstack_blockstorage_ignore_volume_az: "{{ volume_cross_zone_attachment | default('false') }}" | |||
openstack_blockstorage_ignore_volume_az: "{{ volume_cross_zone_attachment }}" |
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.
when this role is executed, nothing say that volume_cross_zone_attachment is defined.
this variable eventually is defined but from another role/inventory.
We shouldn't remove it there
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.
Default variables are lazily interpreted though, aren't they ? (-> meaning this will work if the value is defined when the variable is used)
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.
Nothing tells you it will be defined for sure.
Maybe it's defined in the openstack role that is not included when not using openstack,
Maybe the playbook ran with --tags X,Y and the role where "volume_cross_zone_attachment" is not executed.
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.
We're mostly doing role imports rather than include, though, don't we ?
If I'm not mistaken, the tags don't affect roles variables, only the tasks (unless using include, which is dynamic).
However, in any case, I agree it's better than a variable dependent on another should live nearby, ideally in the same file. ~~
Actually, this variable is not used anywhere since 437026f (AFAICS), so we should just delete it :
$ grep -R openstack_blockstorage_ignore roles/
roles/kubespray-defaults/defaults/main/main.yml:openstack_blockstorage_ignore_volume_az: "{{ volume_cross_zone_attachment | default('false') }}"
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.
@VannTen yes, but not all runs imports all roles.
Short test:
role A define "var_a: "I'm var a"
role B define "var_ab: "I'm b and {{var_a}}"
In the test playbook, the install kubernetes nodes
run will work (even if role a is not executed) , but not the install control plane
.
---
- name: Install Kubernetes nodes
hosts: localhost
gather_facts: true
roles:
- { role: a, tags: ['a'], when: false}
- { role: b, tags: ['b'] }
- name: Install the control plane
hosts: localhost
gather_facts: true
roles:
- { role: b, tags: ['b'] }
Selecting subset of roles is used a lot in kubespray (see cluster.yml)
Hi thank you for the PR. But I think the default are good and shouldn't be remove as it change behavior and also increase dependencies between roles. |
PR needs rebase. 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 kubernetes-sigs/prow repository. |
What type of PR is this?
/kind flake
What this PR does / why we need it:
reorganize var defaults, and have a default value defined only once
Which issue(s) this PR fixes:
#11822
Special notes for your reviewer:
Does this PR introduce a user-facing change?: