Skip to content
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

Need a better way to specify plugin/extender specific arguments in the pod spec #18670

Closed
ravigadde opened this issue Dec 14, 2015 · 6 comments
Closed
Labels
priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@ravigadde
Copy link
Contributor

Annotations are map[string]string. Its difficult to encode arbitrary structure in to a string.

{
 "kind": "Pod",
 "apiVersion": "v1",
 "metadata": {
  "name": "testpod",
  "namespace": "default",
  "annotations": {
     "test": {
       "name": "foo",
       "value": "bar"
     }
   }
 },
...

[root@tb1-01 ~]# kubectl create -f pod.json
unable to load "pod.json": json: cannot unmarshal object into Go value of type string

This works but its painful to escape every quote and fit all of it in a single line.

 "annotations": {
     "test": "{\"name\": \"foo\", \"value\": \"bar\"}"
   }

map[string]interface{} makes it easier. The structure gets parsed as a map. The plugin would encode this map and then decode in to the structure. This scheme allows multiple plugins to define their own custom arguments.

There are two options to implement this:

  1. Define a new field in the pod spec that is map[string]interface{}
  2. Change the definition of Annotations and add conversion functions for existing annotations.

If there is a different way to handle this, please let me know.

cc @bgrant0607 @smarterclayton @davidopp @thockin

@ravigadde
Copy link
Contributor Author

cc @brendandburns @NELCY

@saad-ali saad-ali added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Dec 15, 2015
@jainvipin
Copy link

Useful feature to have.
@ravigadde - I use out of band mechanism to avoid this issue...

@ravigadde
Copy link
Contributor Author

@jainvipin The goal is to use the standard interface for pod creation, which can be accomplished by providing flexibility in the pod spec.

@davidopp davidopp added team/control-plane priority/backlog Higher priority than priority/awaiting-more-evidence. labels Dec 19, 2015
@davidopp
Copy link
Member

davidopp commented Jan 7, 2016

@smarterclayton @thockin have some input on this

@bgrant0607
Copy link
Member

See also #12226

@thockin
Copy link
Member

thockin commented Mar 17, 2016

Dup of #12226

@thockin thockin closed this as completed Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

6 participants