-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
PodTemplate’s copy constructor was incomplete #608
PodTemplate’s copy constructor was incomplete #608
Conversation
this.setVolumes(from.getVolumes()); | ||
this.setWorkspaceVolume(from.getWorkspaceVolume()); | ||
this.yaml = from.yaml; | ||
this.setYamls(from.getYamls()); | ||
this.setShowRawYaml(from.isShowRawYaml()); | ||
this.setNodeProperties(from.getNodeProperties()); | ||
this.showRawYaml = from.showRawYaml; |
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.
Just to avoid having the field be defined in the copy when null in the original.
this.setShowRawYaml(from.isShowRawYaml()); | ||
this.setNodeProperties(from.getNodeProperties()); | ||
this.showRawYaml = from.showRawYaml; | ||
if (from.nodeProperties != null) { |
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.
Ditto.
@@ -171,12 +171,15 @@ public PodTemplate(PodTemplate from) { | |||
this.setServiceAccount(from.getServiceAccount()); | |||
this.setSlaveConnectTimeout(from.getSlaveConnectTimeout()); | |||
this.setActiveDeadlineSeconds(from.getActiveDeadlineSeconds()); | |||
this.setIdleMinutes(from.getIdleMinutes()); |
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.
But this was really wrong: the idleMinutes
in the copy was always zero.
@@ -740,10 +725,6 @@ protected Object readResolve() { | |||
yamls = null; | |||
} | |||
|
|||
if (showRawYaml == null) { | |||
showRawYaml = Boolean.TRUE; |
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.
isShowRawYamlSet
would go from false to true after a restart, if setShowRawYaml
had never been called to begin with. (It would be called reliably from a GUI save, and from the podTemplate
step we would not be doing deserialization except in Snippet Generator, so maybe this does not matter.)
Evidently unused in this plugin, but can cause problems in downstream plugins.
Note that
PodTemplateUtils.combine(PodTemplate, PodTemplate)
also has a similar long enumeration of fields, and could well be missing some, though this seems to have better test coverage.