-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Disallow using dots(.) in param names #4797
Comments
Hmmm...given that the dot notation this is already part of the beta API, I'm not sure we can immediately remove it given our deprecation policy: https://github.com/tektoncd/pipeline/blob/main/api_compatibility_policy.md#backwards-incompatible-changes But I do agree - without this object params is tricky |
There are two checkings for |
cc @mattmoor I'd definitely prefer not to break users, even if they're technically doing something that was recommended against but actually supported. Since object-type results/params are coming, I think we could just support |
This was already discussed extensively in the TEP to support dots: tektoncd/community#503. This comment in particular is relevant: tektoncd/community#503 (comment), quoting the relevant excerpt:
|
Hi @vdemeester , |
It turns out there is no conflicts for such case because param names that contain dots can only be referenced with bracket notation. Updated in the TEP-0075 |
Proposal: Disallow using dots(.) in param names
This doc mentioned that the parameter names should follow the following rules. (But we do not enforce it currently - reported here #4792 )
But we need to disallow the usage of dots(.) in param names.
Reason:
TEP-0075 proposes supporting object/dictionary type parameters that will have keys defined in
properties
section. See the parameterfoo
in the following example. And to reference a particular field in this object parameter we can use dot notation i.e.$(params.foo.key1)
, which is mentioned here.This reference approach for a key of the object parameter will have conflicts when it appears together with a parameter whose name contains dot(.) such as
foo.key1
. For example, when we use$(params.foo.key1)
, it's impossible to know whether it's referencing the particular keykey1
of the object parameter namedfoo
OR it's referencing a standalone parameter namedfoo.key1
. This confusion is caused by the fact that containing a dot in parameter name is allowed currently.Therefore, we should not allow to use dot(.) in parameter names.
The text was updated successfully, but these errors were encountered: