-
Notifications
You must be signed in to change notification settings - Fork 321
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
Stub mesh configuration resource controller #3302
Conversation
@@ -50,13 +50,13 @@ type MeshConfigurationList struct { | |||
Items []*MeshConfiguration `json:"items"` | |||
} | |||
|
|||
func (in *MeshConfiguration) ResourceID(namespace, partition string) *pbresource.ID { | |||
func (in *MeshConfiguration) ResourceID(_, partition string) *pbresource.ID { |
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.
Why use a blank identifier here as opposed to just removing the namespace parameter as it's no longer required?
@@ -65,9 +65,9 @@ func (in *MeshConfiguration) ResourceID(namespace, partition string) *pbresource | |||
} | |||
} | |||
|
|||
func (in *MeshConfiguration) Resource(namespace, partition string) *pbresource.Resource { | |||
func (in *MeshConfiguration) Resource(_, partition string) *pbresource.Resource { |
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.
Same question as above
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.
These are both to implement the ConsulResource
interface found here -- it's what allows us to leverage the shared controller code:
consul-k8s/control-plane/api/common/consul_resource.go
Lines 15 to 16 in 46bf9bf
ResourceID(namespace, partition string) *pbresource.ID | |
Resource(namespace, partition string) *pbresource.Resource |
So I need to keep the arguments even though they're unused since the resource is purely partition scoped (it doesn't have a namespace). It's a much less invasive change on the shared controller -- alternatively we'd need to make the shared code aware of resources that are partition-scoped and treat them differently.
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.
Thanks for the explanation
Changes proposed in this PR:
Adds basic stubbing/syncing of "MeshConfiguration" resources to Consul.
How I've tested this PR:
Manually created a CRD and saw it propagate to Consul:
and then with
consul resource list mesh.v2beta1.meshconfiguration
:How I expect reviewers to test this PR:
Checklist: