Skip to content

Conversation

@mfojtik
Copy link
Contributor

@mfojtik mfojtik commented Aug 20, 2014

This PR contains an updated version of the Project Template support based on the latest JSON schema.
It is re-using existing Kubernetes structs and the transformation process is independent from the the data structures.

@mfojtik mfojtik mentioned this pull request Aug 20, 2014
@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 20, 2014

@VojtechVitek @smarterclayton review pls? all changes should be already there and it should be updated and simplified for the latest JSON.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to me like a useless wrapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used in tests, it might be used in the cmd tool.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a useless wrapper (it doesn't do enough to justify existence) - use json.Marshal directly in the tests.

@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 20, 2014

@smarterclayton thanks, updated!

@mfojtik mfojtik force-pushed the project_updated branch 2 times, most recently from 5eff6ba to bde0ff7 Compare August 20, 2014 15:50
Copy link
Contributor

Choose a reason for hiding this comment

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

s/GeneratorTemplate/ExpressionValueGenerator/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer shorter names ;-) It is in fact generator template.

Copy link
Contributor

Choose a reason for hiding this comment

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

It still doesn't sound right to me :)

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's a value generator that should be part of the name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Needs godoc

Copy link
Contributor

Choose a reason for hiding this comment

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

Godoc and justification for it being public?

@VojtechVitek VojtechVitek force-pushed the project_updated branch 2 times, most recently from 4f9fb4a to 00a315f Compare August 29, 2014 13:36
@VojtechVitek
Copy link
Contributor

@smarterclayton refactored & rebased. Review pls.

Copy link
Contributor

Choose a reason for hiding this comment

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

So this will be turned into a replicationcontroller definition as part of the processing into a config file?

Copy link
Contributor

Choose a reason for hiding this comment

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

The deployment config controller does that post creation - dconfigs indicate a desire for the described resources to exist but it's their responsibility to create those resources.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, what/where is the deployment config controller?

my current mental model is:
project.json -> env variable generator -> project.json(variables resolved) -> k8s config generator -> config.json(consisting of k8s api objects, basically looks like @mfojtik 's "stapled together objects" config.json) -> calls to k8s apiserver

Where does the deployment config controller fit into that?

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, talked to clayton and he got me straightened out: deployment config will be a k8s api object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bparees @smarterclayton so just to clarify, the workflow @bparees proposed above is correct?

I mean, the steps are:

@VojtechVitek
Copy link
Contributor

@smarterclayton any comments? Merge?

@smarterclayton
Copy link
Contributor

Will take a look before monday

@VojtechVitek
Copy link
Contributor

That'd be awesome. Thanks!

@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 31, 2014

code lgtm :-) nice job with refactoring @VojtechVitek!

@mfojtik
Copy link
Contributor Author

mfojtik commented Sep 1, 2014

@smarterclayton @VojtechVitek I just noticed that when we adding custom parameters, we actually appending them to the parameter list, which might be a problem when the parameter with the same name already exists in the template. I added method AddCustomTemplateParameter that will replace the existing parameter (if exists). Surprisingly this increased the code coverage to 90% ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you provide any case this can happen during runtime? The only I can think of is that somebody will remove all generators and then call GenerateParameterValue, which is very unlikely to happen.

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct. It's just a check for possible generator initialization failure. We should be safe to remove this, as we have a test case for this.

@mfojtik
Copy link
Contributor Author

mfojtik commented Sep 1, 2014

The last commit just improve the test coverage to 93%.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mfojtik
Copy link
Contributor Author

mfojtik commented Sep 2, 2014

@smarterclayton @bparees @VojtechVitek according to the mails we exchanges, I will move this PR to the OpenShift kubernetes fork, refactor the example to look more like a k8s Config and add the REST endpoint to OpenShift k8s. Does it sound OK?

@mfojtik
Copy link
Contributor Author

mfojtik commented Sep 2, 2014

PR moved to k8s: openshift/kubernetes#7

@mfojtik mfojtik closed this Sep 2, 2014
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.

4 participants