-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Remove obsolete comments in types.go #4541
Conversation
@@ -61,7 +61,7 @@ type ContainerManifest struct { | |||
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"` | |||
Containers []Container `json:"containers" description:"list of containers belonging to the pod"` | |||
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" description:"restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"` | |||
// Optional: Set DNS policy. Defaults to "ClusterFirst" | |||
// Required: Set DNS policy. |
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.
By definition, defaulted fields are not required in the versioned types.go files.
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.
I misunderstood the meaning of the comment. The defaults are applied when converting a versioned object to the internal one, so they are defaulted. I will upload a new patch.
LGTM |
Remove obsolete comments in types.go
If every field is required is it worth spelling out? :) |
Maybe not, though it is a change, so perhaps useful for a while. |
@thockin, I couldn't find a consistent pattern of when to comment in the file. There are "required" and "optional" in multiple places, irregardless of this PR. Agreed that we probably should clean up all of them at once :) By the way, there are still some optional fields with default values. For example, some bool fields are defaulted to false. I believe this depends on the implicit struct initialization behavior in golang. Is that true/intentional? |
Yeah, there's not much we can do about zero-values short of running all On Wed, Feb 18, 2015 at 11:56 PM, Yu-Ju Hong notifications@github.com
|
This fixes #4519.