1 // Copyright 2019 The Kubernetes Authors. 2 // SPDX-License-Identifier: Apache-2.0 3 4 package types 5 6 // KvPairSources defines places to obtain key value pairs. 7 type KvPairSources struct { 8 // LiteralSources is a list of literal 9 // pair sources. Each literal source should 10 // be a key and literal value, e.g. `key=value` 11 LiteralSources []string `json:"literals,omitempty" yaml:"literals,omitempty"` 12 13 // FileSources is a list of file "sources" to 14 // use in creating a list of key, value pairs. 15 // A source takes the form: [{key}=]{path} 16 // If the "key=" part is missing, the key is the 17 // path's basename. If they "key=" part is present, 18 // it becomes the key (replacing the basename). 19 // In either case, the value is the file contents. 20 // Specifying a directory will iterate each named 21 // file in the directory whose basename is a 22 // valid configmap key. 23 FileSources []string `json:"files,omitempty" yaml:"files,omitempty"` 24 25 // EnvSources is a list of file paths. 26 // The contents of each file should be one 27 // key=value pair per line, e.g. a Docker 28 // or npm ".env" file or a ".ini" file 29 // (wikipedia.org/wiki/INI_file) 30 EnvSources []string `json:"envs,omitempty" yaml:"envs,omitempty"` 31 32 // Older, singular form of EnvSources. 33 // On edits (e.g. `kustomize fix`) this is merged into the plural form 34 // for consistency with LiteralSources and FileSources. 35 EnvSource string `json:"env,omitempty" yaml:"env,omitempty"` 36 } 37