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

Improve owner missing error message #1747

Merged
merged 4 commits into from
Aug 27, 2021

Conversation

matthchr
Copy link
Member

Closes #1455

What this PR does / why we need it:
Improves the message when the owner is missing or wrong. It now reads:

NAME           READY   REASON            MESSAGE
samplesubnet   False   WaitingForOwner   Owner "default/aso-sample-rg, GroupKind: microsoft.network.azure.com/VirtualNetwork" cannot be found. Progress is blocked until the owner is created.

This still isn't perfect because it doesn't explicitly say: "You gave us something that points to the wrong type", but that's actually pretty hard to do because Kubernetes allows multiple resources (of different Kind's) to have the same name, so it could be a coincidence that the owner they're looking for just so happens to have the same name as some other resource in the cluster in that same namespace.

I think this message should be pretty clear still though as we list the specific type we're looking for in addition to namespace/name, so they should be able to easily kubectl get <kind> -n <namespace> and realize the resource we're looking for isn't there.

@matthchr
Copy link
Member Author

@Porges interested in your thoughts here as you filed #1455 originally.

@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2021

Codecov Report

Merging #1747 (1bdf759) into master (943f298) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1747   +/-   ##
=======================================
  Coverage   42.11%   42.11%           
=======================================
  Files         309      309           
  Lines       89877    89877           
=======================================
  Hits        37851    37851           
  Misses      48699    48699           
  Partials     3327     3327           
Impacted Files Coverage Δ
hack/generated/controllers/generic_controller.go 78.37% <100.00%> (ø)
...g/genruntime/conditions/ready_condition_builder.go 100.00% <100.00%> (ø)
...ack/generated/pkg/genruntime/resource_reference.go 89.18% <100.00%> (ø)
...ted/pkg/reconcilers/azure_deployment_reconciler.go 66.74% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 943f298...1bdf759. Read the comment docs.

@Porges
Copy link
Member

Porges commented Aug 26, 2021

Looks much nicer!

Copy link
Member

@theunrepentantgeek theunrepentantgeek left a comment

Choose a reason for hiding this comment

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

Looks good. Nice improvement.

gif

return b.builder.MakeFalseCondition(
ConditionTypeReady,
ConditionSeverityWarning,
ReasonWaitingForOwner,
"The owner of this resource cannot be found in Kubernetes. Process is blocked until the owner is created.")
fmt.Sprintf("Owner %q cannot be found. Progress is blocked until the owner is created.", ownerDetails))
Copy link
Member

Choose a reason for hiding this comment

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

👍 for actually naming the thing that can't be found.

@matthchr matthchr merged commit a7a086d into Azure:master Aug 27, 2021
@matthchr matthchr deleted the feature/owner-error branch August 27, 2021 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using wrong owner type doesn't give a helpful message
4 participants