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

Jnlp #117

Closed
wants to merge 4 commits into from
Closed

Jnlp #117

wants to merge 4 commits into from

Conversation

iocanel
Copy link
Contributor

@iocanel iocanel commented Jan 18, 2017

No description provided.

@iocanel
Copy link
Contributor Author

iocanel commented Jan 18, 2017

@clockworksoul, @jgangemi, @bparees: We discussed about those changes in #116

So I thought that you may want to have a look or try it out.

@iocanel iocanel changed the title Jnlp [WIP] Jnlp Jan 19, 2017
@iocanel iocanel changed the title [WIP] Jnlp Jnlp Jan 26, 2017
@iocanel iocanel requested a review from carlossg January 26, 2017 11:31
@iocanel
Copy link
Contributor Author

iocanel commented Jan 26, 2017

@carlossg: its ready for review now

README.md Outdated
and will be the container acting as Jenkins agent. It can ve overridden by defining a container with the same name.
and will be the container acting as Jenkins agent.

It can ve overridden by defining a container with the same name, or by explicitly:
Copy link
Contributor

Choose a reason for hiding this comment

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

s/ve/be/

@@ -396,7 +409,14 @@ private Pod getPodTemplate(KubernetesSlave slave, Label label) {
volumes.add(new VolumeBuilder().withName(WORKSPACE_VOLUME_NAME).withNewEmptyDir("").build());
Map<String, Container> containers = new HashMap<>();

if (template.isCustomJnlpContainerEnabled() && template.getJnlpContainer() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this config variable feels misnamed to me.

the behavior is "when true, automatically add a default jnlp container"

so i would expect a name more like either:

  1. IsDefaultJNLPContainerEnabled
  2. IsAddJNLPContainerEnabled

or flip the boolean because

IsCustomJNLPContainerEnabled, to me, means "the user has promised to provide the jnlp container in one way or another, so we don't need to do anything"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getJnlpContainer() doesn't return the default jnlp container but the user specified one or if you prefer the "custom". I can see that being confusing and I'll rename it to customJnlpContainer.

Copy link
Contributor

Choose a reason for hiding this comment

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

hm. So is there any way for me to avoid having a jnlp (custom or otherwise) added to my pod? is setting the container name to jnlp the only way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the pull request does not provide a way to do so. It provides a more clear way to define the which container will act as a jnlp container and also adds the inheritance thing, but no way to explicitly request no jnlp container at all.

Even, if we add an option for that. I think that it wouldn't work, because you can't have a slave pod without a jnlp container.

If you are using a hybrid container (e.g. build tools + jnlp), it is still a jnlp container, so it could be defined in the jnlp container field.

Having no jnlp container at all could possibly make sense only in the case where you already had a slave pod running and for some reason you needed an additional container to execute some steps in the pipeline. Of course, this is still not supported (yet) by the plugin (because we would need to have a way to share the workspace, #114 might help in that regard).

Now, if you still feel there is a demand for such option, I don't mind adding it as part of this pull request.

Copy link
Contributor

Choose a reason for hiding this comment

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

Even, if we add an option for that. I think that it wouldn't work, because you can't have a slave pod without a jnlp container.

sure, i just was thinking of the case where i don't want to call my container "jnlp" but it does indeed provide the jnlp client.

but it's not a big deal, if naming the container jnlp is the accepted mechanism i think we can live with it.

Choose a reason for hiding this comment

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

i would request that you add a help item to the container name field that includes this information.

The name of the pod template to use for providing default values.
When a value is specified and there is a pod template with a matching name, the template will be
used as a parent to all other pod templates.
</div>

Choose a reason for hiding this comment

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

newline (in case you care)

Copy link
Contributor

@carlossg carlossg left a comment

Choose a reason for hiding this comment

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

I think customJnlpContainerEnabled and jnlpContainer are unnecessary. The default template has the jnlp container defined, and if you set another one with name jnlp then it gets overridden, no need for extra fields

@iocanel
Copy link
Contributor Author

iocanel commented Feb 3, 2017

They are unnecessary, the feedback we get however, points to the fact that the current approach is not obvious. So, I think that we need to take that into consideration.

@iocanel
Copy link
Contributor Author

iocanel commented Feb 7, 2017

@carlossg: rebased and fixed some typos. So what are we going to do with that?

I think that its more obvious to ppl to have an explicit field to set jnlp, but I don't have very strong preference.

@carlossg
Copy link
Contributor

I have added #132 that will solve the problem for people upgrading from 0.8 and earlier. The only container would be called jnlp

For people already in 0.9 and 0.10 I'm going to assume they already went through the trouble of changing the container names. I don't see an obvious way to detect whether a template includes the jnlp container twice or not.

The other code about having a default template looks good to me and could be useful anyway

@iocanel
Copy link
Contributor Author

iocanel commented Feb 13, 2017

@carlossg: I also moved the commit for the defaults template provider to a new pull request: #133. So, I'll close this one.

@iocanel iocanel closed this Feb 13, 2017
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