-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[k8s] Calling WaitUntilDeploymentAvailable can cause a panic #1329
Labels
bug
Something isn't working
Comments
antoninbas
added a commit
to antoninbas/antrea-ui
that referenced
this issue
Aug 9, 2023
WaitUntilDeploymentAvailable can sometimes panic if called too quickly after creating the Deployment. We add a short sleep to avoid the issue. See gruntwork-io/terratest#1329 Signed-off-by: Antonin Bas <[email protected]>
antoninbas
added a commit
to antoninbas/terratest
that referenced
this issue
Aug 9, 2023
The `func (err DeploymentNotAvailable) Error()` method should not assume that `Status.Conditions[0]` is always valid for the Deployment. Fixes gruntwork-io#1329 Signed-off-by: Antonin Bas <[email protected]>
4 tasks
antoninbas
added a commit
to antoninbas/terratest
that referenced
this issue
Aug 9, 2023
The `func (err DeploymentNotAvailable) Error()` method should not assume that `Status.Conditions[0]` is always valid for the Deployment. Fixes gruntwork-io#1329 Signed-off-by: Antonin Bas <[email protected]>
antoninbas
added a commit
to antrea-io/antrea-ui
that referenced
this issue
Aug 9, 2023
WaitUntilDeploymentAvailable can sometimes panic if called too quickly after creating the Deployment. We add a short sleep to avoid the issue. See gruntwork-io/terratest#1329 Signed-off-by: Antonin Bas <[email protected]>
antoninbas
added a commit
to antoninbas/terratest
that referenced
this issue
Aug 10, 2023
The `func (err DeploymentNotAvailable) Error()` method should not assume that `Status.Conditions[0]` is always valid for the Deployment. Fixes gruntwork-io#1329 Signed-off-by: Antonin Bas <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Calling
k8s.WaitUntilDeploymentAvailable
too early can cause a panic.If the function is called too quickly after the Deployment was created, a panic can occur because
Status.Conditions
have not been populated yet.This code assumes that
Status.Conditions[0]
is always valid:terratest/modules/k8s/errors.go
Lines 70 to 78 in 2df0170
To Reproduce
Something like this can reproduce the issue (with a Helm chart that includes a Deployment), but it won't happen very often as the failure is timing-dependent.
Expected behavior
Calling
k8s.WaitUntilDeploymentAvailable
should never cause the test to panic.The implementation of
DeploymentNotAvailable
should be updated to remove the assumption thatStatus.Conditions[0]
always exists.Nice to have
Here are some logs of a panic happening during a test:
Versions
The text was updated successfully, but these errors were encountered: