-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Octal defaultMode
notation in yaml not properly converted to json
#6110
Comments
If you specify the value as |
Yes that works. |
@bearpaws : Hello, I'm trying to run this simple test with KubernetesClient v5.12.4 but it's failing with the same error. @Test
@DisplayName("unmarshal, when integer value has octal literal value, then octal literal value correctly deserialized")
void unmarshal_whenIntegerValueHasOctalLiteralValue_thenCorrectlyDeserializeInteger() {
// When
final CronJob cronJob = Serialization.unmarshal(getClass().getResourceAsStream("/cronjob-octal.yml"), CronJob.class);
// Then
assertThat(cronJob)
.extracting(CronJob::getSpec)
.extracting(CronJobSpec::getJobTemplate)
.extracting(JobTemplateSpec::getSpec)
.extracting(JobSpec::getTemplate)
.extracting(PodTemplateSpec::getSpec)
.extracting(PodSpec::getVolumes)
.asInstanceOf(InstanceOfAssertFactories.list(Volume.class))
.singleElement()
.extracting(Volume::getConfigMap)
.hasFieldOrPropertyWithValue("defaultMode", Integer.valueOf("0555", 8))
.isNotNull();
} Here is YAML that I'm loading : apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: update-db
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: update-fingerprints
image: python:3.6.2-slim
command: ["/bin/bash"]
args: ["-c", "python /client/test.py"]
volumeMounts:
- name: application-code
mountPath: /where/ever
restartPolicy: OnFailure
volumes:
- name: resources
configMap:
name: conf
defaultMode: "0555" |
@rohanKanojia In your example the value is quoted ( |
Transcribing @rohanKanojia PR fix description so we keep the context of the issue and the solution together:
Originally posted by @rohanKanojia in #6148 |
### What changes were proposed in this pull request? The pr aims to upgrade `kubernetes-client` from `6.13.1` to `6.13.2`. ### Why are the changes needed? - The full release notes: https://github.com/fabric8io/kubernetes-client/releases/tag/v6.13.2 - The newest version fixed some bug, eg: Fix fabric8io/kubernetes-client#6066: Added support for missing v1.APIVersions in KubernetesClient Fix fabric8io/kubernetes-client#6110: VolumeSource (and other file mode fields) in Octal are correctly interpreted Fix fabric8io/kubernetes-client#6137: ConfigBuilder.withAutoConfigure is not working ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #47703 from panbingkun/SPARK-49196. Authored-by: panbingkun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
### What changes were proposed in this pull request? The pr aims to upgrade `kubernetes-client` from `6.13.1` to `6.13.2`. ### Why are the changes needed? - The full release notes: https://github.com/fabric8io/kubernetes-client/releases/tag/v6.13.2 - The newest version fixed some bug, eg: Fix fabric8io/kubernetes-client#6066: Added support for missing v1.APIVersions in KubernetesClient Fix fabric8io/kubernetes-client#6110: VolumeSource (and other file mode fields) in Octal are correctly interpreted Fix fabric8io/kubernetes-client#6137: ConfigBuilder.withAutoConfigure is not working ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47703 from panbingkun/SPARK-49196. Authored-by: panbingkun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
### What changes were proposed in this pull request? The pr aims to upgrade `kubernetes-client` from `6.13.1` to `6.13.2`. ### Why are the changes needed? - The full release notes: https://github.com/fabric8io/kubernetes-client/releases/tag/v6.13.2 - The newest version fixed some bug, eg: Fix fabric8io/kubernetes-client#6066: Added support for missing v1.APIVersions in KubernetesClient Fix fabric8io/kubernetes-client#6110: VolumeSource (and other file mode fields) in Octal are correctly interpreted Fix fabric8io/kubernetes-client#6137: ConfigBuilder.withAutoConfigure is not working ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47703 from panbingkun/SPARK-49196. Authored-by: panbingkun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
### What changes were proposed in this pull request? The pr aims to upgrade `kubernetes-client` from `6.13.1` to `6.13.2`. ### Why are the changes needed? - The full release notes: https://github.com/fabric8io/kubernetes-client/releases/tag/v6.13.2 - The newest version fixed some bug, eg: Fix fabric8io/kubernetes-client#6066: Added support for missing v1.APIVersions in KubernetesClient Fix fabric8io/kubernetes-client#6110: VolumeSource (and other file mode fields) in Octal are correctly interpreted Fix fabric8io/kubernetes-client#6137: ConfigBuilder.withAutoConfigure is not working ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47703 from panbingkun/SPARK-49196. Authored-by: panbingkun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
Describe the bug
I'm creating a CronJob from a yaml manifest that contains a ConfigMap volume with octal notation
0555
for the defaultMode.When creating the resource on the kube server, the API returns this error:
This worked correctly in version 5.12.4 of the API, however in 6.13.1 it fails.
Fabric8 Kubernetes Client version
6.13.1
Steps to reproduce
Yaml manifest that contains a ConfigMap volume:
Create the resource via the API:
In version 5.12.4, it prints:
In version 6.13.1, it prints the following and fails with the above error.
Expected behavior
The library should properly convert the octal yaml value into the equivalent value required for json, as it did in previous versions.
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
other (please specify in additional context)
Environment
other (please specify in additional context)
Fabric8 Kubernetes Client Logs
No response
Additional context
Related issue: #2572
The text was updated successfully, but these errors were encountered: