Skip to content

Import binary files as base64 encoded strings #2492

@L0r3m1p5um

Description

@L0r3m1p5um

I'd like to have a way to import binary files in to Nickel as Base64 encoded strings. This is the behavior I would want:

$ printf "\xFF\xFF" > binfile
$ echo "import \"binfile\" as 'Base64Encoded" | nickel eval
"//8="

The main use case I have for this is to create Kubernetes Secrets and ConfigMaps. Both those resource types support including binary data as base 64 encoded strings (Secrets base64 encode data by default, ConfigMaps support it through a separate binaryData field). Right now I need a separate processing step outside of nickel in order to generate configmaps like this since there's no way to import binary data into Nickel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions