-
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
Change TaskRef
to string instead of a struct with just one field.
#166
Conversation
Right now, the `TaskRef` struct only declares field `Name`. Defining a struct for a just 1 field makes yaml longer. In attempt to make the pipleine config concise, this PR remoes `TaskRef` and replaces it with a string. In future if we decide to add other fields like APIVersion, we can write reference it as "<taskname>:<version>". Right now APIVersion is not declared and used at all, so removing it.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tejal29 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@tejal29: The following tests failed, say
Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
I'm not sure we should go ahead with this - it does simplify the yaml but it also:
I don't feel like I'm even approaching being an expert on this topic tho so maybe @dlorenc @imjasonh @jonjohnsonjr could chime in? Re. the kubernetes conventions:
|
/hold |
@tejal29 : Object references are made in a separate struct because it needs API version and reference name. In TaskRef struct looks like API Version is missing, I would recommend adding that to struct and hold on to current yaml structure instead of removing the reference struct. Ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#objectreference-v1-core If this change is implemented then you cannot refer to an object with different API version, I agree there are no multiple versions now but in future it might be the case. |
agree with @shashwathi and @bobcatfish, if we remove the struct, then we can't have an API version in the future |
kk sounds like we probably want to leave this as it is for now then. @tejal29 you also mentioned possibly encoding the version (and I guess eventually type) in the name field as well, but I think that makes this more complicated in the long run - we have to start requiring strings of a certain format and parsing strings vs. trusting the fields |
How about we call it taskName https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#object-references
@shashwathi, @bobcatfish and@pivotal-nader-ziada, how are we going to support |
I'm not sure about versions, but probably different types in the long run, as per knative duck typing.
It doesn't seem significantly more user friendly - we're talking about one level of indentation: The cost would be that if we change this later, we need to either support both (confusing for a user) or introduce a breaking change (bad for a user). I'd rather stick with the k8s standard for object references. |
hmm but |
Oh I see what you're saying, So then I think it comes down to two questions:
If the answer to (2) is not very likely, then let's change all the Maybe we can see what @shashwathi or @pivotal-nader-ziada think now as a tie breaker. |
I have seen both standards used in kubernetes and other knative projects, using object ref allows for more flexibility which I prefer. |
@tejal29 do you mind if we close this for now? |
Disregarding. |
Improve Release documentation
Addresses one of the redundancy for #138
Right now, the
TaskRef
struct only declares fieldName
.Defining a struct for a just 1 field makes yaml longer.
In attempt to make the pipleine config concise, this PR remoes
TaskRef
and replaces it with a string.In future if we decide to add other fields like APIVersion, we can write reference it as ":".
Right now APIVersion is not declared and used at all, so removing it.