Closed mstoops-ox closed 20 minutes ago
Hi, thanks for opening this issue, We'll investigate and keep you updated!
Hi, thanks for reporting this!
I have taken a look at the json-properties
flag and found the issue, a PR with a fix should be coming soon.
Also, in regards to the labels
field, the example follows the object definition from the API docs, where it is defined as a map. The reason it works even when you use an array of maps (how you did it) is because the go/json
package will merge it into a single map when unmarshalling the whole example into the nodepool
object, which has a map[string][string]
corresponding labels property.
I hope this clears things up a bit, and I will ping this thread when the fix PR is posted and then once more when it's merged.
In regards to your mention of the label
field, I added the array because I was getting an error otherwise.
When I use the following (without wrapping the map in an array)
"labels": {
"app.open-xchange.com": "gitlab",
"ingress-node.open-xchange.com": "true",
"env.open-xchange.com": "test"
}
I get the following error
Error: failed unmarshalling json properties into object: 3 error(s) decoding:
* 'Properties.Labels[app]' expected type 'string', got unconvertible type 'map[string]interface {}', value: 'map[open-xchange:map[com:gitlab]]'
* 'Properties.Labels[env]' expected type 'string', got unconvertible type 'map[string]interface {}', value: 'map[open-xchange:map[com:test]]'
* 'Properties.Labels[ingress-node]' expected type 'string', got unconvertible type 'map[string]interface {}', value: 'map[open-xchange:map[com:true]]'
I didn't get the complains once I wrapped the object in an array.
Now I see the reason that's happening, in that it's not taking the key name as a string, but instead is treating the '.'s as dot operators. Not sure how to deal with that though.
I don't think that error is something that we can do much about, it's simply how the go/json
package seems to handle such naming schemes. We have merged the fix PR https://github.com/ionos-cloud/ionosctl/pull/464 into master and will be releasing a new version of ionosctl
soon.
If there are no more issues, I will be closing this thread.
Description
File passed using the
--json-properties
argument is ignored when creating a node pool withionosctl
Expected behavior
The values used to describe a node pool in a json file are used to create the node pool
Environment
Go Version:
Ionosctl version:
OS:
Shell:
Configuration Files
Using ionos token to login in. Have tried using the following in a json file:
How to Reproduce
-- Note: the and values are replaced with my respective cluster and datacenter values
ionosctl k8s nodepool create --cluster-id <cluster-id> --datacenter-id <datacenter-id> --json-properties test-nodepool.json --verbose
Error and Debug Output
The output with
--verbose
shows that the values from the json file are completely ignoredAdditional Notes
Command-line arguments to ionosctl work properly.
References
n/a