Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Replace KubernetesAnsibleModule class with dummy class #227

Merged
merged 7 commits into from
Sep 16, 2020

Conversation

Akasurde
Copy link
Member

@Akasurde Akasurde commented Sep 9, 2020

SUMMARY
  • Make a AnsibleMixin parent class for every module
  • Remove KubernetesAnsibleModule class
  • Modified k8s_log

Signed-off-by: Abhijeet Kasurde [email protected]

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

plugins/module_utils/common.py
plugins/modules/k8s_log.py

Copy link
Collaborator

@geerlingguy geerlingguy left a comment

Choose a reason for hiding this comment

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

The structure of the change looks okay to me, though the change seems to have introduced a cascade of test failures. Assuming we resolve those I'm fine with this change.

I haven't taken a peek, but do you know if anything in the Kubevirt modules in community.general would blow up after making these changes; I noticed they import from KubernetesRawModule.

@Akasurde
Copy link
Member Author

Akasurde commented Sep 9, 2020

The structure of the change looks okay to me, though the change seems to have introduced a cascade of test failures. Assuming we resolve those I'm fine with this change.

Yes, Since we removed KubernetesAnsibleModule from only one module, the rest are in pipeline.

I haven't taken a peek, but do you know if anything in the Kubevirt modules in community.general would blow up after making these changes; I noticed they import from KubernetesRawModule.

Good. Thanks for reminding me that. I will take care of that as well once this is resolved.

@codecov
Copy link

codecov bot commented Sep 11, 2020

Codecov Report

Merging #227 into main will decrease coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #227      +/-   ##
==========================================
- Coverage   42.62%   42.50%   -0.12%     
==========================================
  Files           4        4              
  Lines         610      614       +4     
  Branches      122      122              
==========================================
+ Hits          260      261       +1     
- Misses        303      306       +3     
  Partials       47       47              
Impacted Files Coverage Δ
...ommunity/kubernetes/plugins/module_utils/common.py 36.86% <0.00%> (-1.80%) ⬇️
...s/community/kubernetes/plugins/module_utils/raw.py 43.57% <0.00%> (+1.08%) ⬆️

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 28dcf76...2a4a341. Read the comment docs.

Copy link
Collaborator

@geerlingguy geerlingguy left a comment

Choose a reason for hiding this comment

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

LGTM, but I would like to make sure at least one or two other maintainers deeper into any other module integrations (I know of kubevirt that might need adjustments, but I don't know if anyone else might be relying on KubernetesAnsibleModule...?).

The other question: would this be something we can merge into a 1.1, or do we need to go to 2.0.0 with this change?

Copy link
Contributor

@maxamillion maxamillion left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@tima
Copy link
Collaborator

tima commented Sep 15, 2020

@fabianvf could you weigh in on a dummy class here to avoid breaking anyone.

@@ -265,28 +274,6 @@ def diff_objects(existing, new):
result['after'] = diff[1]
return not diff, result


class KubernetesAnsibleModule(AnsibleModule, K8sAnsibleMixin):
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can probably leave this and the KubernetesRawModule classes around as dummies with warnings to avoid a breaking API change

Copy link
Collaborator

@fabianvf fabianvf left a comment

Choose a reason for hiding this comment

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

Sorry that last review should have been marked as Request changes

* Make a AnsibleMixin parent class for every module
* Remove KubernetesAnsibleModule class
* Modified k8s_log

Signed-off-by: Abhijeet Kasurde <[email protected]>
Signed-off-by: Abhijeet Kasurde <[email protected]>
Signed-off-by: Abhijeet Kasurde <[email protected]>
Signed-off-by: Abhijeet Kasurde <[email protected]>
Signed-off-by: Abhijeet Kasurde <[email protected]>
Signed-off-by: Abhijeet Kasurde <[email protected]>
* Add a dummy class for backward  compatiblity

Signed-off-by: Abhijeet Kasurde <[email protected]>
@Akasurde Akasurde changed the title Remove KubernetesAnsibleModule Replace KubernetesAnsibleModule class with dummy class Sep 16, 2020
@Akasurde Akasurde merged commit 51cadb7 into ansible-collections:main Sep 16, 2020
@Akasurde Akasurde deleted the i219 branch September 16, 2020 15:05
@felixfontein
Copy link

I think this PR breaks the unit tests in community.general (see f.ex. https://app.shippable.com/github/ansible-collections/community.general/runs/4278/15/tests). Could someone please check whether this also affects the kubevirt modules?

@Akasurde
Copy link
Member Author

@felixfontein I have raised a PR to fix failing kubevirt tests.

@Akasurde
Copy link
Member Author

Community.general - ansible-collections/community.general#1070

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

Successfully merging this pull request may close these issues.

6 participants