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

k8s - add label_selectors options #158

Merged
merged 16 commits into from Jul 29, 2021

Conversation

abikouo
Copy link
Contributor

@abikouo abikouo commented Jun 30, 2021

SUMMARY

k8s now support label_selectors options same as k8s_info

Resolves #43

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

k8s

@codecov
Copy link

codecov bot commented Jun 30, 2021

Codecov Report

Merging #158 (6e0d5ce) into main (f98469e) will decrease coverage by 0.37%.
The diff coverage is n/a.

❗ Current head 6e0d5ce differs from pull request most recent head 576b61f. Consider uploading reports for the commit 576b61f to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #158      +/-   ##
==========================================
- Coverage   24.40%   24.02%   -0.38%     
==========================================
  Files           1        1              
  Lines         168      154      -14     
  Branches       32       29       -3     
==========================================
- Hits           41       37       -4     
+ Misses        120      112       -8     
+ Partials        7        5       -2     
Impacted Files Coverage Δ
...ections/kubernetes/core/plugins/action/k8s_info.py 24.02% <0.00%> (-0.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5a8194...576b61f. Read the comment docs.

Copy link
Member

@gravesm gravesm left a comment

Choose a reason for hiding this comment

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

The label_selector on the k8s module should support the same functionality as the label_selector on the k8s_info module, otherwise, it's going to be confusing. Specifically, we need to add support for set-based requirements. See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors.

plugins/module_utils/common.py Outdated Show resolved Hide resolved
plugins/module_utils/common.py Outdated Show resolved Hide resolved
plugins/module_utils/common.py Outdated Show resolved Hide resolved
@abikouo abikouo requested a review from gravesm July 13, 2021 14:36
@abikouo
Copy link
Contributor Author

abikouo commented Jul 19, 2021

The label_selector on the k8s module should support the same functionality as the label_selector on the k8s_info module, otherwise, it's going to be confusing. Specifically, we need to add support for set-based requirements. See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors.

ok this is not supporting set-based requirement now as there are some filters performed locally, it would be great to have this directly done on kubernetes python client. I will work on it

@abikouo
Copy link
Contributor Author

abikouo commented Jul 27, 2021

recheck

@abikouo abikouo requested a review from gravesm July 27, 2021 16:24
@ansible-zuul ansible-zuul bot merged commit 4b68266 into ansible-collections:main Jul 29, 2021
goneri added a commit to goneri/kubernetes.core that referenced this pull request Sep 20, 2021
The label_selectors is a new parameter for _wait_for that was
introduced in ansible-collections#158.

The value is new and it can be set to None to make it optional. It should
not be mandatory a non optional parameter.
goneri added a commit to goneri/kubernetes.core that referenced this pull request Sep 20, 2021
The label_selectors is a new parameter for _wait_for that was
introduced in ansible-collections#158.

The value is new and it can be set to None to make it optional. It should
not be mandatory a non optional parameter.
goneri added a commit to goneri/kubernetes.core that referenced this pull request Sep 20, 2021
The label_selectors is a new parameter for _wait_for that was
introduced in ansible-collections#158.

The value is new and it can be set to None to make it optional. It should
not be mandatory a non optional parameter.
ansible-zuul bot pushed a commit that referenced this pull request Sep 22, 2021
common/_wait_for: ensure label_selectors is optional

Depends-On: ansible/ansible-zuul-jobs#1125
The label_selectors is a new parameter for _wait_for that was
introduced in #158.
The value is new and it can be set to None to make it optional. It should
not be mandatory a non optional parameter.

Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
gravesm pushed a commit to gravesm/kubernetes.core that referenced this pull request Oct 7, 2021
…ions#239)

common/_wait_for: ensure label_selectors is optional

Depends-On: ansible/ansible-zuul-jobs#1125
The label_selectors is a new parameter for _wait_for that was
introduced in ansible-collections#158.
The value is new and it can be set to None to make it optional. It should
not be mandatory a non optional parameter.

Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
(cherry picked from commit 938f7e1)
ansible-zuul bot pushed a commit that referenced this pull request Oct 15, 2021
[backport/2.2] common/_wait_for: ensure label_selectors is optional (#239)

Depends-On: ansible/ansible-zuul-jobs#1170
Depends-On: ansible/ansible-zuul-jobs#1169
Depends-On: ansible/ansible-zuul-jobs#1171
common/_wait_for: ensure label_selectors is optional
The label_selectors is a new parameter for _wait_for that was
introduced in #158.
The value is new and it can be set to None to make it optional. It should
not be mandatory a non optional parameter.
Reviewed-by: None 
Reviewed-by: Alina Buzachis 
Reviewed-by: None 
(cherry picked from commit 938f7e1)

Reviewed-by: None <None>
Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: None <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support the selector option in the k8s module when applying service definitions
2 participants