Flow resource creation comes from the resource dir.#316
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: n3wscott 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 DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
The following is the coverage report on pkg/.
|
|
/test pull-knative-eventing-integration-tests |
1 similar comment
|
/test pull-knative-eventing-integration-tests |
|
/assign @grantr |
| Name: channelName, | ||
| Namespace: flow.Namespace, | ||
| OwnerReferences: []metav1.OwnerReference{ | ||
| *controller.NewControllerRef(flow), |
There was a problem hiding this comment.
A possible alternative to this and other controller references is https://github.com/kubernetes-sigs/controller-runtime/blob/471f9cde2471949c85c01c3baba2947d9929c908/pkg/controller/controllerutil/controllerutil.go, which can generate a controller ref between any two metav1.Objects, no type case needed.
import "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
func MakeChannel(flow *v1alpha1.Flow) *channelsv1alpha1.Channel {
channel := &channelsv1alpha1.Channel{}
controllerutil.SetOwnerReference(flow, channel, scheme.Scheme)
return channel
}There was a problem hiding this comment.
Let's make a bug and a follow-up to fix this here and in serving. I can do this
|
/assign @evankanderson |
| }, | ||
| }, | ||
| } | ||
| if flow.Spec.ServiceAccountName != "" { |
There was a problem hiding this comment.
Why not copy unconditionally?
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: evankanderson, grantr, n3wscott 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 |
* Working on moving resource creation to resource dir. * Update to not block owner ref.
Taking the good parts of #281.
Using the type inspection for owner ref and the pattern for using resources dir to create the resources.