You cannot create UI links to our own annotations or labels.
Argo Workflows uses the format workflows.argoproj.io/something for annotations and labels. These annotations and labels have dots (.) in them.
The links documentation says you can access all workflow fields, using a dot to go down into the child entry.
These two conflict making it impossible to access our own labels and annotations, so fix it for annotations and labels.
This was discovered whilst adding an annotation to the workflows that was useful to link from in a separate feature.
Modifications
When splitting the variable name up use a specialised splitting function that understands that things under workflow.metadata.labels and workflow.metadata.annotations are always names and not to split further. It is crude
Verification
Added a unit test for the hit the special code case. There are already unit tests which test the other case.
Fixes #11741
Motivation
You cannot create UI links to our own annotations or labels.
Argo Workflows uses the format
workflows.argoproj.io/something
for annotations and labels. These annotations and labels have dots (.
) in them.The links documentation says you can access all workflow fields, using a dot to go down into the child entry.
These two conflict making it impossible to access our own labels and annotations, so fix it for annotations and labels.
This was discovered whilst adding an annotation to the workflows that was useful to link from in a separate feature.
Modifications
When splitting the variable name up use a specialised splitting function that understands that things under
workflow.metadata.labels
andworkflow.metadata.annotations
are always names and not to split further. It is crudeVerification
Added a unit test for the hit the special code case. There are already unit tests which test the other case.
Manually tested my new link works.