Skip to content

Comments

Normalize clusterctl options to underscores#899

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
pivotal-k8s:clusterctl-normalize-underscores
Apr 16, 2019
Merged

Normalize clusterctl options to underscores#899
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
pivotal-k8s:clusterctl-normalize-underscores

Conversation

@astrieanna
Copy link
Contributor

@astrieanna astrieanna commented Apr 15, 2019

What this PR does / why we need it:
Currently, clusterctl has inconsistent global cli flag names. This is not really the fault of clusterctl: the flags come from klog. kubectl also uses these flags from klog, but it sets a normalization function so that all flags use dashes (rather than underscores).

This allows for backwards compatibility because the old names with underscores continue to work, but cleans up the help output and makes the flag names more predictable. While kubectl adds warnings for the old, underscore names, this PR does not add the warnings. The old names will just silently work.

Release note:

clusterctl's global logging flags now consistently use dashes (no underscores). The changes are as follows:
  --log_backtrace_at -> --log-backtrace-at
  --log_dir          -> --log-dir
  --log_file         -> --log-file
  --skip_headers     -> --skip-headers

cc @dpb587-pivotal

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 15, 2019
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

One comment, otherwise LGTM

@astrieanna Could we document the CLI changes, if any?

/approve
/assign @detiber

Gopkg.toml Outdated
version="v1.4.7"

[[constraint]]
branch = "master"
Copy link
Member

Choose a reason for hiding this comment

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

This should probably use a version, could we make sure that this dependency it's not already vendored via controller-runtime? I'd prefer to not add new constraint if they are already implicit, especially if they are tied to a k8s version.

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've removed it as a constraint in favor of implicit. When we ran dep ensure, it needed to add k8s.io/component-base as a new vendor subtree, so we don't believe it was already referenced by controller-runtime.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astrieanna, vincepri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 15, 2019
@vincepri
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Apr 15, 2019
Matches current conventions and implementation of kubectl.
This change does not include warning messages when using the previous,
underscore option names, but it does recognize those names.

Co-authored-by: Leah Hanson <lhanson@pivotal.io>
@astrieanna
Copy link
Contributor Author

CLI changes:

      --log_backtrace_at -> --log-backtrace-at
      --log_dir          -> --log-dir
      --log_file         -> --log-file
      --skip_headers     -> --skip-headers

@vincepri where would you want these changes to get documented? (I'm not sure that these are even documented in clusterctl currently, since they're byproducts of using klog.)

@vincepri
Copy link
Member

@astrieanna It'd be good to add those changes to the release notes above so when we go through the changes/PRs in the next release we can reference it

pruneopts = "UT"
revision = "3a2206dd6a78497deceb3ae058417fdeb2036c7e"

[[projects]]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why Gopkg.lock was updated but Gopkg.toml was not? I think we do not need to update Gopkg.lock but it should be updated by dep ensure?

Also for such PR, it is better have two commits for better review. One for you manually updated code, and another for auto-generated code via dep ensure.

Copy link
Contributor

Choose a reason for hiding this comment

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

Gopkg.lock was updated because it's a new implicit dependency pulled in by import rather than being explicitly added as a constraint in Gopkg.toml I would suspect that running dep ensure is what updated Gopkg.lock here.

I do agree that in general that having dependency updates in a separate commit helps reviews, but in this case the diff is relatively small, so I don't consider it blocking review here.

@detiber
Copy link
Contributor

detiber commented Apr 16, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 16, 2019
@k8s-ci-robot k8s-ci-robot merged commit c262415 into kubernetes-sigs:master Apr 16, 2019
@detiber detiber mentioned this pull request Apr 16, 2019
detiber pushed a commit to detiber/cluster-api that referenced this pull request May 2, 2019
Matches current conventions and implementation of kubectl.
This change does not include warning messages when using the previous,
underscore option names, but it does recognize those names.

Co-authored-by: Leah Hanson <lhanson@pivotal.io>
k8s-ci-robot pushed a commit that referenced this pull request May 2, 2019
* Update CRDs (#863)

Generated with `make generate`

* fix various shell bugs (#868)

* fix errors in scripts/ci-build.gitsh

* fix errors in scripts/ci-integration.sh

* fix errors in scripts/ci-is-vendor-in-sync.sh

* fix errors in scripts/ci-make.sh

* fix errors in scripts/ci-test.sh

* removed unused variables from scripts/fetch_ext_bins.sh

* fix errors in hack/update-bazel.sh

* fix errors in hack/verify_clientset.sh

* use gnu sed on all platforms (#867)

* Fix error message in getCluster (#871)

Previously it was showing 'Machine foo in namespace "cluster.k8s.io/cluster-name" doesn't specify "k8s-machine-api"  label, assuming nil cluster'

* minikube: use --profile instead of --p (#875)

It was reported that "minikube start" fails:
  minikube start --bootstrapper=kubeadm --p=clusterapi
  Error: unknown flag: --p

From "minikube start --help":
  -p, --profile string

Use --profile in minikube.go as --p does not work.
The alternative is -p.

* nit: fix log to replace Creating with Preparing (#872)

saw this log with following flag
--bootstrap-cluster-kubeconfig /root/.kube/config

I0403 17:32:28.339021   31615 createbootstrapcluster.go:27] Creating bootstrap cluster

actually we are reusing ,not creating

* Record machine sync error event (#880)

* make clusterapi wait timeout configurable (#865)

add an environment to make timeout configurable
for timeoutMachineReady

* Update klog to 0.3.0 release (#890)

Signed-off-by: Vince Prignano <vincepri@vmware.com>

* Add missing namespace to Get function (#896)

* Add NodeName to Machine's additionalPrinterColumns (#895)

Because it is useful to cross-reference between Machines and Nodes.

Set priority to >0 so that node names will only be displayed in `-o wide` because the names are often quite long.

* additionalPrinterColumns for Machine, added correctly. (#897)

Co-authored-by: Danny Berger <dberger@pivotal.io>

* Normalize clusterctl options to underscores (#899)

Matches current conventions and implementation of kubectl.
This change does not include warning messages when using the previous,
underscore option names, but it does recognize those names.

Co-authored-by: Leah Hanson <lhanson@pivotal.io>

* Update manager-role ClusterRole (#901)

* Update Go 1.12 (#898)

* Update Go 1.12

Signed-off-by: Vince Prignano <vincepri@vmware.com>

* update

Signed-off-by: Vince Prignano <vincepri@vmware.com>

* Update OWNERS_ALIASES and SECURITY_CONTACTS (#884)

* Update OWNERS_ALIASES and SECURITY_CONTACTS

* Add davidewatson to cluster-api-admins

* Clarify log message for machine-controller isDeleteAllowed (#905)

Users have noted that this log message is confusing and
does not lead to a clear path forward when deleting this
machine.

This commit makes it clear that the machine will not be
deleted.

* Clarify MachineDeployment watchers' comments (#887)

Signed-off-by: Vince Prignano <vincepri@vmware.com>

* Simplify util.ParseMachinesYaml (#909)

Signed-off-by: Vince Prignano <vincepri@vmware.com>

* Add support for passing namespace cmdline flag to the manager (#914)

* Bump kubectl version to v1.13.2 in ci (#923)

kubectl v1.10.2 does not compatible with cluster v1.14.x anymore

Signed-off-by: Hui Luo <luoh@vmware.com>

* Add /status to MachineSet and MachineDeployment kubebuilder directives (#922)

Signed-off-by: Vince Prignano <vincepri@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants