-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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( |
There was a problem hiding this comment.
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
self.root.setdefault("volumeMounts", []) | ||
self.root.volumeMounts += [ |
There was a problem hiding this comment.
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
self.root.setdefault("ports", []) | ||
self.root.ports.append( |
There was a problem hiding this comment.
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", [] |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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(): |
There was a problem hiding this comment.
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
2c9e328
to
7083f7c
Compare
No description provided.