Open sergeyshevch opened 1 year ago
cc @ryansteakley @surajkota could this be related to https://github.com/kubeflow/kubeflow/pull/6887?
Also, I should note that the field has a strange name. Maybe we need to use annotateOnly
instead of AnnotateOnly
And documentations lack info about this plugin. I've found it's usage only on reading code
I will let Ryan look into this, this might be a side affect of consuming the plugin as runtime.RawExtension
and then marshalling it.
I propose splitting this issue into 2 tasks -
Let me know your thoughts and if you have ideas
@sergeyshevch @kimwnasptd Created small pr to address the lack of documentation. https://github.com/kubeflow/kubeflow/pull/6996/files.
In regards to the name you can already choose to specify it as annotateOnly
or AnnotateOnly
in the yaml file. Additionally it is not possible to change the variable name in the go code from AnnotateOnly to annotateOnly as from the golang documentation it is not possible to lowercase it.
exported identifiers
An identifier may be exported to permit access to it from another package. An identifier is exported if both: the first character of the identifier's name is a Unicode uppercase letter
In the pr I have specified to the json that json:"annotateOnly,omitempty"
instead of the previous value of json:"AnnotateOnly,omitempty"
, seems to make no practical difference however.
Finally for the value of "true" causing a panic this is expected behavior as the profile code is using json.unmarshal
and the type is of bool. The unmarshal
method cannot perform this action ""json: cannot unmarshal string into Go struct field AwsIAMForServiceAccount.AnnotateOnly of type bool"
.
To get around user specifying true or "true" we would need to implement a custom method to handle this.
In regards to the name you can already choose to specify it as annotateOnly or AnnotateOnly in the yaml file.
Can you give more detail on this? is json tag is case insensitive?
https://pkg.go.dev/encoding/json#Unmarshal, specifies that, "To unmarshal JSON into a struct, Unmarshal matches incoming object keys to the keys used by Marshal (either the struct field name or its tag), preferring an exact match but also accepting a case-insensitive match"
Great!
/transfer dashboard
@sergeyshevch: The label(s) kind/bug
cannot be applied, because the repository doesn't have them.
/kind bug
What steps did you take and what happened: [A clear and concise description of what the bug is.]
Specify next plugin on profile CRD
Profile controller will fail with panic because of
"true"
. If we specifytrue
all works correctlyProfile controller logs:
What did you expect to happen:
All works without panic or raise an error on creating profile with incorrect plugin
Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]
Environment:
kfctl version
): NAminikube
) EKSkubectl version
): 1.24/etc/os-release
): NA