diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/infra/abi/play.go | 28 | ||||
-rw-r--r-- | pkg/machine/e2e/config_init.go | 2 | ||||
-rw-r--r-- | pkg/machine/e2e/machine_test.go | 2 |
3 files changed, 19 insertions, 13 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 45500b23c..0da07bab8 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -78,7 +78,11 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options podTemplateSpec.ObjectMeta = podYAML.ObjectMeta podTemplateSpec.Spec = podYAML.Spec - + for name, val := range podYAML.Annotations { + if len(val) > define.MaxKubeAnnotation { + return nil, errors.Errorf("invalid annotation %q=%q value length exceeds Kubernetetes max %d", name, val, define.MaxKubeAnnotation) + } + } for name, val := range options.Annotations { if podYAML.Annotations == nil { podYAML.Annotations = make(map[string]string) @@ -199,18 +203,20 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY return nil, err } - ns, networks, netOpts, err := specgen.ParseNetworkFlag(options.Networks) - if err != nil { - return nil, err - } + if len(options.Networks) > 0 { + ns, networks, netOpts, err := specgen.ParseNetworkFlag(options.Networks) + if err != nil { + return nil, err + } - if (ns.IsBridge() && len(networks) == 0) || ns.IsHost() { - return nil, errors.Errorf("invalid value passed to --network: bridge or host networking must be configured in YAML") - } + if (ns.IsBridge() && len(networks) == 0) || ns.IsHost() { + return nil, errors.Errorf("invalid value passed to --network: bridge or host networking must be configured in YAML") + } - podOpt.Net.Network = ns - podOpt.Net.Networks = networks - podOpt.Net.NetworkOptions = netOpts + podOpt.Net.Network = ns + podOpt.Net.Networks = networks + podOpt.Net.NetworkOptions = netOpts + } // FIXME This is very hard to support properly with a good ux if len(options.StaticIPs) > *ipIndex { diff --git a/pkg/machine/e2e/config_init.go b/pkg/machine/e2e/config_init.go index 55218221d..2340a1133 100644 --- a/pkg/machine/e2e/config_init.go +++ b/pkg/machine/e2e/config_init.go @@ -12,7 +12,7 @@ type initMachine struct { --image-path string Path to qcow image (default "testing") -m, --memory uint Memory in MB (default 2048) --now Start machine now - --rootful Whether this machine should prefer rootful container exectution + --rootful Whether this machine should prefer rootful container execution --timezone string Set timezone (default "local") -v, --volume stringArray Volumes to mount, source:target --volume-driver string Optional volume driver diff --git a/pkg/machine/e2e/machine_test.go b/pkg/machine/e2e/machine_test.go index 46fe18069..2b3b60b2b 100644 --- a/pkg/machine/e2e/machine_test.go +++ b/pkg/machine/e2e/machine_test.go @@ -116,7 +116,7 @@ func teardown(origHomeDir string, testDir string, mb *machineTestBuilder) { s := new(stopMachine) for _, name := range mb.names { if _, err := mb.setName(name).setCmd(s).run(); err != nil { - fmt.Printf("error occured rm'ing machine: %q\n", err) + fmt.Printf("error occurred rm'ing machine: %q\n", err) } } if err := os.RemoveAll(testDir); err != nil { |