Adds annotation to PVC like that:
annotations:
foo/tags: '{"application": "foo", "namespace": "bar"}'
It is interpreted by Kubernetes as a map. I need to add it as a string which requires that it will look like that:
annotations:
foo/tags: |
{"application": "foo", "namespace": "bar"}
If I add | and \n inside stringTest, it will be wrongly interpreted.
Hi I want to annotate PVC with a string instead of a map.
This function: stringTest := "{\"application\": \"foo\", \"namespace\": \"bar\"}" pvcs.Items[0].ObjectMeta.Annotations["foo/tags"] = stringTest
_, err = clientset.CoreV1().PersistentVolumeClaims(namespace).Update(context.Background(), &pvcs.Items[0], metav1.UpdateOptions{})
Adds annotation to PVC like that: annotations: foo/tags: '{"application": "foo", "namespace": "bar"}'
It is interpreted by Kubernetes as a map. I need to add it as a string which requires that it will look like that: annotations: foo/tags: | {"application": "foo", "namespace": "bar"}
If I add | and \n inside stringTest, it will be wrongly interpreted.
How can I achieve that?