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

Test generators #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Test generators #3

wants to merge 9 commits into from

Conversation

ademariag
Copy link
Owner

No description provided.

Copy link

@MatteoVoges MatteoVoges left a comment

Choose a reason for hiding this comment

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

Really great work @ademariag . Here and there I saw potential to refactor, but I think keeping the objects and different kinds as much as explicit separated from each other is much easier to maintain and understand!

self.root.spec.template.spec.containers += [
container.root for container in containers
]
self.root.spec.template.spec.setdefault("containers", []).extend(

Choose a reason for hiding this comment

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

what a cool function setdefault(). I wish I knew about it sooner

Comment on lines +562 to 660
self.root.setdefault("volumeMounts", [])
self.root.volumeMounts += [

Choose a reason for hiding this comment

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

you could use .append contain the overall style

Comment on lines +639 to +737
self.root.setdefault("ports", [])
self.root.ports.append(

Choose a reason for hiding this comment

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

here as well (using .append directly)

if (
component.prefer_pods_in_node_with_expression
and not component.node_selector
):
workload.root.spec.template.spec.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution += [
affinity.nodeAffinity.setdefault(
"preferredDuringSchedulingIgnoredDuringExecutio", []

Choose a reason for hiding this comment

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

I think there is missing a n at the end. It should be preferredDuringSchedulingIgnoredDuringExecution

subjects:
- kind: ServiceAccount
name: tesoro
namespace: tesoro
namespace: default

Choose a reason for hiding this comment

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

is namespace: default correct or shouldn't it be still the components name tesoro?

component.name = name
yield name, component


def generate_docs(input_params):
obj = BaseObj()
template = input_params.get("template_path", None)
if template:
for name, component in get_components():

Choose a reason for hiding this comment

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

I think the method get_components() is not existing anymore. Correct me, if I'm wrong

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

Successfully merging this pull request may close these issues.

2 participants