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

Remove module inheritance #36

Closed
fabianvf opened this issue Feb 21, 2020 · 1 comment · Fixed by #199
Closed

Remove module inheritance #36

fabianvf opened this issue Feb 21, 2020 · 1 comment · Fixed by #199
Assignees
Labels
priority/high type/enhancement New feature or request

Comments

@fabianvf
Copy link
Collaborator

SUMMARY

Currently we have the KubernetesAnsibleModule and KubernetesRawModule that most of our modules inherit from, but this is a bad pattern and has already bitten us with the k8s_scale module. We have an AnsibleMixin that works fine, though we should remove the argspec from it.

The main reason this pattern is harmful is that parameters are shared across modules, and adding or changing arguments in one will passively propagate to subclasses of that module. k8s_scale for example, inherits parameters from k8s, and has broken in the past when we added arguments to the k8s module (issue here). Each module should own the arguments it accepts, and code sharing should be limited to shared utilities rather than module definitions.

ISSUE TYPE
  • Technical Debt
@tima
Copy link
Collaborator

tima commented Aug 11, 2020

The k8s_scale module is a good example of a module that needs work to untangle the code.

Akasurde added a commit to Akasurde/community.kubernetes that referenced this issue Aug 20, 2020
Partially fix ansible-collections#36

Signed-off-by: Abhijeet Kasurde <[email protected]>
Akasurde added a commit to Akasurde/community.kubernetes that referenced this issue Aug 24, 2020
Partially fix ansible-collections#36

Signed-off-by: Abhijeet Kasurde <[email protected]>
Akasurde added a commit to Akasurde/community.kubernetes that referenced this issue Aug 24, 2020
Partially fix ansible-collections#36

Signed-off-by: Abhijeet Kasurde <[email protected]>
Akasurde added a commit to Akasurde/community.kubernetes that referenced this issue Aug 26, 2020
Partially fix ansible-collections#36

Signed-off-by: Abhijeet Kasurde <[email protected]>
Akasurde added a commit to Akasurde/community.kubernetes that referenced this issue Aug 26, 2020
Akasurde added a commit to Akasurde/community.kubernetes that referenced this issue Aug 26, 2020
Akasurde added a commit that referenced this issue Aug 26, 2020
Partially fix #36

Signed-off-by: Abhijeet Kasurde <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority/high type/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants