-
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
Add cluster and cluster bindings #60
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shashwathi If they are not already assigned, you can assign the PR to them by writing 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 |
@shashwathi it might conflict with the |
@pivotal-nader-ziada : I will update this PR to include /hold |
/test pull-knative-build-pipeline-unit-tests |
/hold cancel Updated with |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few nits and go coding conventions
properties: | ||
clusterName: | ||
type: string | ||
inputName: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, inputName
stands for what input this cluster is bound to? Can you rename it to boundTo
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is auto generated code. If we change the definition, crds should change as well.
// ClusterName is the string that the PipelineParams will use to identify this source. | ||
ClusterName string `json:"clusterName"` | ||
// InputName is the string the Task will use to identify this cluster in its inputs. | ||
InputName string `json:"inputName"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets get ClusterBinding
and SourceBinding
structs fields in sync.
Shd we rename ClusterName
to Key
and also drop SourceKey
to Key
?
SourceBinding.Key
and ClusterBindings.Key
avoids stuttering.
clusterBindings:
-Key: test
Can we consider renaming ClusterBinding.InputName
and SourceBinding.Name
to something like BoundTo
.
We can also define a struct Binding
and then include common fields in those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shd we rename ClusterName to Key and also drop SourceKey to Key ?
I agree with you to stay in sync across these bindings to make the pipeline yaml more readable. I like key
for bindings. 👍
Can we consider renaming ClusterBinding.InputName and SourceBinding.Name to something like
BoundTo
I think keyword bindings
in ClusterBindings
/ SourceBindings
convey that this is templated to an another definition(like task). I think BoundTo
might be redundant.
How about explicitly calling out taskInputName
(since both are bound to tasks) or keep the original key inputName
(more generic)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed key
is a better name the key field
ClusterBinding.InputName
becomesClusterBinding.Key
SourceBinding.SourceKey
becomesSourceBinding.Key
(think this should be a separate PR since this PR here is about addingClusterBinding
)
But since we already have the type name including the word Binding
I feel the field name
should be enough to clarify what it is
eg:
apiVersion: pipeline.knative.dev/v1beta1
kind: Pipeline
metadata:
name: wizzbang-pipeline
namespace: default
spec:
tasks:
- name: 'test'
taskRef:
name: test-wizzbang-task
inputsourceBindings:
- name: repoUnderTest
key: wizzbang <- changed to key in different PR
clusterBindings:
- name: test-cluster <- name of this cluster binding
key: gke-cluster-27 <- key to refer to
.........
- Add clusters to pipelineparams - Add cluster inputs for tasks - Add clusterBindings for Pipelines
2be2627
to
c35f376
Compare
/lgtm |
/lgtm as well @bobcatfish can you please take a look and merge if you think its all good, trying to get the PRs in before #57 makes big changes to the repo to reduce conflicts |
Fixes #21
Addresses the following requirements in issue
/assign @bobcatfish
/assign @pivotal-nader-ziada