Skip to content

OCPBUGS-65634: UPSTREAM: <carry>: add service account to curl job#653

Open
ehearne-redhat wants to merge 1 commit intoopenshift:mainfrom
ehearne-redhat:add-service-account-curl-job-2
Open

OCPBUGS-65634: UPSTREAM: <carry>: add service account to curl job#653
ehearne-redhat wants to merge 1 commit intoopenshift:mainfrom
ehearne-redhat:add-service-account-curl-job-2

Conversation

@ehearne-redhat
Copy link
Contributor

This PR addresses the revert that occurred in #638 .

We believe the changes should ensure the Pending state of verify pods does not happen, because:

  1. There is one DeferCleanup() block being used to handle job and service account cleanup.
  2. The job is forcefully deleted, with deletePolicy := metav1.DeletePropagationForeground ensuring all dependent pods (which there should be only one) are deleted and gracePeriod := int64(0) ensuring an instant deletion. The job can be forcefully deleted, because DeferCleanup() would not occur unless the job successfully ran.
  3. The Eventually() block between the job deletion and service account deletion will prevent service account deletion from occurring if there was an issue with deleting the job. This means that any pods still running associated with that job should not get stuck in a Pending state for service account related reasons.

We are hopeful that the following changes should not cause a revert, and it should be using proper commit message formatting.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 2, 2026
@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 2, 2026
@openshift-ci-robot
Copy link

@ehearne-redhat: This pull request references Jira Issue OCPBUGS-65634, which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is Verified instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This PR addresses the revert that occurred in #638 .

We believe the changes should ensure the Pending state of verify pods does not happen, because:

  1. There is one DeferCleanup() block being used to handle job and service account cleanup.
  2. The job is forcefully deleted, with deletePolicy := metav1.DeletePropagationForeground ensuring all dependent pods (which there should be only one) are deleted and gracePeriod := int64(0) ensuring an instant deletion. The job can be forcefully deleted, because DeferCleanup() would not occur unless the job successfully ran.
  3. The Eventually() block between the job deletion and service account deletion will prevent service account deletion from occurring if there was an issue with deleting the job. This means that any pods still running associated with that job should not get stuck in a Pending state for service account related reasons.

We are hopeful that the following changes should not cause a revert, and it should be using proper commit message formatting.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from grokspawn and jianzhangbjz March 2, 2026 14:27
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ehearne-redhat
Once this PR has been reviewed and has the lgtm label, please assign jianzhangbjz for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ehearne-redhat ehearne-redhat force-pushed the add-service-account-curl-job-2 branch from 10893ab to 44e5264 Compare March 2, 2026 14:46
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

@ehearne-redhat: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ehearne-redhat ehearne-redhat changed the title [WIP] OCPBUGS-65634: UPSTREAM: <carry>: add service account to curl job OCPBUGS-65634: UPSTREAM: <carry>: add service account to curl job Mar 3, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 3, 2026
// Create the Job
job := buildCurlJob(jobNamePrefix, "default", serviceURL, serviceAccount.Name)
err = k8sClient.Create(ctx, job)
Expect(err).NotTo(HaveOccurred(), "failed to create Job")
Copy link
Contributor

Choose a reason for hiding this comment

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

as it stands, you might have the service account hanging around if there is an issue creating the job. If we have something deleting the namespace, then that will likely clean up the service account. We may want to either add a comment to call this out, or if there is an error creating the job, delete the service account before raising the error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it is possible to delete the default ns.

ehearne-mac:~ ehearne$ kubectl delete ns default
Error from server (Forbidden): namespaces "default" is forbidden: this namespace may not be deleted

If we were to move the job to a separate namespace just for running the jobs, and then when they are all done, delete the ns, then we can clean up completely.

Otherwise we could delete the service account when there is an error creating.

@ehearne-redhat
Copy link
Contributor Author

/payload-aggregate 4.22 10

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 3, 2026

@ehearne-redhat: trigger 0 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

@ehearne-redhat
Copy link
Contributor Author

/test ?

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 3, 2026

@ehearne-redhat: The following commands are available to trigger required jobs:

/test bindata-check
/test check-sync-pr-valid
/test default-catalog-consistency
/test e2e-aws-olmv1-ext
/test e2e-aws-techpreview-olmv1-ext
/test e2e-gcp-ovn-upgrade
/test images
/test okd-scos-images
/test openshift-e2e-aws
/test tests-extension
/test unit
/test verify
/test verify-commits
/test verify-deps

The following commands are available to trigger optional jobs:

/test okd-scos-e2e-aws-ovn
/test openshift-e2e-aws-techpreview

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-operator-framework-operator-controller-main-check-sync-pr-valid
pull-ci-openshift-operator-framework-operator-controller-main-e2e-aws-olmv1-ext
pull-ci-openshift-operator-framework-operator-controller-main-e2e-aws-techpreview-olmv1-ext
pull-ci-openshift-operator-framework-operator-controller-main-e2e-gcp-ovn-upgrade
pull-ci-openshift-operator-framework-operator-controller-main-images
pull-ci-openshift-operator-framework-operator-controller-main-okd-scos-images
pull-ci-openshift-operator-framework-operator-controller-main-openshift-e2e-aws
pull-ci-openshift-operator-framework-operator-controller-main-tests-extension
pull-ci-openshift-operator-framework-operator-controller-main-unit
pull-ci-openshift-operator-framework-operator-controller-main-verify
pull-ci-openshift-operator-framework-operator-controller-main-verify-commits
pull-ci-openshift-operator-framework-operator-controller-main-verify-deps
Details

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ehearne-redhat
Copy link
Contributor Author

/payload-aggregate openshift-e2e-aws 10

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 3, 2026

@ehearne-redhat: trigger 0 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

@ehearne-redhat
Copy link
Contributor Author

/payload-aggregate pull-ci-openshift-operator-framework-operator-controller-main-openshift-e2e-aws 10

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 3, 2026

@ehearne-redhat: trigger 0 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

@ehearne-redhat
Copy link
Contributor Author

/payload-aggregate ?

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 3, 2026

@ehearne-redhat: it appears that you have attempted to use some version of the payload command, but your comment was incorrectly formatted and cannot be acted upon. See the docs for usage info.

@ehearne-redhat
Copy link
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-aws-ovn-upgrade 10

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 3, 2026

@ehearne-redhat: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-aws-ovn-upgrade

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/aa6f9100-16eb-11f1-8196-e62b76003c3a-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants