Skip to content

Improve waitPodHealthy error message#38

Merged
dimityrmirchev merged 2 commits intogardener:mainfrom
AleksandarSavchev:improve-waitPodHealthy-error-message
Oct 4, 2023
Merged

Improve waitPodHealthy error message#38
dimityrmirchev merged 2 commits intogardener:mainfrom
AleksandarSavchev:improve-waitPodHealthy-error-message

Conversation

@AleksandarSavchev
Copy link
Copy Markdown
Member

@AleksandarSavchev AleksandarSavchev commented Oct 3, 2023

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

Error messages when encountering pod timeouts while waiting for the pod to reach healthy state were improved.

@AleksandarSavchev AleksandarSavchev requested a review from a team as a code owner October 3, 2023 13:36
@gardener-robot gardener-robot added needs/review size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 3, 2023
Comment thread pkg/kubernetes/pod/pod.go Outdated
return retry.MinorError(fmt.Errorf("pod %s is not yet Running", client.ObjectKeyFromObject(pod).String()))
jsonConditions, err := json.Marshal(pod.Status.Conditions)
if err != nil {
return retry.MinorError(err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return retry.MinorError(err)
return retry.MinorError(fmt.Errorf("failed parsing pod %s status conditions: %w", client.ObjectKeyFromObject(pod).String(), err))

Comment thread pkg/kubernetes/pod/pod.go Outdated

if pod.Status.Phase != corev1.PodRunning {
return retry.MinorError(fmt.Errorf("pod %s is not yet Running", client.ObjectKeyFromObject(pod).String()))
jsonConditions, err := json.Marshal(pod.Status.Conditions)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
jsonConditions, err := json.Marshal(pod.Status.Conditions)
conditions, err := json.Marshal(pod.Status.Conditions)

Copy link
Copy Markdown
Member

@dimityrmirchev dimityrmirchev left a comment

Choose a reason for hiding this comment

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

/lgtm

@dimityrmirchev dimityrmirchev merged commit 4ba61a8 into gardener:main Oct 4, 2023
@AleksandarSavchev AleksandarSavchev deleted the improve-waitPodHealthy-error-message branch February 7, 2024 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants