Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit 29ce44c

Browse files
authored
Merge branch 'master' into upgrade-spark-operator-chart-1.1.15
2 parents 755efbf + 0637c34 commit 29ce44c

44 files changed

Lines changed: 1065 additions & 574 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

boilerplate/flyte/golang_support_tools/go.mod

Lines changed: 180 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,191 @@
11
module github.com/flyteorg/boilerplate
22

3-
go 1.16
3+
go 1.17
44

55
require (
66
github.com/alvaroloes/enumer v1.1.2
77
github.com/flyteorg/flytestdlib v0.4.7
88
github.com/golangci/golangci-lint v1.38.0
9+
github.com/pseudomuto/protoc-gen-doc v1.4.1
910
github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5
10-
github.com/pseudomuto/protoc-gen-doc v0.1.1 // indirect
11+
)
12+
13+
require (
14+
4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a // indirect
15+
cloud.google.com/go v0.75.0 // indirect
16+
cloud.google.com/go/storage v1.12.0 // indirect
17+
github.com/Azure/azure-sdk-for-go v51.0.0+incompatible // indirect
18+
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
19+
github.com/Azure/go-autorest/autorest v0.11.17 // indirect
20+
github.com/Azure/go-autorest/autorest/adal v0.9.10 // indirect
21+
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
22+
github.com/Azure/go-autorest/logger v0.2.0 // indirect
23+
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
24+
github.com/BurntSushi/toml v0.3.1 // indirect
25+
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
26+
github.com/Masterminds/semver v1.5.0 // indirect
27+
github.com/Masterminds/sprig v2.15.0+incompatible // indirect
28+
github.com/OpenPeeDeeP/depguard v1.0.1 // indirect
29+
github.com/alexkohler/prealloc v1.0.0 // indirect
30+
github.com/aokoli/goutils v1.0.1 // indirect
31+
github.com/ashanbrown/forbidigo v1.1.0 // indirect
32+
github.com/ashanbrown/makezero v0.0.0-20201205152432-7b7cdbb3025a // indirect
33+
github.com/aws/aws-sdk-go v1.37.1 // indirect
34+
github.com/beorn7/perks v1.0.1 // indirect
35+
github.com/bkielbasa/cyclop v1.2.0 // indirect
36+
github.com/bombsimon/wsl/v3 v3.2.0 // indirect
37+
github.com/cespare/xxhash v1.1.0 // indirect
38+
github.com/cespare/xxhash/v2 v2.1.1 // indirect
39+
github.com/charithe/durationcheck v0.0.6 // indirect
40+
github.com/coocood/freecache v1.1.1 // indirect
41+
github.com/daixiang0/gci v0.2.8 // indirect
42+
github.com/davecgh/go-spew v1.1.1 // indirect
43+
github.com/denis-tingajkin/go-header v0.4.2 // indirect
44+
github.com/envoyproxy/protoc-gen-validate v0.3.0-java // indirect
45+
github.com/ernesto-jimenez/gogen v0.0.0-20180125220232-d7d4131e6607 // indirect
46+
github.com/esimonov/ifshort v1.0.1 // indirect
47+
github.com/fatih/color v1.10.0 // indirect
48+
github.com/fatih/structtag v1.2.0 // indirect
49+
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
50+
github.com/fsnotify/fsnotify v1.4.9 // indirect
51+
github.com/fzipp/gocyclo v0.3.1 // indirect
52+
github.com/ghodss/yaml v1.0.0 // indirect
53+
github.com/go-critic/go-critic v0.5.4 // indirect
54+
github.com/go-logr/logr v0.4.0 // indirect
55+
github.com/go-toolsmith/astcast v1.0.0 // indirect
56+
github.com/go-toolsmith/astcopy v1.0.0 // indirect
57+
github.com/go-toolsmith/astequal v1.0.0 // indirect
58+
github.com/go-toolsmith/astfmt v1.0.0 // indirect
59+
github.com/go-toolsmith/astp v1.0.0 // indirect
60+
github.com/go-toolsmith/strparse v1.0.0 // indirect
61+
github.com/go-toolsmith/typep v1.0.2 // indirect
62+
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b // indirect
63+
github.com/gobwas/glob v0.2.3 // indirect
64+
github.com/gofrs/flock v0.8.0 // indirect
65+
github.com/gogo/protobuf v1.3.2 // indirect
66+
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
67+
github.com/golang/protobuf v1.4.3 // indirect
68+
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect
69+
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
70+
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 // indirect
71+
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a // indirect
72+
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect
73+
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect
74+
github.com/golangci/misspell v0.3.5 // indirect
75+
github.com/golangci/revgrep v0.0.0-20210208091834-cd28932614b5 // indirect
76+
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect
77+
github.com/google/go-cmp v0.5.4 // indirect
78+
github.com/google/uuid v1.1.2 // indirect
79+
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
80+
github.com/gordonklaus/ineffassign v0.0.0-20210225214923-2e10b2664254 // indirect
81+
github.com/gostaticanalysis/analysisutil v0.4.1 // indirect
82+
github.com/gostaticanalysis/comment v1.4.1 // indirect
83+
github.com/gostaticanalysis/forcetypeassert v0.0.0-20200621232751-01d4955beaa5 // indirect
84+
github.com/gostaticanalysis/nilerr v0.1.1 // indirect
85+
github.com/graymeta/stow v0.2.7 // indirect
86+
github.com/hashicorp/hcl v1.0.0 // indirect
87+
github.com/huandu/xstrings v1.0.0 // indirect
88+
github.com/imdario/mergo v0.3.5 // indirect
89+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
90+
github.com/jgautheron/goconst v1.4.0 // indirect
91+
github.com/jingyugao/rowserrcheck v0.0.0-20210130005344-c6a0c12dd98d // indirect
92+
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
93+
github.com/jmespath/go-jmespath v0.4.0 // indirect
94+
github.com/jstemmer/go-junit-report v0.9.1 // indirect
95+
github.com/julz/importas v0.0.0-20210226073942-60b4fa260dd0 // indirect
96+
github.com/kisielk/errcheck v1.6.0 // indirect
97+
github.com/kisielk/gotool v1.0.0 // indirect
98+
github.com/kulti/thelper v0.4.0 // indirect
99+
github.com/kunwardeep/paralleltest v1.0.2 // indirect
100+
github.com/kyoh86/exportloopref v0.1.8 // indirect
101+
github.com/magefile/mage v1.10.0 // indirect
102+
github.com/magiconair/properties v1.8.4 // indirect
103+
github.com/maratori/testpackage v1.0.1 // indirect
104+
github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect
105+
github.com/mattn/go-colorable v0.1.8 // indirect
106+
github.com/mattn/go-isatty v0.0.12 // indirect
107+
github.com/mattn/go-runewidth v0.0.7 // indirect
108+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
109+
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
110+
github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81 // indirect
111+
github.com/mgechev/revive v1.0.3 // indirect
112+
github.com/mitchellh/go-homedir v1.1.0 // indirect
113+
github.com/mitchellh/mapstructure v1.4.1 // indirect
114+
github.com/moricho/tparallel v0.2.1 // indirect
115+
github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007 // indirect
116+
github.com/nakabonne/nestif v0.3.0 // indirect
117+
github.com/nbutton23/zxcvbn-go v0.0.0-20201221231540-e56b841a3c88 // indirect
118+
github.com/ncw/swift v1.0.53 // indirect
119+
github.com/nishanths/exhaustive v0.1.0 // indirect
120+
github.com/nishanths/predeclared v0.2.1 // indirect
121+
github.com/olekukonko/tablewriter v0.0.4 // indirect
122+
github.com/pascaldekloe/name v0.0.0-20180628100202-0fd16699aae1 // indirect
123+
github.com/pelletier/go-toml v1.8.1 // indirect
124+
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect
125+
github.com/pkg/errors v0.9.1 // indirect
126+
github.com/pmezard/go-difflib v1.0.0 // indirect
127+
github.com/polyfloyd/go-errorlint v0.0.0-20201127212506-19bd8db6546f // indirect
128+
github.com/prometheus/client_golang v1.9.0 // indirect
129+
github.com/prometheus/client_model v0.2.0 // indirect
130+
github.com/prometheus/common v0.15.0 // indirect
131+
github.com/prometheus/procfs v0.3.0 // indirect
132+
github.com/pseudomuto/protokit v0.2.0 // indirect
133+
github.com/quasilyte/go-ruleguard v0.3.0 // indirect
134+
github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect
135+
github.com/ryancurrah/gomodguard v1.2.0 // indirect
136+
github.com/ryanrolds/sqlclosecheck v0.3.0 // indirect
137+
github.com/sanposhiho/wastedassign v0.1.3 // indirect
138+
github.com/satori/go.uuid v1.2.0 // indirect
139+
github.com/securego/gosec/v2 v2.6.1 // indirect
140+
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
141+
github.com/sirupsen/logrus v1.8.0 // indirect
142+
github.com/sonatard/noctx v0.0.1 // indirect
143+
github.com/sourcegraph/go-diff v0.6.1 // indirect
144+
github.com/spf13/afero v1.5.1 // indirect
145+
github.com/spf13/cast v1.3.1 // indirect
146+
github.com/spf13/cobra v1.1.3 // indirect
147+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
148+
github.com/spf13/pflag v1.0.5 // indirect
149+
github.com/spf13/viper v1.7.1 // indirect
150+
github.com/ssgreg/nlreturn/v2 v2.1.0 // indirect
151+
github.com/stretchr/objx v0.3.0 // indirect
152+
github.com/stretchr/testify v1.7.0 // indirect
153+
github.com/subosito/gotenv v1.2.0 // indirect
154+
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b // indirect
155+
github.com/tetafro/godot v1.4.4 // indirect
156+
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94 // indirect
157+
github.com/tomarrell/wrapcheck v0.0.0-20201130113247-1683564d9756 // indirect
158+
github.com/tommy-muehle/go-mnd/v2 v2.3.1 // indirect
159+
github.com/ultraware/funlen v0.0.3 // indirect
160+
github.com/ultraware/whitespace v0.0.4 // indirect
161+
github.com/uudashr/gocognit v1.0.1 // indirect
162+
go.opencensus.io v0.22.6 // indirect
163+
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
164+
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
165+
golang.org/x/mod v0.4.1 // indirect
166+
golang.org/x/net v0.0.0-20210119194325-5f4716e94777 // indirect
167+
golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013 // indirect
168+
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
169+
golang.org/x/text v0.3.5 // indirect
170+
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect
171+
golang.org/x/tools v0.1.0 // indirect
172+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
173+
google.golang.org/api v0.38.0 // indirect
174+
google.golang.org/appengine v1.6.7 // indirect
175+
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506 // indirect
176+
google.golang.org/grpc v1.35.0 // indirect
177+
google.golang.org/protobuf v1.25.0 // indirect
178+
gopkg.in/ini.v1 v1.62.0 // indirect
179+
gopkg.in/yaml.v2 v2.4.0 // indirect
180+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
181+
honnef.co/go/tools v0.1.2 // indirect
182+
k8s.io/apimachinery v0.20.2 // indirect
183+
k8s.io/client-go v0.0.0-20210217172142-7279fc64d847 // indirect
184+
k8s.io/klog/v2 v2.5.0 // indirect
185+
mvdan.cc/gofumpt v0.1.0 // indirect
186+
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
187+
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
188+
mvdan.cc/unparam v0.0.0-20210104141923-aac4ce9116a7 // indirect
11189
)
12190

13191
replace github.com/vektra/mockery => github.com/enghabu/mockery v0.0.0-20191009061720-9d0c8670c2f0

boilerplate/flyte/golang_support_tools/tools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ import (
77
_ "github.com/flyteorg/flytestdlib/cli/pflags"
88
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
99
_ "github.com/vektra/mockery/cmd/mockery"
10-
- "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
10+
_ "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
1111
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
echo "Running go generate"
6+
go generate ./...
7+
8+
# This section is used by GitHub workflow to ensure that the generation step was run
9+
if [ -n "$DELTA_CHECK" ]; then
10+
DIRTY=$(git status --porcelain)
11+
if [ -n "$DIRTY" ]; then
12+
echo "FAILED: Go code updated without commiting generated code."
13+
echo "Ensure make generate has run and all changes are committed."
14+
DIFF=$(git diff)
15+
echo "diff detected: $DIFF"
16+
DIFF=$(git diff --name-only)
17+
echo "files different: $DIFF"
18+
exit 1
19+
else
20+
echo "SUCCESS: Generated code is up to date."
21+
fi
22+
fi

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/aws/aws-sdk-go-v2/config v1.0.0
1414
github.com/aws/aws-sdk-go-v2/service/athena v1.0.0
1515
github.com/coocood/freecache v1.1.1
16-
github.com/flyteorg/flyteidl v0.21.11
16+
github.com/flyteorg/flyteidl v0.21.23
1717
github.com/flyteorg/flytestdlib v0.4.7
1818
github.com/go-logr/zapr v0.4.0 // indirect
1919
github.com/go-test/deep v1.0.7

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
325325
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
326326
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
327327
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
328-
github.com/flyteorg/flyteidl v0.21.11 h1:oH9YPoR7scO9GFF/I8D0gCTOB+JP5HRK7b7cLUBRz90=
329-
github.com/flyteorg/flyteidl v0.21.11/go.mod h1:576W2ViEyjTpT+kEVHAGbrTP3HARNUZ/eCwrNPmdx9U=
328+
github.com/flyteorg/flyteidl v0.21.23 h1:hzGIFNOt3VooW/NdnaicXijn3EKjNKTz1kY+tlHkED4=
329+
github.com/flyteorg/flyteidl v0.21.23/go.mod h1:576W2ViEyjTpT+kEVHAGbrTP3HARNUZ/eCwrNPmdx9U=
330330
github.com/flyteorg/flytestdlib v0.3.13/go.mod h1:Tz8JCECAbX6VWGwFT6cmEQ+RJpZ/6L9pswu3fzWs220=
331331
github.com/flyteorg/flytestdlib v0.4.7 h1:SMPPXI3j/MjP7D2fqaR+lPQkTrqYS7xZbwsgJI2F8SU=
332332
github.com/flyteorg/flytestdlib v0.4.7/go.mod h1:fv1ar34LJLMTaf0tbfetisLykUlARi7rP+NQTUn6QQs=

go/tasks/config_load_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ func TestLoadConfig(t *testing.T) {
8787
assert.NotNil(t, k8sConfig.DefaultSecurityContext)
8888
assert.NotNil(t, k8sConfig.DefaultSecurityContext.AllowPrivilegeEscalation)
8989
assert.False(t, *k8sConfig.DefaultSecurityContext.AllowPrivilegeEscalation)
90+
assert.NotNil(t, k8sConfig.EnableHostNetworkingPod)
91+
assert.True(t, *k8sConfig.EnableHostNetworkingPod)
9092
})
9193

