flagfolder

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2025 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Overview

Package flagfolder parses a folder on the disk as if each file in it had the contents of a command line flag.

This is mainly intended to be used with environments like Kubernetes where you have your secrets mounted as a filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse()

Parse parses all files in every folder under /run/secrets as if they were command-line flags.

This is most useful when you are using environments like Kubernetes where the path of least resistance is to mount your secrets as a filesystem. Mount all your secrets into the pod and then let it figure itself out!

To use this effectively, ensure that your Pods and Deployments mount secrets as volumes like this:

volumes:
  - name: secret-volume
    secret:
    secretName: shell
containers:
  - name: shell
    image: ubuntu:latest
    volumeMounts:
      - name: secret-volume
        readOnly: true
        mountPath: "/run/secrets/shell"

By default this will attempt to correct for several styles of naming for files:

* kebab-case (the default) * SHOUTING-KEBAB-CASE * snake_case * SHOUTING_SNAKE_CASE * camelCase * HammerCase

func ParseSet

func ParseSet(secretLocation string, set *flag.FlagSet) error

ParseSet parses secrets in a single folder into the given *flag.FlagSet.

By default this will attempt to correct for several styles of naming for files:

* kebab-case (the default) * SHOUTING-KEBAB-CASE * snake_case * SHOUTING_SNAKE_CASE * camelCase * HammerCase

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL