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

Config map view inconsistent for binary data #5311

Closed
nwmac opened this issue Mar 7, 2022 · 6 comments · Fixed by #5312
Closed

Config map view inconsistent for binary data #5311

nwmac opened this issue Mar 7, 2022 · 6 comments · Fixed by #5312
Assignees
Milestone

Comments

@nwmac
Copy link
Member

nwmac commented Mar 7, 2022

Internal Ref: SURE-4099

For a config map with binary data, we correctly show the data and binaryData on the overview for the configmap.

For the config view, however, we may show some text values as binary is they contain UTF8 characters, even though they are valid strings to display as text.

The binary data length is also inconsistent between the two views

e.g. for this config map:

apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap-test
  namespace: default
binaryData:
  test: VEVTVEVTVFRFU1Q=
data:
  blah: awdwad
  text: RÄNCHER

image

Note: Size says 16 bytes which is the base64 encoded size, not the actual data size and text is displayed corrected here

image

text is not displayed, but the binary value test is. The length is correct

@sowmyav27
Copy link

On 2.6.3
Screen Shot 2022-03-13 at 9 55 39 PM

On 2.6-head commit id: f904267
Screen Shot 2022-03-13 at 9 55 35 PM

@zube zube bot reopened this Mar 21, 2022
@asemen2608
Copy link

asemen2608 commented Apr 1, 2022

Looks not to be fixed.
On editing the Value of the "key" text, after saving the filed data changed the content to: "<Binary Data: 57 bytes>"
See in the screen shot 2.6.3, 2.6-head.

Or on editing the Value of the "key" blah, the text after saving, the filed data changed the content to: "<Binary Data: 57 bytes>"
The text should stay and not to be converted to "<Binary Data: 57 bytes>".
See in the screen shot 2.6.4

Create the ConfigMap sonderzeichen-test with:
kubectl apply -f configmap_2_lorem.yaml

cat configmap_2_lorem.yaml
apiVersion: v1
data:
  blah: awdwad
  config.js: |-
    /*#########
       MÖEP hier geht RÄNCHER kaputt
    ######### */
  segasefwa: drgesge
kind: ConfigMap
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","data":{"blah":"awdwad","config.js":"/*#########\n   MÖEP hier geht RÄNCHER kaputt\n######### */","segasefwa":"drgesge"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"sonderzeichen-test","namespace":"heil-apitest"}}
  creationTimestamp: "2022-02-16T14:08:37Z"
  name: sonderzeichen-test
  namespace: heil-apitest
  resourceVersion: "218631380"
  uid: 21a89c1e-99a4-429a-b8f7-26e9c311f953

fresh_created
after_edid_and_save

@asemen2608 asemen2608 reopened this Apr 1, 2022
@asemen2608
Copy link

In case of no special caracter like Ö or Ä
key config.js
value /*#########
MOEP hier geht RANCHER kaputt
######### */
It does not change to "<Binary Data: 57 bytes>".
no_special_character

@nwmac
Copy link
Member Author

nwmac commented Apr 5, 2022

@aalves08 Can you take a look - we made a fix for this in 2.6.4 but the report is that this fix does not work.

@nwmac nwmac removed their assignment Apr 5, 2022
@markusewalker
Copy link

Verified on v2.6.5-rc3 and v2.6-head rancher/rancher@5f04f3a.

ENVIRONMENT DETAILS

TEST PLAN

  1. Setup Rancher and navigate to top-left dropdown menu > local > Storage > ConfigMaps.
  2. Click Create in the top-right corner.
  3. Click Edit as YAML in bottom-right corner and input the sample given in the issue description.
  4. Open the freshly created ConfigMap and view the detail, config and YAML.

TEST RESULT
PASS

VERIFICATION STEPS

  1. Setup Rancher and navigate to top-left dropdown menu > local > Storage > ConfigMaps.
  2. Clicked Create in the top-right corner.
  3. Clicked Edit as YAML in bottom-right corner and input the sample given in the issue description.
  4. Opened the freshly created ConfigMap and viewed the detail, config and YAML:
    image
    image
    image
    image
  5. Edited the config of the ConfigMap so that I modified the Value of blah. I received the following result:
    image
    image
    image

@DeanXLiu
Copy link

rancher2.6.9,create secrets have the same problem,not fix
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants