diff options
author | Brent Baude <bbaude@redhat.com> | 2020-02-02 09:39:12 -0600 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-02-19 15:20:15 -0600 |
commit | d65ff6b3ec18aad6a64329c54a83d5ba5d51b62f (patch) | |
tree | 63bdda9690847c269079ea531e7beacc5eb7fe22 /pkg/spec/parse.go | |
parent | f2bcc9cc7dc8b1937f39db503db96651d84c3e3e (diff) | |
download | podman-d65ff6b3ec18aad6a64329c54a83d5ba5d51b62f.tar.gz podman-d65ff6b3ec18aad6a64329c54a83d5ba5d51b62f.tar.bz2 podman-d65ff6b3ec18aad6a64329c54a83d5ba5d51b62f.zip |
apiv2 container create using specgen
this uses the specgen structure to create containers rather than the outdated createconfig. right now, only the apiv2 create is wired up. eventually the cli will also have to be done.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/spec/parse.go')
-rw-r--r-- | pkg/spec/parse.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/spec/parse.go b/pkg/spec/parse.go index a5dfccdb9..38d93b87f 100644 --- a/pkg/spec/parse.go +++ b/pkg/spec/parse.go @@ -19,12 +19,12 @@ const Pod = "pod" // weightDevice is a structure that holds device:weight pair type weightDevice struct { - path string - weight uint16 + Path string + Weight uint16 } func (w *weightDevice) String() string { - return fmt.Sprintf("%s:%d", w.path, w.weight) + return fmt.Sprintf("%s:%d", w.Path, w.Weight) } // LinuxNS is a struct that contains namespace information @@ -59,9 +59,9 @@ func NS(s string) string { return "" } -// validateweightDevice validates that the specified string has a valid device-weight format +// ValidateweightDevice validates that the specified string has a valid device-weight format // for blkio-weight-device flag -func validateweightDevice(val string) (*weightDevice, error) { +func ValidateweightDevice(val string) (*weightDevice, error) { split := strings.SplitN(val, ":", 2) if len(split) != 2 { return nil, fmt.Errorf("bad format: %s", val) @@ -78,8 +78,8 @@ func validateweightDevice(val string) (*weightDevice, error) { } return &weightDevice{ - path: split[0], - weight: uint16(weight), + Path: split[0], + Weight: uint16(weight), }, nil } |