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

Add minimal Node model #53

Closed
wants to merge 1 commit into from
Closed

Add minimal Node model #53

wants to merge 1 commit into from

Conversation

tfheen
Copy link
Contributor

@tfheen tfheen commented Oct 16, 2018

This is not a complete Node object, but sufficient for writing an
ingress controller.

This is not a complete Node object, but sufficient for writing an
ingress controller.
Copy link
Member

@mortenlj mortenlj left a comment

Choose a reason for hiding this comment

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

We should probably look at what it takes to generate all our models from the API specification, but until then it would be nice to at least create models for all the fields we actually use.



class NodeStatus(Model):
addresses = ListField(dict)
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer it if you could define the NodeAddress objects as well. While every item in the model could be described using a dict, the point of the models is to have some actual objects that can be introspected.

The same applies to NodeConditions and NodeSystemInfo below.



class NodeSpec(Model):
externalID = OnceField(six.text_type)
Copy link
Member

Choose a reason for hiding this comment

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

This is tricky. In 1.8, this field was deprecated, but it will be removed in 1.13. I guess we will keep it for now.

Reading the documentation, I think this might be a ReadOnlyField, instead of a OnceField. At least in practice, since normal clients can't create a Node and set the value of the field.

@mortenlj
Copy link
Member

This is included in #55, so closing this one.

@mortenlj mortenlj closed this Jan 16, 2019
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