Skip to content

Conversation

@saintstack
Copy link
Contributor

@saintstack saintstack commented Jun 4, 2025

Add 'if [[ "${job_prefix_from_pod}" =~ ^${AGENT_NAME}-[0-9]+(-[0-9]+)?$ ]]' check before delete.

As it was, we were emitting the below:

=== Deleting Job joshua-rhel9-job-cleanup ===

  • kubectl delete job joshua-rhel9-job-cleanup -n default Error from server (NotFound): jobs.batch "joshua-rhel9-job-cleanup" not found

Harmless but noisy.

To test the PR, I ran the patched version beside the current version: the patched version no longer had messages like the above (while it cleaned up finished pods).

Add 'if [[ "${job_prefix_from_pod}" =~ ^${AGENT_NAME}-[0-9]+(-[0-9]+)?$ ]]'
check before delete.

As it was, we were emitting the below:

  === Deleting Job joshua-rhel9-job-cleanup ===
  + kubectl delete job joshua-rhel9-job-cleanup -n default
  Error from server (NotFound): jobs.batch "joshua-rhel9-job-cleanup" not found

Harmless but noisey.
@saintstack saintstack requested a review from kakaiu June 4, 2025 14:25
echo "=== Deleting Job based on pod status: $job_prefix_from_pod === (AGENT_NAME: ${AGENT_NAME})"
kubectl delete job "$job_prefix_from_pod" -n "${namespace}" --ignore-not-found=true
else
# This case can occur if AGENT_NAME is unusual (e.g., 'foo-bar' and a pod 'foo-bar-baz-TIMESTAMP-...' exists)
Copy link

@kakaiu kakaiu Jun 4, 2025

Choose a reason for hiding this comment

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

Why will we have an unusual AGENT_NAME? Is this common?

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should not happen. We have only Joshua-agent and Joshua-rhel9-agent for AGENT_NAME....

@kakaiu kakaiu self-requested a review June 4, 2025 18:16
@saintstack saintstack merged commit fe73372 into FoundationDB:main Jun 4, 2025
2 checks passed
saintstack pushed a commit to saintstack/fdb-joshua that referenced this pull request Jun 4, 2025
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.

2 participants