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

fix multus include #10105

Merged
merged 1 commit into from
May 23, 2023
Merged

fix multus include #10105

merged 1 commit into from
May 23, 2023

Conversation

darkobas2
Copy link
Contributor

@darkobas2 darkobas2 commented May 18, 2023

"msg": "Failed to template loop_control.label: 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'item'. 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'item'", "skip_reason": "Conditional result was False"}

case when multus should NOT be included.

/kind bug

What this PR does / why we need it:

if multus is not enabled, unable to deploy/upgrade.

Which issue(s) this PR fixes:

Special notes for your reviewer:

someone with multus should test this.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 18, 2023
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 18, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 18, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @darkobas2!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 18, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @darkobas2. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 18, 2023
roles/kubernetes-apps/network_plugin/meta/main.yml Outdated Show resolved Hide resolved
roles/network_plugin/meta/main.yml Outdated Show resolved Hide resolved
roles/kubernetes-apps/network_plugin/multus/tasks/main.yml Outdated Show resolved Hide resolved
@oomichi
Copy link
Contributor

oomichi commented May 19, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 19, 2023
@MrFreezeex
Copy link
Member

If the | default('None') is not necessary anymore I would remove it otherwise (or if it still is necessary) lgtm.

@darkobas2
Copy link
Contributor Author

If the | default('None') is not necessary anymore I would remove it otherwise (or if it still is necessary) lgtm.

well on my setup I did not need it.. but when i uploaded the first patch i noticed the CI job was failing without it.

@MrFreezeex
Copy link
Member

MrFreezeex commented May 19, 2023

If the | default('None') is not necessary anymore I would remove it otherwise (or if it still is necessary) lgtm.

well on my setup I did not need it.. but when i uploaded the first patch i noticed the CI job was failing without it.

Could you try again without this line changed? Anyway the CI is a bit flaky these days when there are too much tasks running so you would have to push force to relaunch the CI anyway :x 🙈...

@darkobas2
Copy link
Contributor Author

i understand your concern... in case multus is needed and these wars are needed playbook should fail... i can look into how to maybe implement this logic where the multus_manifest_x vars are defined... meanwhile the CI should be running

@MrFreezeex
Copy link
Member

Sorry could you rebase your PR and push force to relaunch the pipeline again 🙏 😬

@@ -9,9 +9,12 @@
state: "latest"
delegate_to: "{{ groups['kube_control_plane'][0] }}"
run_once: true
with_items: "{{ multus_manifest_1.results }} + {{ multus_nodes_list|map('extract', hostvars, 'multus_manifest_2')|list|json_query('[].results') }}"
with_items: "{{ multus_manifest_1.results + multus_nodes_list|map('extract', hostvars, 'multus_manifest_2.results')|list }}"
Copy link
Member

@MrFreezeex MrFreezeex May 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you were indeed right the CI fails with this change :(.

I think something like that should work though:

Suggested change
with_items: "{{ multus_manifest_1.results + multus_nodes_list|map('extract', hostvars, 'multus_manifest_2.results')|list }}"
with_items: "{{ multus_manifest_1.results + (multus_nodes_list|map('extract', hostvars, 'multus_manifest_2.results') | default([]))|list }}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry that didnt work.

 "msg": "Failed to template loop_control.label: 'None' has no attribute 'item'. 'None' has no attribute 'item'"

I could not get it to work otherwise, so I added a task after this one to fail if this task resulted with item.name 'None'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i even tried setting

default([{'item': {'name': 'None', 'type': 'None', 'file': 'None'}}]

Copy link
Member

@MrFreezeex MrFreezeex May 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm actually I am thinking that the extract might simply not works... Does this works better?

Suggested change
with_items: "{{ multus_manifest_1.results + multus_nodes_list|map('extract', hostvars, 'multus_manifest_2.results')|list }}"
with_items: "{{ multus_manifest_1.results + (multus_nodes_list|map('extract', hostvars, 'multus_manifest_2')|list|json_query('[].results')) }}"

If this works I believe it's the only change that we would really need to have it working consistently...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry i cant test locally in the next day or two.... CI is failing too.. will push again later to retry

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, thanks for all your OSS works ❤️

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 19, 2023
``
"msg": "Failed to template loop_control.label: 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'item'. 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'item'", "skip_reason": "Conditional result was False"}
``
fixes case when multus should NOT be included.
@yankay yankay mentioned this pull request May 23, 2023
Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darkobas2 Thank you for the PR 👍

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 23, 2023
Copy link
Member

@MrFreezeex MrFreezeex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution and bearing with me and all the research that went into this! ❤️
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 23, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: darkobas2, floryut, MrFreezeex

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 4014a1c into kubernetes-sigs:master May 23, 2023
58 checks passed
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
``
"msg": "Failed to template loop_control.label: 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'item'. 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'item'", "skip_reason": "Conditional result was False"}
``
fixes case when multus should NOT be included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants