mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
container.conf: support attributed string slices
All `[]string`s in containers.conf have now been migrated to attributed string slices which require some adjustments in Buildah and Podman. [NO NEW TESTS NEEDED] Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
10
vendor/github.com/containers/common/internal/attributedstring/slice.go
generated
vendored
10
vendor/github.com/containers/common/internal/attributedstring/slice.go
generated
vendored
@ -23,6 +23,11 @@ type Slice struct { // A "mixed-type array" in TOML.
|
||||
}
|
||||
}
|
||||
|
||||
// NewSlice creates a new slice with the specified values.
|
||||
func NewSlice(values []string) Slice {
|
||||
return Slice{Values: values}
|
||||
}
|
||||
|
||||
// Get returns the Slice values or an empty string slice.
|
||||
func (a *Slice) Get() []string {
|
||||
if a.Values == nil {
|
||||
@ -31,6 +36,11 @@ func (a *Slice) Get() []string {
|
||||
return a.Values
|
||||
}
|
||||
|
||||
// Set overrides the values of the Slice.
|
||||
func (a *Slice) Set(values []string) {
|
||||
a.Values = values
|
||||
}
|
||||
|
||||
// UnmarshalTOML is the custom unmarshal method for Slice.
|
||||
func (a *Slice) UnmarshalTOML(data interface{}) error {
|
||||
iFaceSlice, ok := data.([]interface{})
|
||||
|
Reference in New Issue
Block a user