-
Notifications
You must be signed in to change notification settings - Fork 208
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
connectivity: Ability to add custom annotations to test deployment #1687
Conversation
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, thanks! Maybe provide a working example command using these flags in the commit message and/or PR description?
Some of the CI failures look legitimate: |
This commit adds the ability to add labels or annotations to a newly created namespace. This commit itself does not contain any changes in functional behavior, the ability to add annotations will be used in a subsequent commit. Signed-off-by: Sebastian Wicki <[email protected]>
689056e
to
08452db
Compare
08452db
to
90c0189
Compare
90c0189
to
8fc2027
Compare
Fixes. Issue was a copy-paste error in the namespace (dst vs src context) refactor commit. |
Looks good. One question: is there any need for setting annotations on all pods? Something like |
Oh that's a nice suggestion. Yeah I think supporting a wildcard match would be nice. |
This type will be used in a subsequent commit to specify the wanted annotations for a specific deployment or namespace. Unit tests are added to ensure the wildcard matching behavior. Signed-off-by: Sebastian Wicki <[email protected]>
This commit adds the ability to add custom namespace and pod annotations to the `cilium connectivity test` deployment. The two flags are `--deployment-pod-annotations` and `--namespace-annotations`. For the pod annotations, we accept a JSON map which contains the deployment name as the key, and the annotations as a string-to-string map. For the namespace annotation, we simply expect a string-to-string map. We could have used Viper's `StringToString` map for the namespace annotations, but not for the pod annotations, since there we would need a "`StringToStringToString`" map. Therefore, to remain consistent between the two flags, both flags exclusively JSON syntax. If the deployment name in the annotations map ends with a `*` symbol, then we perform a longest prefix match. The flags are currently hidden, since we are not fully commited to this command-line syntax yet and it might still change in the future. Example: ``` $ cilium connectivity test \ --namespace-annotations='{"foo":"bar"}' \ --deployment-pod-annotations='{"client":{"baz":"qux"},"echo-*":{"quux":"corge"}}' ``` Signed-off-by: Sebastian Wicki <[email protected]>
8fc2027
to
0329c76
Compare
Added the ability to support simple (i.e. prefix only) wildcard matches via |
connectivity: Ability to add custom annotations to test deployment
This commit adds the ability to add custom namespace and pod annotations
to the
cilium connectivity test
deployment. The two flags are--deployment-pod-annotations
and--namespace-annotations
.For the pod annotations, we accept a JSON map which contains the
deployment name as the key, and the annotations as a string-to-string
map. For the namespace annotation, we simply expect a string-to-string
map.
We could have used Viper's
StringToString
map for the namespaceannotations, but not for the pod annotations, since there we would need
a "
StringToStringToString
" map. Therefore, to remain consistentbetween the two flags, both flags exclusively JSON syntax.
If the deployment name in the annotations map ends with a
*
symbol,then we perform a longest prefix match.
The flags are currently hidden, since we are not fully commited to this
command-line syntax yet and it might still change in the future.
Example: