Skip to content

feat(charts): allow auto workflows to set own posixuid#1364

Merged
JamesDoingStuff merged 1 commit into
mainfrom
jg/posixuid-for-events
Jun 3, 2026
Merged

feat(charts): allow auto workflows to set own posixuid#1364
JamesDoingStuff merged 1 commit into
mainfrom
jg/posixuid-for-events

Conversation

@JamesDoingStuff
Copy link
Copy Markdown
Contributor

@JamesDoingStuff JamesDoingStuff commented Jun 2, 2026

AP-1110

I had to remove the pipe expressions from the JMESPath in the policy - they don't seem to work with the || operator. Possibly a kyverno bug, as they seem to behave as one would expect in the JMESPath tutorial/playground.

If identity-mapper changes related to AP-1140 are merged in before this, then that policy will need updating instead in a similar way to how workflow-label-clusterpolicy is here e.g.

context:
     - name: posixUidString
       variable:
         value: "{{`{{ request.userInfo.extra.\"workflows.diamond.ac.uk/posixuid\"[0] || request.object.metadata.labels.\"workflows.diamond.ac.uk/machine-uid\" }}`}}"

@JamesDoingStuff JamesDoingStuff self-assigned this Jun 2, 2026
@JamesDoingStuff JamesDoingStuff force-pushed the jg/posixuid-for-events branch 3 times, most recently from 7f729f9 to 4309ce9 Compare June 2, 2026 12:05
@JamesDoingStuff JamesDoingStuff marked this pull request as ready for review June 2, 2026 12:13
@JamesDoingStuff JamesDoingStuff force-pushed the jg/posixuid-for-events branch from 4309ce9 to 89bb3c6 Compare June 2, 2026 12:28
Comment thread charts/workflows/templates/workflow-label-clusterpolicy.yaml
@TBThomas56
Copy link
Copy Markdown
Contributor

Could be worth adding a validating rule that rejects workflows that carry a machine-uid label unless submitted by a trusted Service account? maybe the events metacontroller?

@JamesDoingStuff
Copy link
Copy Markdown
Contributor Author

@TBThomas56 I like that idea. The fact that we create the EventSources (which are where the machine-uids are defined) combined with the logic @davehadley pointed out should mean that it's already impossible to create a job with any old account, but it can't hurt to have a fail-safe like that. Would you be happy if I merge this as-is and then add that in once #1366 is done?

@TBThomas56
Copy link
Copy Markdown
Contributor

@TBThomas56 I like that idea. The fact that we create the EventSources (which are where the machine-uids are defined) combined with the logic @davehadley pointed out should mean that it's already impossible to create a job with any old account, but it can't hurt to have a fail-safe like that. Would you be happy if I merge this as-is and then add that in once #1366 is done?

Yep! That makes sense!

@JamesDoingStuff JamesDoingStuff merged commit 2dd761c into main Jun 3, 2026
57 checks passed
@JamesDoingStuff JamesDoingStuff deleted the jg/posixuid-for-events branch June 3, 2026 08:15
@davehadley
Copy link
Copy Markdown
Collaborator

davehadley commented Jun 3, 2026

Yes, I agree with Thomas's suggestion. Also with James plan of splitting it into small incremental PRs. 👍

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.

3 participants