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 builder for ClusterSpec #12589

Merged
merged 4 commits into from
Mar 18, 2020
Merged

Add builder for ClusterSpec #12589

merged 4 commits into from
Mar 18, 2020

Conversation

hmusum
Copy link
Member

@hmusum hmusum commented Mar 17, 2020

No description provided.

Copy link
Member

@bratseth bratseth left a comment

Choose a reason for hiding this comment

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

LGTM, and already an improvement so feel free to merge. The ClusterSpec is used either to request a desired cluster, or to specify an existing one (perhaps including group). I wonder if we couldn't keep the explicit separation between a request and the specification, like e.g replace "builder" by "request" and "specification" and have a boolean in the builder which only allows the correct fields for that context?

@hmusum
Copy link
Member Author

hmusum commented Mar 17, 2020

That separation was one of the things I wondered if we should somehow keep. Thanks for the suggestion, I'll look into it.

@aressem aressem changed the title Add builder for ClusterSpec Add builder for ClusterSpec Mar 17, 2020
request() should be used when requesting a cluster, same as old
static method called request(). specification() should be used when
creating a clsuter spec for an existing cluster, same as old
static method from(). specification() will throw an exception
if some required fields are not set
@hmusum hmusum marked this pull request as ready for review March 17, 2020 12:26
@hmusum
Copy link
Member Author

hmusum commented Mar 17, 2020

@bratseth please take a look again

@bratseth
Copy link
Member

Great! You could also validate that a request don't set group (and vespa-version?).

@hmusum hmusum merged commit 0e63624 into master Mar 18, 2020
@hmusum hmusum deleted the hmusum/builder-for-clusterspec branch March 18, 2020 08:36
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