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

🐛 Detect image issues. #678

Merged
merged 4 commits into from
Jun 27, 2024
Merged

🐛 Detect image issues. #678

merged 4 commits into from
Jun 27, 2024

Conversation

jortel
Copy link
Contributor

@jortel jortel commented Jun 27, 2024

Detect malformed fqin and image pull backoff. When detected, the task is failed and reported with error and event.

Reported as:

events:
    - kind: ImageError
      reason: ImagePullBackOff
      last: 2024-06-27T11:04:14.088026727-07:00
    - kind: PodDeleted
      count: 1
      last: 2024-06-27T11:04:14.126638809-07:00
errors:
    - severity: Error
      description: 'Container (addon) failed: ImagePullBackOff'

Detects:

  • CrashLoopBackOff,
  • ImagePullBackOff
  • CreateContainerConfigError
  • InvalidImageName
  • CreateContainerError

closes: #677

@jortel jortel changed the title 🐛 Detect immage issues. 🐛 Detect image issues. Jun 27, 2024
Signed-off-by: Jeff Ortel <[email protected]>
task/manager.go Outdated
if state.Waiting != nil {
waiting := state.Waiting
reason := strings.ToLower(waiting.Reason)
if strings.Contains(reason, "invalid") || strings.Contains(reason, "backoff") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be better to specifically match ImagePullBackOff and InvalidImageName, if those are the only cases we intend to catch?

Copy link
Contributor Author

@jortel jortel Jun 27, 2024

Choose a reason for hiding this comment

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

Perhaps but I cannot find a const in v1 or core packages and concerned about making the match too narrow should the strings change a little. Also, a little broader match may catch other similar issues.
I cannot find an Enum for all the possible values.

Signed-off-by: Jeff Ortel <[email protected]>
Copy link
Collaborator

@mansam mansam left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
@jortel jortel merged commit 83b8519 into konveyor:main Jun 27, 2024
10 of 11 checks passed
shawn-hurley added a commit that referenced this pull request Jul 3, 2024
dymurray pushed a commit that referenced this pull request Jul 3, 2024
shawn-hurley pushed a commit that referenced this pull request Jul 5, 2024
Re-apply reverted #678  re-based on current main.

---------

Signed-off-by: Jeff Ortel <[email protected]>
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.

[BUG] Task manager does not detect ImagePullBackoff as an error
2 participants