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

adding warning about --full #2950

Merged
merged 1 commit into from
Aug 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions cmd/kops/get_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ var (
kops get cluster k8s-cluster.example.com`))

get_cluster_short = i18n.T(`Get one or many clusters.`)

// Warning for --full. Since we are not using the template from kubectl
// we have to have zero white space before the comment characters otherwise
// output to stdout is going to be off.
get_cluster_full_warning = i18n.T(`
//
// WARNING: Do not use a '--full' cluster specification to define a Kubernetes installation.
Copy link
Member

Choose a reason for hiding this comment

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

Is // a yaml comment? Is this supposed to be a comment?

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 NOT a yaml comment or a JSON comment - deliberately . You want to output text without //?

Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment to get_cluster_full_warning explaining the thought process. It sounds like it is right, but I think you have to explain it.

One problem is that we're no longer outputing valid yaml or json

// You may experience unexpected behavior and other bugs. Use only the required elements
// and any modifications that you require.
//
// Use the following command to retrieve only the required elements:
// $ kop get cluster -o yaml
Copy link
Member

Choose a reason for hiding this comment

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

typo

//

`)
)

type GetClusterOptions struct {
Expand Down Expand Up @@ -121,6 +136,8 @@ func RunGetClusters(context Factory, out io.Writer, options *GetClusterOptions)
if err != nil {
return err
}

fmt.Fprint(out, get_cluster_full_warning)
Copy link
Member

Choose a reason for hiding this comment

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

We also suggested adding an annotation, and blocking use of the yaml until the annotation was removed. Thoughts on this approach vs the annotation approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can but that seems a little funky, we need a warning, regardless. We cannot just add an annotation without a warning and instructions on how to remove

}

switch options.output {
Expand Down