-
Notifications
You must be signed in to change notification settings - Fork 108
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
Simplified virtual node name users need to define in the CRDs #24
Conversation
The docker base image needs to be updated to go 12. |
@jqmichael I think the routes and virtual routers should follow the same convention. Instead of: routes:
- name: color-route-appmesh-demo
virtualRouter:
name: color-router-appmesh-demo could be: routes:
- name: color-route # appmesh id: color-route-appmesh-demo
virtualRouter:
name: color-router # appmesh id: color-router-appmesh-demo |
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.
I've tested this PR with Flagger fluxcd/flagger#118 and it works ok.
The Docker build fails with go 1.11, I've changed the base image to golang:1.12-stretch
, here is my test image stefanprodan/app-mesh-controller:0.0.1-alpha.6
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.
Nice job. I do think we should do this for virtual routers and potentially virtual services, though each can be in a separate change.
pkg/aws/appmesh_util.go
Outdated
import "strings" | ||
|
||
// This method is created to address the lack of native support of namespace within AppMesh API. | ||
// If virtualNodeName in the CRD spec doesn't contain ".", we will construct the new virtualNodeName by appending "-defaultNamespace". |
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.
-defaultNamespace
could also mean the namespace called default, I would say -virtualNodeNamespace
to disambiguate.
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.
I changed this to defaultVirtualNamespace
to make it clear that this isn't a namespace that every virtual node should pick up. Let me know if this isn't clear.
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.
I don't think virtualNamespace is clear, what is a virtual namespace? defaultVirtualNodeNamespace
?
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.
Oops, that was typo. defaultVirtualNodeNamespace
is what I meant.
pkg/aws/appmesh_util.go
Outdated
// If it does, the new virtualNodeName is constructed by converting the "." to "-" since "." isn't a valid character as AppMesh virtual node name. | ||
// Example 1: virtualNodeName: "foo", defaultNamespace: "bar". The new virtualNodeName will be "foo-bar" | ||
// Example 2: virtualNodeName: "foo.dummy", defaultNamespace: "bar". The new virtualNodeName will be "foo-dummy" | ||
func ConstructAppMeshVNodeNameFromCRD(virtualNodeName string, defaultNamespace string) string { |
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.
Nit: func ConstructAppMeshVNodeName(
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.
I really prefer adding the CRD part just to make it clear to the consumer of this API that there're two virtual node name we are talking about, 1) App Mesh rss and 2) the name in the CRD.
Let me know if you have a strong preference not adding the CRD in the name.
Issue #, if available:
#14
Description of changes:
This change simplify virtual node name user needs to define in the CRDs.
Tests:
Follow the color example after naming simplification, and update the weights, everything works as expected.
Given CRD spec
AppMesh backend representation:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.