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

Add more log for cluster deletion failure #978

Merged
merged 1 commit into from
Jun 5, 2019

Conversation

jichenjc
Copy link
Contributor

@jichenjc jichenjc commented Jun 3, 2019

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #977

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:


@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 3, 2019
@k8s-ci-robot k8s-ci-robot requested review from detiber and vincepri June 3, 2019 04:21
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 3, 2019
Copy link
Member

@detiber detiber left a comment

Choose a reason for hiding this comment

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

I love the idea of adding additional logging context for debugging, but I think the current proposed messages might be a bit confusing.

@@ -754,43 +754,53 @@ func (c *client) WaitForResourceStatuses() error {
klog.V(2).Info("Waiting for Cluster API resources to have statuses...")
clusters, err := c.clientSet.ClusterV1alpha1().Clusters("").List(metav1.ListOptions{})
if err != nil {
klog.V(10).Infof("error list clusters:", err)
Copy link
Member

Choose a reason for hiding this comment

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

This message seems a bit confusing, since they are logged at Info level, but start with "error". Maybe something along the lines of: Infof("retrying, failed to list clusters: ", err) instead?

Copy link
Contributor Author

@jichenjc jichenjc Jun 4, 2019

Choose a reason for hiding this comment

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

works for me , thank you~

return false, nil
}
for _, cluster := range clusters.Items {
if reflect.DeepEqual(clusterv1.ClusterStatus{}, cluster.Status) {
klog.V(10).Infof("retrying: cluster status is empty")
Copy link
Member

Choose a reason for hiding this comment

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

Test failures are related to using Infof without additional arguments, so this line and others like it should use Info instead.

Suggested change
klog.V(10).Infof("retrying: cluster status is empty")
klog.V(10).Info("retrying: cluster status is empty")

return false, nil
}
if cluster.Status.ProviderStatus == nil {
klog.V(10).Infof("retrying: cluster.Status.ProviderStatus is not set")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
klog.V(10).Infof("retrying: cluster.Status.ProviderStatus is not set")
klog.V(10).Info("retrying: cluster.Status.ProviderStatus is not set")

return false, nil
}
for _, md := range machineDeployments.Items {
if reflect.DeepEqual(clusterv1.MachineDeploymentStatus{}, md.Status) {
klog.V(10).Infof("retrying: machine deployment status is empty")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
klog.V(10).Infof("retrying: machine deployment status is empty")
klog.V(10).Info("retrying: machine deployment status is empty")

return false, nil
}
for _, ms := range machineSets.Items {
if reflect.DeepEqual(clusterv1.MachineSetStatus{}, ms.Status) {
klog.V(10).Infof("retrying: machineset status is empty")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
klog.V(10).Infof("retrying: machineset status is empty")
klog.V(10).Info("retrying: machineset status is empty")

return false, nil
}
if m.Status.ProviderStatus == nil {
klog.V(10).Infof("retrying: machine.Status.ProviderStatus is not set")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
klog.V(10).Infof("retrying: machine.Status.ProviderStatus is not set")
klog.V(10).Info("retrying: machine.Status.ProviderStatus is not set")

@jichenjc
Copy link
Contributor Author

jichenjc commented Jun 5, 2019

ok, I should have a test before submit as I thought this is a simple one... sorry for that
just updated

@detiber
Copy link
Member

detiber commented Jun 5, 2019

/lgtm
/assign @vincepri

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 5, 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.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

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 Jun 5, 2019
@k8s-ci-robot k8s-ci-robot merged commit 30a6532 into kubernetes-sigs:master Jun 5, 2019
detiber pushed a commit to detiber/cluster-api that referenced this pull request Jun 6, 2019
detiber pushed a commit to detiber/cluster-api that referenced this pull request Jun 6, 2019
k8s-ci-robot pushed a commit that referenced this pull request Jun 7, 2019
* Adding steps for how to use existing cluster as bootstrap cluster. (#877)

* Add proposals template (#879)

Signed-off-by: Vince Prignano <[email protected]>

* Clarify how to use kuebconfig. (#869)

* Add discuss link to README (#885)

Signed-off-by: Vince Prignano <[email protected]>

* Fix a broken link to Cluster API KEP (#900)

* Add Cluster API project scope and objectives (#882)

Signed-off-by: Vince Prignano <[email protected]>

* Fix API group name written in kubebuilder's annotation comments (#883)

* Update github org for the baremetal provider. (#911)

The github org was renamed, so use the new URL for the location of the
bare metal cluster-api provider.

* Add Talos to list of providers (#915)

* Add reference use cases for Cluster API (#903)

Signed-off-by: Vince Prignano <[email protected]>

* Add missing bullet point to staging-use-cases.md (#920)

* Added IBM Cloud to Cluster API README. (#928)

* Update documentation links to published content (#927)

* Add Cluster API logos from CNCF (#916)

* Adding Reference Use Cases to README. (#931)

* Updating release docs for branching approach now that we are 0.x (#862)

I think the previous approach was for pre-versioned branches, but now
we probably want to start maintaining release branches - even if in
practice we would cut 0.2.0 instead of 0.1.1

* Used doctoc generated toc. (#932)

* Update to go 1.12.5 (#937)

* Attempt to fix integration tests (#942)

- Use specific versions of kind and kustomize instead of installing
  with `go get`
- Update golang version for example provider

* Update README.md (#941)

* Add shortnames for crds. (#943)

* Fix machine object pivoting to the target cluster (#944)

* [docs] Update RBAC annotations for example provider (#947)

* Remove workstreams from scope and objectives (#948)

Signed-off-by: Vince Prignano <[email protected]>

* Added ibm cloud to architecture diagram. (#946)

* Added comment about cluster API vs cloud providers to readme (#954)

* Quit MachineSet reconcile early if DeletionTimestamp is set (#956)

Signed-off-by: Vince Prignano <[email protected]>

* Cleanup controllers (#958)

Signed-off-by: Vince Prignano <[email protected]>

* updates Google Cloud branding to mach other usages (#973)

* Cannot retrieve machine name (#960)

Signed-off-by: clyang82 <[email protected]>

* Allow to use foregroundDeletion for MachineDeployments and MachineSets (#953)

* Rename controllers test files (#968)

Signed-off-by: Vince Prignano <[email protected]>

* make cluster-api-manager container run with a non-root user (#955)

* Update Gitbook release process (#659)

* Remove mermaid module because it is currently unused and does not
always install cleanly.

* Introduce npm-shrinkwrap so that npm installations are reproducable.

* Update gitbook release documentation.

* Clarify verification instructions.

* Update GitBook.

* Remove rendered Gitbook from repo in preparation for using firebase
instead.

* Install gitbook cli.

* Update documentation for netlify.

* Add Netlify configuration toml.

* Update link to homepage so that it points to the book and not
the GitHub repository.

* Remove base from netlify.toml. The build script already accounts
for the correct location...

* Remove reference to no longer existent KEP. :(

* Disable redirects until the cluster-api.sigs.k8s.io domain has
been created.

* Reenable netlify redirects now that the cluster-api.sigs.k8s.io
domain exists.

* Add versioning and releases to README (#967)

Signed-off-by: Vince Prignano <[email protected]>

* Add more log for cluster deletion failure (#978)

* Update dependencies (#982)

Signed-off-by: Vince Prignano <[email protected]>
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add more log for cluster deletion failed
4 participants