diff options
author | Toshiki Sonoda <sonoda.toshiki@fujitsu.com> | 2022-09-02 16:20:26 +0900 |
---|---|---|
committer | Toshiki Sonoda <sonoda.toshiki@fujitsu.com> | 2022-09-06 20:17:11 +0900 |
commit | a9a411f8a83ab5644582b8929a32abacc18a17fc (patch) | |
tree | e94196c3d5f7936f55d36041c67276dcb0a980ae /pkg/bindings/generate | |
parent | 9ab6449e36792734853eb59161ccd3bfe5d0d509 (diff) | |
download | podman-a9a411f8a83ab5644582b8929a32abacc18a17fc.tar.gz podman-a9a411f8a83ab5644582b8929a32abacc18a17fc.tar.bz2 podman-a9a411f8a83ab5644582b8929a32abacc18a17fc.zip |
Add generate systemd -e/--env option
-e/--env option sets environment variables to the systemd unit files.
Fixes: #15523
Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Diffstat (limited to 'pkg/bindings/generate')
-rw-r--r-- | pkg/bindings/generate/types.go | 2 | ||||
-rw-r--r-- | pkg/bindings/generate/types_systemd_options.go | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pkg/bindings/generate/types.go b/pkg/bindings/generate/types.go index 25c398c8b..31b43897c 100644 --- a/pkg/bindings/generate/types.go +++ b/pkg/bindings/generate/types.go @@ -38,4 +38,6 @@ type SystemdOptions struct { After *[]string // Requires - systemd requires list for the container or pods Requires *[]string + // AdditionalEnvVariables - Sets environment variables to a systemd unit file + AdditionalEnvVariables *[]string } diff --git a/pkg/bindings/generate/types_systemd_options.go b/pkg/bindings/generate/types_systemd_options.go index 4d436945b..3aec33a54 100644 --- a/pkg/bindings/generate/types_systemd_options.go +++ b/pkg/bindings/generate/types_systemd_options.go @@ -226,3 +226,18 @@ func (o *SystemdOptions) GetRequires() []string { } return *o.Requires } + +// WithAdditionalEnvVariables set field AdditionalEnvVariables to given value +func (o *SystemdOptions) WithAdditionalEnvVariables(value []string) *SystemdOptions { + o.AdditionalEnvVariables = &value + return o +} + +// GetAdditionalEnvVariables returns value of field AdditionalEnvVariables +func (o *SystemdOptions) GetAdditionalEnvVariables() []string { + if o.AdditionalEnvVariables == nil { + var z []string + return z + } + return *o.AdditionalEnvVariables +} |