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 'MissingSecret' reason for pending builds #8792

Merged
merged 1 commit into from
Jun 30, 2016

Conversation

mfojtik
Copy link
Contributor

@mfojtik mfojtik commented May 9, 2016

Fixes: #6781

When you have a build configuration and you pushing to a private repository in external registry and you set the push secret but the push secret does not exists, we should set the reason for the build to be in the pending state.

This PR will add 'MissingSecret' reason for such build. This will be displayed next to 'Pending'.

@mfojtik
Copy link
Contributor Author

mfojtik commented May 9, 2016

@bparees @smarterclayton PTAL

// When build is in pending state due to missing pull secrets for the image
// indicate this condition in reason.
if secret := build.Spec.Output.PushSecret; secret != nil {
if bc.SecretClient.Secrets(build.Namespace).Get(secret.Name); err != nil && errors.IsNotFound(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

how often is this going to get called? you should probably not fetch the secrets if the reason is already set to status missing secret.

// StatusReasonMissingSecret indicates that the build is missing required
// secret for pushing the output image. The build will stay in the pending
// state until the secret is not created or the build timeout.
StatusReasonMissingSecret = "MissingSecret"
Copy link
Contributor

Choose a reason for hiding this comment

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

MissingPushSecret unless we're going to reuse this for missing source secrets and missing pull secrets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bparees it would be nice to re-use it, do you want to create special reason for each secret or have one generic?

Copy link
Contributor

Choose a reason for hiding this comment

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

it's more informative to the user if it's specific to which secret is missing.

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 20, 2016

@smarterclayton @bparees fixed && rebased PTAL

[test]

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 20, 2016

@bparees @smarterclayton updated.


// StatusReasonMissingPushSecret indicates that the build is missing required
// secret for pushing the output image. The build will stay in the pending
// state until the secret is not created or the build timeout.
Copy link
Contributor

Choose a reason for hiding this comment

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

"The build will stay in the pending state until the secret is created, or the build times out."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

@mfojtik mfojtik force-pushed the pending-secrets branch 4 times, most recently from 42cb57b to e9670ec Compare June 27, 2016 10:28
@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 27, 2016

@bparees ptal

nextStatus = buildapi.BuildPhaseRunning
case kapi.PodPending:
nextStatus = buildapi.BuildPhasePending
Copy link
Contributor

Choose a reason for hiding this comment

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

needs to set build.Status.Reason="" first, to ensure the old reason (if any) is cleared, if we change the state to pending and do not have a pushsecret issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, but it will also interfere with the check of the reason is StatusReasonMissingPushSecret to skip the secret fetching... I cached the original reason, so it should be fine now.

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to ba73984

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5539/)

@bparees
Copy link
Contributor

bparees commented Jun 29, 2016

lgtm but you appear to have some test issues.

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 30, 2016

@bparees seems like a flake: #9457

[merge]

@bparees
Copy link
Contributor

bparees commented Jun 30, 2016

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Jun 30, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5649/) (Image: devenv-rhel7_4495)

@bparees
Copy link
Contributor

bparees commented Jun 30, 2016

[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to ba73984

@openshift-bot openshift-bot merged commit 8aaba51 into openshift:master Jun 30, 2016
@mfojtik mfojtik deleted the pending-secrets branch September 5, 2018 21:07
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.

4 participants