Add domain and realm CRDs#12
Conversation
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
@googlebot I consent. |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
|
/assign @tcnghia |
| func (i *Domain) SetDefaults(ctx context.Context) { | ||
| i.Spec.SetDefaults(apis.WithinSpec(ctx)) | ||
| } |
There was a problem hiding this comment.
| func (i *Domain) SetDefaults(ctx context.Context) { | |
| i.Spec.SetDefaults(apis.WithinSpec(ctx)) | |
| } | |
| func (d *Domain) SetDefaults(ctx context.Context) { | |
| d.Spec.SetDefaults(apis.WithinSpec(ctx)) | |
| } |
| } | ||
|
|
||
| // GetGroupVersionKind returns SchemeGroupVersion of an Ingress | ||
| func (i *Domain) GetGroupVersionKind() schema.GroupVersionKind { |
There was a problem hiding this comment.
| func (i *Domain) GetGroupVersionKind() schema.GroupVersionKind { | |
| func (*Domain) GetGroupVersionKind() schema.GroupVersionKind { |
| // Istio Gateways associated with this Domain. This could be a reference of a ConfigMap | ||
| // owned by the implementation as well. | ||
| // +optional | ||
| Config []map[string]string `json:"config,omitempty"` |
There was a problem hiding this comment.
Some people think we should not use maps in the apis
/cc @mattmoor
There was a problem hiding this comment.
cc @dprotaso can you please suggest the best practice to represent maps here?
There was a problem hiding this comment.
This is an array of maps - is that intended?
best practice to represent maps here?
Maybe a few criteria to think about
Patching
Although, CRDs don't support strategic merge patches the different types help reason about the different patch strategies that could open up in the future (although it's been shut down a bunch of times)
https://pkg.go.dev/k8s.io/kube-openapi/pkg/idl?tab=doc#ListType
https://pkg.go.dev/k8s.io/kube-openapi/pkg/idl?tab=doc#MapType
https://pkg.go.dev/k8s.io/kube-openapi/pkg/idl?tab=doc#StructType
JSON Patch & JSON Merge Patch are applicable to CRDs.
Future extensibility
Right now using an array with maps above don't let you add new typed fields - this may be fine but something to consider.
There was a problem hiding this comment.
For conditions there's also
kubernetes/community#4521 (comment)
There was a problem hiding this comment.
Thanks for detailed explanation @dprotaso. Updated the type to use array.
| // SetDefaults populates default values in Ingress | ||
| func (i *Realm) SetDefaults(ctx context.Context) { | ||
| i.Spec.SetDefaults(apis.WithinSpec(ctx)) | ||
| } |
There was a problem hiding this comment.
| // SetDefaults populates default values in Ingress | |
| func (i *Realm) SetDefaults(ctx context.Context) { | |
| i.Spec.SetDefaults(apis.WithinSpec(ctx)) | |
| } | |
| // SetDefaults populates default values in Ingress | |
| func (r *Realm) SetDefaults(ctx context.Context) { | |
| r.Spec.SetDefaults(apis.WithinSpec(ctx)) | |
| } |
|
/assign @dprotaso |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| apiVersion: apiextensions.k8s.io/v1beta1 |
| // associated with this Domain. This is used in automatic DNS provisioning like | ||
| // configuration of magic DNS or creating ExternalName services for cluster-local | ||
| // access. | ||
| LoadBalancers []LoadBalancerIngressStatus `json:"loadBalancers"` |
There was a problem hiding this comment.
Weird to see a type named *Status in the spec - make a copy?
| // Istio Gateways associated with this Domain. This could be a reference of a ConfigMap | ||
| // owned by the implementation as well. | ||
| // +optional | ||
| Config []map[string]string `json:"config,omitempty"` |
There was a problem hiding this comment.
This is an array of maps - is that intended?
best practice to represent maps here?
Maybe a few criteria to think about
Patching
Although, CRDs don't support strategic merge patches the different types help reason about the different patch strategies that could open up in the future (although it's been shut down a bunch of times)
https://pkg.go.dev/k8s.io/kube-openapi/pkg/idl?tab=doc#ListType
https://pkg.go.dev/k8s.io/kube-openapi/pkg/idl?tab=doc#MapType
https://pkg.go.dev/k8s.io/kube-openapi/pkg/idl?tab=doc#StructType
JSON Patch & JSON Merge Patch are applicable to CRDs.
Future extensibility
Right now using an array with maps above don't let you add new typed fields - this may be fine but something to consider.
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
@googlebot I consent |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrew-su, tcnghia The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold cancel |
Signed-off-by: Shash Reddy <shashwathireddy@gmail.com>
Signed-off-by: Shash Reddy <shashwathireddy@gmail.com>
Signed-off-by: Andrew Su <andrew.su.01@gmail.com>
Signed-off-by: Andrew Su <andrew.su.01@gmail.com>
Signed-off-by: Andrew Su <andrew.su.01@gmail.com>
Signed-off-by: Andrew Su <andrew.su.01@gmail.com>
Signed-off-by: Shash Reddy <shashwathireddy@gmail.com>
Signed-off-by: Shash Reddy <shashwathireddy@gmail.com>
Signed-off-by: Shash Reddy <shashwathireddy@gmail.com>
Signed-off-by: Shash Reddy <shashwathireddy@gmail.com>
|
The following is the coverage report on the affected files.
|
|
/lgtm |
Issue: knative/serving#8184
This adds the CRDs for Realm and Domain.
/cc @shashwathi