9294
t.Run("logs-config-test", func(t *testing.T) {

go/tasks/pluginmachinery/core/phase.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"fmt"
55
"time"
66

7-
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/event"
8-
97
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
108
structpb "github.com/golang/protobuf/ptypes/struct"
119
)
@@ -69,6 +67,18 @@ func (p Phase) IsWaitingForResources() bool {
6967
return p == PhaseWaitingForResources
7068
}
7169

70+
type ExternalResource struct {
71+
// A unique identifier for the external resource
72+
ExternalID string
73+
// A unique index for the external resource. Although the ID may change, this will remain the same
74+
// throughout task event reports and retries.
75+
Index uint32
76+
// The nubmer of times this external resource has been attempted
77+
RetryAttempt uint32
78+
// Phase (if exists) associated with the external resource
79+
Phase Phase
80+
}
81+
7282
type TaskInfo struct {
7383
// log information for the task execution
7484
Logs []*core.TaskLog
@@ -77,8 +87,8 @@ type TaskInfo struct {
7787
OccurredAt *time.Time
7888
// Custom Event information that the plugin would like to expose to the front-end
7989
CustomInfo *structpb.Struct
80-
// Metadata around how a task was executed
81-
Metadata *event.TaskExecutionMetadata
90+
// A collection of information about external resources launched by this task
91+
ExternalResources []*ExternalResource
8292
}
8393

8494
func (t *TaskInfo) String() string {

go/tasks/pluginmachinery/flytek8s/config/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ type K8sPluginConfig struct {
139139
// DefaultSecurityContext provides a default container security context that should be applied for the primary container launched and created by FlytePropeller. This may not be applicable to all plugins. For
140140
// // downstream plugins - i.e. TensorflowOperators may not support setting this, but Spark does.
141141
DefaultSecurityContext *v1.SecurityContext `json:"default-security-context" pflag:"-,Optionally specify a default security context that should be applied to every container launched/created by FlytePropeller. This will not be applied to plugins that do not support it or to user supplied containers in pod tasks."`
142+
143+
// EnableHostNetworkingPod is a binary switch to enable `hostNetwork: true` for all pods launched by Flyte.
144+
// Refer to - https://kubernetes.io/docs/concepts/policy/pod-security-policy/#host-namespaces.
145+
// As a follow up, the default pod configurations will now be adjusted using podTemplates per namespace
146+
EnableHostNetworkingPod *bool `json:"enable-host-networking-pod" pflag:"-,If true, will schedule all pods with hostNetwork: true."`
142147
}
143148

144149
// FlyteCoPilotConfig specifies configuration for the Flyte CoPilot system. FlyteCoPilot, allows running flytekit-less containers

go/tasks/pluginmachinery/flytek8s/pod_helper.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ func UpdatePodWithInterruptibleFlag(taskExecutionMetadata pluginsCore.TaskExecut
9191
if podSpec.SecurityContext == nil && config.GetK8sPluginConfig().DefaultPodSecurityContext != nil {
9292
podSpec.SecurityContext = config.GetK8sPluginConfig().DefaultPodSecurityContext.DeepCopy()
9393
}
94+
if config.GetK8sPluginConfig().EnableHostNetworkingPod != nil {
95+
podSpec.HostNetwork = *config.GetK8sPluginConfig().EnableHostNetworkingPod
96+
}
9497
ApplyInterruptibleNodeAffinity(isInterruptible, podSpec)
9598
}
9699

go/tasks/pluginmachinery/flytek8s/pod_helper_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,36 @@ func TestToK8sPod(t *testing.T) {
494494
assert.NotNil(t, p.SecurityContext)
495495
assert.Equal(t, *p.SecurityContext.RunAsGroup, v)
496496
})
497+
498+
t.Run("enableHostNetwork", func(t *testing.T) {
499+
enabled := true
500+
assert.NoError(t, config.SetK8sPluginConfig(&config.K8sPluginConfig{
501+
EnableHostNetworkingPod: &enabled,
502+
}))
503+
x := dummyExecContext(&v1.ResourceRequirements{})
504+
p, err := ToK8sPodSpec(ctx, x)
505+
assert.NoError(t, err)
506+
assert.True(t, p.HostNetwork)
507+
})
508+
509+
t.Run("explicitDisableHostNetwork", func(t *testing.T) {
510+
enabled := false
511+
assert.NoError(t, config.SetK8sPluginConfig(&config.K8sPluginConfig{
512+
EnableHostNetworkingPod: &enabled,
513+
}))
514+
x := dummyExecContext(&v1.ResourceRequirements{})
515+
p, err := ToK8sPodSpec(ctx, x)
516+
assert.NoError(t, err)
517+
assert.False(t, p.HostNetwork)
518+
})
519+
520+
t.Run("skipSettingHostNetwork", func(t *testing.T) {
521+
assert.NoError(t, config.SetK8sPluginConfig(&config.K8sPluginConfig{}))
522+
x := dummyExecContext(&v1.ResourceRequirements{})
523+
p, err := ToK8sPodSpec(ctx, x)
524+
assert.NoError(t, err)
525+
assert.False(t, p.HostNetwork)
526+
})
497527
}
498528

499529
func TestDemystifyPending(t *testing.T) {

0 commit comments

Comments
 (0)