summaryrefslogtreecommitdiff
path: root/vendor/k8s.io/client-go/pkg/apis/networking
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-11-01 11:24:59 -0400
committerMatthew Heon <matthew.heon@gmail.com>2017-11-01 11:24:59 -0400
commita031b83a09a8628435317a03f199cdc18b78262f (patch)
treebc017a96769ce6de33745b8b0b1304ccf38e9df0 /vendor/k8s.io/client-go/pkg/apis/networking
parent2b74391cd5281f6fdf391ff8ad50fd1490f6bf89 (diff)
downloadpodman-a031b83a09a8628435317a03f199cdc18b78262f.tar.gz
podman-a031b83a09a8628435317a03f199cdc18b78262f.tar.bz2
podman-a031b83a09a8628435317a03f199cdc18b78262f.zip
Initial checkin from CRI-O repo
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'vendor/k8s.io/client-go/pkg/apis/networking')
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/doc.go18
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/register.go51
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/types.go115
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/conversion.go195
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/defaults.go34
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/doc.go18
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.pb.go1345
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.proto127
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/register.go50
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/types.generated.go2322
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/types.go120
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/types_swagger_doc_generated.go90
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.conversion.go195
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.deepcopy.go182
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.defaults.go51
-rw-r--r--vendor/k8s.io/client-go/pkg/apis/networking/zz_generated.deepcopy.go182
16 files changed, 5095 insertions, 0 deletions
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/doc.go b/vendor/k8s.io/client-go/pkg/apis/networking/doc.go
new file mode 100644
index 000000000..bf91d786a
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/doc.go
@@ -0,0 +1,18 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// +groupName=networking.k8s.io
+package networking
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/register.go b/vendor/k8s.io/client-go/pkg/apis/networking/register.go
new file mode 100644
index 000000000..4d58a210d
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/register.go
@@ -0,0 +1,51 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package networking
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName is the group name use in this package
+const GroupName = "networking.k8s.io"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
+
+// Kind takes an unqualified kind and returns a Group qualified GroupKind
+func Kind(kind string) schema.GroupKind {
+ return SchemeGroupVersion.WithKind(kind).GroupKind()
+}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ AddToScheme = SchemeBuilder.AddToScheme
+)
+
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &NetworkPolicy{},
+ &NetworkPolicyList{},
+ )
+ return nil
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/types.go b/vendor/k8s.io/client-go/pkg/apis/networking/types.go
new file mode 100644
index 000000000..010736f1b
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/types.go
@@ -0,0 +1,115 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package networking
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/util/intstr"
+ "k8s.io/client-go/pkg/api"
+)
+
+// +genclient=true
+
+// NetworkPolicy describes what network traffic is allowed for a set of Pods
+type NetworkPolicy struct {
+ metav1.TypeMeta
+ // +optional
+ metav1.ObjectMeta
+
+ // Specification of the desired behavior for this NetworkPolicy.
+ // +optional
+ Spec NetworkPolicySpec
+}
+
+// NetworkPolicySpec provides the specification of a NetworkPolicy
+type NetworkPolicySpec struct {
+ // Selects the pods to which this NetworkPolicy object applies. The array of
+ // ingress rules is applied to any pods selected by this field. Multiple network
+ // policies can select the same set of pods. In this case, the ingress rules for
+ // each are combined additively. This field is NOT optional and follows standard
+ // label selector semantics. An empty podSelector matches all pods in this
+ // namespace.
+ PodSelector metav1.LabelSelector
+
+ // List of ingress rules to be applied to the selected pods. Traffic is allowed to
+ // a pod if there are no NetworkPolicies selecting the pod
+ // (and cluster policy otherwise allows the traffic), OR if the traffic source is
+ // the pod's local node, OR if the traffic matches at least one ingress rule
+ // across all of the NetworkPolicy objects whose podSelector matches the pod. If
+ // this field is empty then this NetworkPolicy does not allow any traffic (and serves
+ // solely to ensure that the pods it selects are isolated by default)
+ // +optional
+ Ingress []NetworkPolicyIngressRule
+}
+
+// NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods
+// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.
+type NetworkPolicyIngressRule struct {
+ // List of ports which should be made accessible on the pods selected for this
+ // rule. Each item in this list is combined using a logical OR. If this field is
+ // empty or missing, this rule matches all ports (traffic not restricted by port).
+ // If this field is present and contains at least one item, then this rule allows
+ // traffic only if the traffic matches at least one port in the list.
+ // +optional
+ Ports []NetworkPolicyPort
+
+ // List of sources which should be able to access the pods selected for this rule.
+ // Items in this list are combined using a logical OR operation. If this field is
+ // empty or missing, this rule matches all sources (traffic not restricted by
+ // source). If this field is present and contains at least on item, this rule
+ // allows traffic only if the traffic matches at least one item in the from list.
+ // +optional
+ From []NetworkPolicyPeer
+}
+
+// NetworkPolicyPort describes a port to allow traffic on
+type NetworkPolicyPort struct {
+ // The protocol (TCP or UDP) which traffic must match. If not specified, this
+ // field defaults to TCP.
+ // +optional
+ Protocol *api.Protocol
+
+ // The port on the given protocol. This can either be a numerical or named port on
+ // a pod. If this field is not provided, this matches all port names and numbers.
+ // +optional
+ Port *intstr.IntOrString
+}
+
+// NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its fields
+// must be specified.
+type NetworkPolicyPeer struct {
+ // This is a label selector which selects Pods in this namespace. This field
+ // follows standard label selector semantics. If present but empty, this selector
+ // selects all pods in this namespace.
+ // +optional
+ PodSelector *metav1.LabelSelector
+
+ // Selects Namespaces using cluster scoped-labels. This matches all pods in all
+ // namespaces selected by this label selector. This field follows standard label
+ // selector semantics. If present but empty, this selector selects all namespaces.
+ // +optional
+ NamespaceSelector *metav1.LabelSelector
+}
+
+// NetworkPolicyList is a list of NetworkPolicy objects.
+type NetworkPolicyList struct {
+ metav1.TypeMeta
+ // +optional
+ metav1.ListMeta
+
+ Items []NetworkPolicy
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/conversion.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/conversion.go
new file mode 100644
index 000000000..21ec62576
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/conversion.go
@@ -0,0 +1,195 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/conversion"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/client-go/pkg/api"
+ "k8s.io/client-go/pkg/api/v1"
+ "k8s.io/client-go/pkg/apis/extensions"
+)
+
+func addConversionFuncs(scheme *runtime.Scheme) error {
+ return scheme.AddConversionFuncs(
+ Convert_v1_NetworkPolicy_To_extensions_NetworkPolicy,
+ Convert_extensions_NetworkPolicy_To_v1_NetworkPolicy,
+ Convert_v1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule,
+ Convert_extensions_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule,
+ Convert_v1_NetworkPolicyList_To_extensions_NetworkPolicyList,
+ Convert_extensions_NetworkPolicyList_To_v1_NetworkPolicyList,
+ Convert_v1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer,
+ Convert_extensions_NetworkPolicyPeer_To_v1_NetworkPolicyPeer,
+ Convert_v1_NetworkPolicyPort_To_extensions_NetworkPolicyPort,
+ Convert_extensions_NetworkPolicyPort_To_v1_NetworkPolicyPort,
+ Convert_v1_NetworkPolicySpec_To_extensions_NetworkPolicySpec,
+ Convert_extensions_NetworkPolicySpec_To_v1_NetworkPolicySpec,
+ )
+}
+
+func Convert_v1_NetworkPolicy_To_extensions_NetworkPolicy(in *NetworkPolicy, out *extensions.NetworkPolicy, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ return Convert_v1_NetworkPolicySpec_To_extensions_NetworkPolicySpec(&in.Spec, &out.Spec, s)
+}
+
+func Convert_extensions_NetworkPolicy_To_v1_NetworkPolicy(in *extensions.NetworkPolicy, out *NetworkPolicy, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ return Convert_extensions_NetworkPolicySpec_To_v1_NetworkPolicySpec(&in.Spec, &out.Spec, s)
+}
+
+func Convert_v1_NetworkPolicySpec_To_extensions_NetworkPolicySpec(in *NetworkPolicySpec, out *extensions.NetworkPolicySpec, s conversion.Scope) error {
+ if err := s.Convert(&in.PodSelector, &out.PodSelector, 0); err != nil {
+ return err
+ }
+ out.Ingress = make([]extensions.NetworkPolicyIngressRule, len(in.Ingress))
+ for i := range in.Ingress {
+ if err := Convert_v1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule(&in.Ingress[i], &out.Ingress[i], s); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func Convert_extensions_NetworkPolicySpec_To_v1_NetworkPolicySpec(in *extensions.NetworkPolicySpec, out *NetworkPolicySpec, s conversion.Scope) error {
+ if err := s.Convert(&in.PodSelector, &out.PodSelector, 0); err != nil {
+ return err
+ }
+ out.Ingress = make([]NetworkPolicyIngressRule, len(in.Ingress))
+ for i := range in.Ingress {
+ if err := Convert_extensions_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(&in.Ingress[i], &out.Ingress[i], s); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func Convert_v1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule(in *NetworkPolicyIngressRule, out *extensions.NetworkPolicyIngressRule, s conversion.Scope) error {
+ out.Ports = make([]extensions.NetworkPolicyPort, len(in.Ports))
+ for i := range in.Ports {
+ if err := Convert_v1_NetworkPolicyPort_To_extensions_NetworkPolicyPort(&in.Ports[i], &out.Ports[i], s); err != nil {
+ return err
+ }
+ }
+ out.From = make([]extensions.NetworkPolicyPeer, len(in.From))
+ for i := range in.From {
+ if err := Convert_v1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer(&in.From[i], &out.From[i], s); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func Convert_extensions_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(in *extensions.NetworkPolicyIngressRule, out *NetworkPolicyIngressRule, s conversion.Scope) error {
+ out.Ports = make([]NetworkPolicyPort, len(in.Ports))
+ for i := range in.Ports {
+ if err := Convert_extensions_NetworkPolicyPort_To_v1_NetworkPolicyPort(&in.Ports[i], &out.Ports[i], s); err != nil {
+ return err
+ }
+ }
+ out.From = make([]NetworkPolicyPeer, len(in.From))
+ for i := range in.From {
+ if err := Convert_extensions_NetworkPolicyPeer_To_v1_NetworkPolicyPeer(&in.From[i], &out.From[i], s); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func Convert_v1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer(in *NetworkPolicyPeer, out *extensions.NetworkPolicyPeer, s conversion.Scope) error {
+ if in.PodSelector != nil {
+ out.PodSelector = new(metav1.LabelSelector)
+ if err := s.Convert(in.PodSelector, out.PodSelector, 0); err != nil {
+ return err
+ }
+ } else {
+ out.PodSelector = nil
+ }
+ if in.NamespaceSelector != nil {
+ out.NamespaceSelector = new(metav1.LabelSelector)
+ if err := s.Convert(in.NamespaceSelector, out.NamespaceSelector, 0); err != nil {
+ return err
+ }
+ } else {
+ out.NamespaceSelector = nil
+ }
+ return nil
+}
+
+func Convert_extensions_NetworkPolicyPeer_To_v1_NetworkPolicyPeer(in *extensions.NetworkPolicyPeer, out *NetworkPolicyPeer, s conversion.Scope) error {
+ if in.PodSelector != nil {
+ out.PodSelector = new(metav1.LabelSelector)
+ if err := s.Convert(in.PodSelector, out.PodSelector, 0); err != nil {
+ return err
+ }
+ } else {
+ out.PodSelector = nil
+ }
+ if in.NamespaceSelector != nil {
+ out.NamespaceSelector = new(metav1.LabelSelector)
+ if err := s.Convert(in.NamespaceSelector, out.NamespaceSelector, 0); err != nil {
+ return err
+ }
+ } else {
+ out.NamespaceSelector = nil
+ }
+ return nil
+}
+
+func Convert_v1_NetworkPolicyPort_To_extensions_NetworkPolicyPort(in *NetworkPolicyPort, out *extensions.NetworkPolicyPort, s conversion.Scope) error {
+ if in.Protocol != nil {
+ out.Protocol = new(api.Protocol)
+ *out.Protocol = api.Protocol(*in.Protocol)
+ } else {
+ out.Protocol = nil
+ }
+ out.Port = in.Port
+ return nil
+}
+
+func Convert_extensions_NetworkPolicyPort_To_v1_NetworkPolicyPort(in *extensions.NetworkPolicyPort, out *NetworkPolicyPort, s conversion.Scope) error {
+ if in.Protocol != nil {
+ out.Protocol = new(v1.Protocol)
+ *out.Protocol = v1.Protocol(*in.Protocol)
+ } else {
+ out.Protocol = nil
+ }
+ out.Port = in.Port
+ return nil
+}
+
+func Convert_v1_NetworkPolicyList_To_extensions_NetworkPolicyList(in *NetworkPolicyList, out *extensions.NetworkPolicyList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = make([]extensions.NetworkPolicy, len(in.Items))
+ for i := range in.Items {
+ if err := Convert_v1_NetworkPolicy_To_extensions_NetworkPolicy(&in.Items[i], &out.Items[i], s); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func Convert_extensions_NetworkPolicyList_To_v1_NetworkPolicyList(in *extensions.NetworkPolicyList, out *NetworkPolicyList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = make([]NetworkPolicy, len(in.Items))
+ for i := range in.Items {
+ if err := Convert_extensions_NetworkPolicy_To_v1_NetworkPolicy(&in.Items[i], &out.Items[i], s); err != nil {
+ return err
+ }
+ }
+ return nil
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/defaults.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/defaults.go
new file mode 100644
index 000000000..7567cf751
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/defaults.go
@@ -0,0 +1,34 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/client-go/pkg/api/v1"
+)
+
+func addDefaultingFuncs(scheme *runtime.Scheme) error {
+ return RegisterDefaults(scheme)
+}
+
+func SetDefaults_NetworkPolicyPort(obj *NetworkPolicyPort) {
+ // Default any undefined Protocol fields to TCP.
+ if obj.Protocol == nil {
+ proto := v1.ProtocolTCP
+ obj.Protocol = &proto
+ }
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/doc.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/doc.go
new file mode 100644
index 000000000..f1250e70e
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/doc.go
@@ -0,0 +1,18 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// +groupName=networking.k8s.io
+package v1
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.pb.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.pb.go
new file mode 100644
index 000000000..671557dd5
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.pb.go
@@ -0,0 +1,1345 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by protoc-gen-gogo.
+// source: k8s.io/kubernetes/pkg/apis/networking/v1/generated.proto
+// DO NOT EDIT!
+
+/*
+ Package v1 is a generated protocol buffer package.
+
+ It is generated from these files:
+ k8s.io/kubernetes/pkg/apis/networking/v1/generated.proto
+
+ It has these top-level messages:
+ NetworkPolicy
+ NetworkPolicyIngressRule
+ NetworkPolicyList
+ NetworkPolicyPeer
+ NetworkPolicyPort
+ NetworkPolicySpec
+*/
+package v1
+
+import proto "github.com/gogo/protobuf/proto"
+import fmt "fmt"
+import math "math"
+
+import k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+import k8s_io_apimachinery_pkg_util_intstr "k8s.io/apimachinery/pkg/util/intstr"
+
+import k8s_io_kubernetes_pkg_api_v1 "k8s.io/client-go/pkg/api/v1"
+
+import strings "strings"
+import reflect "reflect"
+
+import io "io"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
+
+func (m *NetworkPolicy) Reset() { *m = NetworkPolicy{} }
+func (*NetworkPolicy) ProtoMessage() {}
+func (*NetworkPolicy) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
+
+func (m *NetworkPolicyIngressRule) Reset() { *m = NetworkPolicyIngressRule{} }
+func (*NetworkPolicyIngressRule) ProtoMessage() {}
+func (*NetworkPolicyIngressRule) Descriptor() ([]byte, []int) {
+ return fileDescriptorGenerated, []int{1}
+}
+
+func (m *NetworkPolicyList) Reset() { *m = NetworkPolicyList{} }
+func (*NetworkPolicyList) ProtoMessage() {}
+func (*NetworkPolicyList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} }
+
+func (m *NetworkPolicyPeer) Reset() { *m = NetworkPolicyPeer{} }
+func (*NetworkPolicyPeer) ProtoMessage() {}
+func (*NetworkPolicyPeer) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} }
+
+func (m *NetworkPolicyPort) Reset() { *m = NetworkPolicyPort{} }
+func (*NetworkPolicyPort) ProtoMessage() {}
+func (*NetworkPolicyPort) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} }
+
+func (m *NetworkPolicySpec) Reset() { *m = NetworkPolicySpec{} }
+func (*NetworkPolicySpec) ProtoMessage() {}
+func (*NetworkPolicySpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} }
+
+func init() {
+ proto.RegisterType((*NetworkPolicy)(nil), "k8s.io.client-go.pkg.apis.networking.v1.NetworkPolicy")
+ proto.RegisterType((*NetworkPolicyIngressRule)(nil), "k8s.io.client-go.pkg.apis.networking.v1.NetworkPolicyIngressRule")
+ proto.RegisterType((*NetworkPolicyList)(nil), "k8s.io.client-go.pkg.apis.networking.v1.NetworkPolicyList")
+ proto.RegisterType((*NetworkPolicyPeer)(nil), "k8s.io.client-go.pkg.apis.networking.v1.NetworkPolicyPeer")
+ proto.RegisterType((*NetworkPolicyPort)(nil), "k8s.io.client-go.pkg.apis.networking.v1.NetworkPolicyPort")
+ proto.RegisterType((*NetworkPolicySpec)(nil), "k8s.io.client-go.pkg.apis.networking.v1.NetworkPolicySpec")
+}
+func (m *NetworkPolicy) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *NetworkPolicy) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size()))
+ n1, err := m.ObjectMeta.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n1
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size()))
+ n2, err := m.Spec.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n2
+ return i, nil
+}
+
+func (m *NetworkPolicyIngressRule) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *NetworkPolicyIngressRule) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ if len(m.Ports) > 0 {
+ for _, msg := range m.Ports {
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
+ n, err := msg.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n
+ }
+ }
+ if len(m.From) > 0 {
+ for _, msg := range m.From {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
+ n, err := msg.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n
+ }
+ }
+ return i, nil
+}
+
+func (m *NetworkPolicyList) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *NetworkPolicyList) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size()))
+ n3, err := m.ListMeta.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n3
+ if len(m.Items) > 0 {
+ for _, msg := range m.Items {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
+ n, err := msg.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n
+ }
+ }
+ return i, nil
+}
+
+func (m *NetworkPolicyPeer) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *NetworkPolicyPeer) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ if m.PodSelector != nil {
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.PodSelector.Size()))
+ n4, err := m.PodSelector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n4
+ }
+ if m.NamespaceSelector != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.NamespaceSelector.Size()))
+ n5, err := m.NamespaceSelector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n5
+ }
+ return i, nil
+}
+
+func (m *NetworkPolicyPort) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *NetworkPolicyPort) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ if m.Protocol != nil {
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Protocol)))
+ i += copy(dAtA[i:], *m.Protocol)
+ }
+ if m.Port != nil {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.Port.Size()))
+ n6, err := m.Port.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n6
+ }
+ return i, nil
+}
+
+func (m *NetworkPolicySpec) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalTo(dAtA)
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *NetworkPolicySpec) MarshalTo(dAtA []byte) (int, error) {
+ var i int
+ _ = i
+ var l int
+ _ = l
+ dAtA[i] = 0xa
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(m.PodSelector.Size()))
+ n7, err := m.PodSelector.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n7
+ if len(m.Ingress) > 0 {
+ for _, msg := range m.Ingress {
+ dAtA[i] = 0x12
+ i++
+ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
+ n, err := msg.MarshalTo(dAtA[i:])
+ if err != nil {
+ return 0, err
+ }
+ i += n
+ }
+ }
+ return i, nil
+}
+
+func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int {
+ dAtA[offset] = uint8(v)
+ dAtA[offset+1] = uint8(v >> 8)
+ dAtA[offset+2] = uint8(v >> 16)
+ dAtA[offset+3] = uint8(v >> 24)
+ dAtA[offset+4] = uint8(v >> 32)
+ dAtA[offset+5] = uint8(v >> 40)
+ dAtA[offset+6] = uint8(v >> 48)
+ dAtA[offset+7] = uint8(v >> 56)
+ return offset + 8
+}
+func encodeFixed32Generated(dAtA []byte, offset int, v uint32) int {
+ dAtA[offset] = uint8(v)
+ dAtA[offset+1] = uint8(v >> 8)
+ dAtA[offset+2] = uint8(v >> 16)
+ dAtA[offset+3] = uint8(v >> 24)
+ return offset + 4
+}
+func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return offset + 1
+}
+func (m *NetworkPolicy) Size() (n int) {
+ var l int
+ _ = l
+ l = m.ObjectMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ l = m.Spec.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
+func (m *NetworkPolicyIngressRule) Size() (n int) {
+ var l int
+ _ = l
+ if len(m.Ports) > 0 {
+ for _, e := range m.Ports {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ if len(m.From) > 0 {
+ for _, e := range m.From {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *NetworkPolicyList) Size() (n int) {
+ var l int
+ _ = l
+ l = m.ListMeta.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Items) > 0 {
+ for _, e := range m.Items {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *NetworkPolicyPeer) Size() (n int) {
+ var l int
+ _ = l
+ if m.PodSelector != nil {
+ l = m.PodSelector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.NamespaceSelector != nil {
+ l = m.NamespaceSelector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
+}
+
+func (m *NetworkPolicyPort) Size() (n int) {
+ var l int
+ _ = l
+ if m.Protocol != nil {
+ l = len(*m.Protocol)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ if m.Port != nil {
+ l = m.Port.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ return n
+}
+
+func (m *NetworkPolicySpec) Size() (n int) {
+ var l int
+ _ = l
+ l = m.PodSelector.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ if len(m.Ingress) > 0 {
+ for _, e := range m.Ingress {
+ l = e.Size()
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
+ return n
+}
+
+func sovGenerated(x uint64) (n int) {
+ for {
+ n++
+ x >>= 7
+ if x == 0 {
+ break
+ }
+ }
+ return n
+}
+func sozGenerated(x uint64) (n int) {
+ return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (this *NetworkPolicy) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&NetworkPolicy{`,
+ `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
+ `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "NetworkPolicySpec", "NetworkPolicySpec", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *NetworkPolicyIngressRule) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&NetworkPolicyIngressRule{`,
+ `Ports:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Ports), "NetworkPolicyPort", "NetworkPolicyPort", 1), `&`, ``, 1) + `,`,
+ `From:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.From), "NetworkPolicyPeer", "NetworkPolicyPeer", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *NetworkPolicyList) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&NetworkPolicyList{`,
+ `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`,
+ `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "NetworkPolicy", "NetworkPolicy", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *NetworkPolicyPeer) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&NetworkPolicyPeer{`,
+ `PodSelector:` + strings.Replace(fmt.Sprintf("%v", this.PodSelector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
+ `NamespaceSelector:` + strings.Replace(fmt.Sprintf("%v", this.NamespaceSelector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *NetworkPolicyPort) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&NetworkPolicyPort{`,
+ `Protocol:` + valueToStringGenerated(this.Protocol) + `,`,
+ `Port:` + strings.Replace(fmt.Sprintf("%v", this.Port), "IntOrString", "k8s_io_apimachinery_pkg_util_intstr.IntOrString", 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func (this *NetworkPolicySpec) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&NetworkPolicySpec{`,
+ `PodSelector:` + strings.Replace(strings.Replace(this.PodSelector.String(), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1), `&`, ``, 1) + `,`,
+ `Ingress:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Ingress), "NetworkPolicyIngressRule", "NetworkPolicyIngressRule", 1), `&`, ``, 1) + `,`,
+ `}`,
+ }, "")
+ return s
+}
+func valueToStringGenerated(v interface{}) string {
+ rv := reflect.ValueOf(v)
+ if rv.IsNil() {
+ return "nil"
+ }
+ pv := reflect.Indirect(rv).Interface()
+ return fmt.Sprintf("*%v", pv)
+}
+func (m *NetworkPolicy) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: NetworkPolicy: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: NetworkPolicy: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *NetworkPolicyIngressRule) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: NetworkPolicyIngressRule: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: NetworkPolicyIngressRule: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Ports = append(m.Ports, NetworkPolicyPort{})
+ if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.From = append(m.From, NetworkPolicyPeer{})
+ if err := m.From[len(m.From)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *NetworkPolicyList) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: NetworkPolicyList: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: NetworkPolicyList: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Items = append(m.Items, NetworkPolicy{})
+ if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *NetworkPolicyPeer) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: NetworkPolicyPeer: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: NetworkPolicyPeer: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field PodSelector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.PodSelector == nil {
+ m.PodSelector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.PodSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field NamespaceSelector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.NamespaceSelector == nil {
+ m.NamespaceSelector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
+ }
+ if err := m.NamespaceSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *NetworkPolicyPort) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: NetworkPolicyPort: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: NetworkPolicyPort: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ s := k8s_io_kubernetes_pkg_api_v1.Protocol(dAtA[iNdEx:postIndex])
+ m.Protocol = &s
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Port == nil {
+ m.Port = &k8s_io_apimachinery_pkg_util_intstr.IntOrString{}
+ }
+ if err := m.Port.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *NetworkPolicySpec) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: NetworkPolicySpec: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: NetworkPolicySpec: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field PodSelector", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.PodSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Ingress", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ postIndex := iNdEx + msglen
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Ingress = append(m.Ingress, NetworkPolicyIngressRule{})
+ if err := m.Ingress[len(m.Ingress)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipGenerated(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if skippy < 0 {
+ return ErrInvalidLengthGenerated
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipGenerated(dAtA []byte) (n int, err error) {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ wireType := int(wire & 0x7)
+ switch wireType {
+ case 0:
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ iNdEx++
+ if dAtA[iNdEx-1] < 0x80 {
+ break
+ }
+ }
+ return iNdEx, nil
+ case 1:
+ iNdEx += 8
+ return iNdEx, nil
+ case 2:
+ var length int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ iNdEx += length
+ if length < 0 {
+ return 0, ErrInvalidLengthGenerated
+ }
+ return iNdEx, nil
+ case 3:
+ for {
+ var innerWire uint64
+ var start int = iNdEx
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ innerWire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ innerWireType := int(innerWire & 0x7)
+ if innerWireType == 4 {
+ break
+ }
+ next, err := skipGenerated(dAtA[start:])
+ if err != nil {
+ return 0, err
+ }
+ iNdEx = start + next
+ }
+ return iNdEx, nil
+ case 4:
+ return iNdEx, nil
+ case 5:
+ iNdEx += 4
+ return iNdEx, nil
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ }
+ panic("unreachable")
+}
+
+var (
+ ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
+)
+
+func init() {
+ proto.RegisterFile("k8s.io/client-go/pkg/apis/networking/v1/generated.proto", fileDescriptorGenerated)
+}
+
+var fileDescriptorGenerated = []byte{
+ // 666 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcf, 0x4f, 0x13, 0x41,
+ 0x18, 0xed, 0x56, 0x08, 0x75, 0x90, 0x20, 0x6b, 0x4c, 0x1a, 0x0e, 0x5b, 0xd2, 0xc4, 0x84, 0x83,
+ 0xce, 0x5a, 0xf1, 0x07, 0xc6, 0x78, 0xd9, 0x83, 0x09, 0x89, 0x42, 0x5d, 0x6e, 0x06, 0x13, 0xa6,
+ 0xcb, 0xc7, 0x32, 0xb4, 0x3b, 0xb3, 0x99, 0x99, 0x56, 0xb8, 0xf9, 0x27, 0xf8, 0xd7, 0xf8, 0x37,
+ 0x70, 0x93, 0x23, 0x89, 0x49, 0x23, 0xeb, 0xdd, 0x9b, 0x17, 0x4f, 0x66, 0x76, 0xa7, 0x6c, 0x61,
+ 0x59, 0x24, 0xc5, 0xdb, 0xcc, 0xe4, 0x7b, 0xef, 0x7d, 0x6f, 0xde, 0x37, 0x83, 0x56, 0xbb, 0xab,
+ 0x12, 0x53, 0xee, 0x76, 0xfb, 0x1d, 0x10, 0x0c, 0x14, 0x48, 0x37, 0xee, 0x86, 0x2e, 0x89, 0xa9,
+ 0x74, 0x19, 0xa8, 0x4f, 0x5c, 0x74, 0x29, 0x0b, 0xdd, 0x41, 0xcb, 0x0d, 0x81, 0x81, 0x20, 0x0a,
+ 0x76, 0x70, 0x2c, 0xb8, 0xe2, 0xf6, 0x72, 0x86, 0xc4, 0x39, 0x12, 0xc7, 0xdd, 0x10, 0x6b, 0x24,
+ 0xce, 0x91, 0x78, 0xd0, 0x5a, 0x7c, 0x14, 0x52, 0xb5, 0xd7, 0xef, 0xe0, 0x80, 0x47, 0x6e, 0xc8,
+ 0x43, 0xee, 0xa6, 0x04, 0x9d, 0xfe, 0x6e, 0xba, 0x4b, 0x37, 0xe9, 0x2a, 0x23, 0x5e, 0x7c, 0x6a,
+ 0x5a, 0x22, 0x31, 0x8d, 0x48, 0xb0, 0x47, 0x19, 0x88, 0xc3, 0xbc, 0xa9, 0x08, 0x14, 0xb9, 0xa4,
+ 0x9d, 0x45, 0xb7, 0x0c, 0x25, 0xfa, 0x4c, 0xd1, 0x08, 0x0a, 0x80, 0xe7, 0xff, 0x02, 0xc8, 0x60,
+ 0x0f, 0x22, 0x52, 0xc0, 0xad, 0x94, 0xe1, 0xfa, 0x8a, 0xf6, 0x5c, 0xca, 0x94, 0x54, 0xa2, 0x00,
+ 0x7a, 0x58, 0x7a, 0xcd, 0x97, 0x79, 0x79, 0x7d, 0x45, 0x28, 0x70, 0xa0, 0x80, 0x49, 0xca, 0x99,
+ 0x74, 0x07, 0xad, 0x0e, 0x28, 0x52, 0x84, 0xbf, 0xbc, 0x02, 0x1e, 0xf3, 0x1e, 0x0d, 0x0e, 0xcb,
+ 0xa0, 0xcd, 0x63, 0x0b, 0xcd, 0xad, 0x67, 0xe1, 0xb5, 0xd3, 0x4a, 0x7b, 0x1b, 0xd5, 0xf4, 0x95,
+ 0xef, 0x10, 0x45, 0xea, 0xd6, 0x92, 0xb5, 0x3c, 0xfb, 0xe4, 0x31, 0x36, 0xc9, 0x8f, 0xdf, 0x40,
+ 0x9e, 0xbd, 0xae, 0xc6, 0x83, 0x16, 0xde, 0xe8, 0xec, 0x43, 0xa0, 0xde, 0x81, 0x22, 0x9e, 0x7d,
+ 0x34, 0x6c, 0x54, 0x92, 0x61, 0x03, 0xe5, 0x67, 0xfe, 0x19, 0xab, 0xfd, 0x11, 0x4d, 0xc9, 0x18,
+ 0x82, 0x7a, 0x35, 0x65, 0x7f, 0x85, 0xaf, 0x3b, 0x57, 0xf8, 0x5c, 0xa3, 0x9b, 0x31, 0x04, 0xde,
+ 0x1d, 0x23, 0x34, 0xa5, 0x77, 0x7e, 0x4a, 0xdb, 0xfc, 0x6e, 0xa1, 0xfa, 0xb9, 0xca, 0x35, 0x16,
+ 0x0a, 0x90, 0xd2, 0xef, 0xf7, 0xc0, 0xde, 0x46, 0xd3, 0x31, 0x17, 0x4a, 0xd6, 0xad, 0xa5, 0x5b,
+ 0x37, 0x10, 0x6f, 0x73, 0xa1, 0xbc, 0x39, 0x23, 0x3e, 0xad, 0x77, 0xd2, 0xcf, 0x88, 0xb5, 0xbb,
+ 0x5d, 0xc1, 0xa3, 0x7a, 0xf5, 0x66, 0x02, 0x00, 0x22, 0x77, 0xf7, 0x46, 0xf0, 0xc8, 0x4f, 0x69,
+ 0x9b, 0xdf, 0x2c, 0xb4, 0x70, 0xae, 0xf2, 0x2d, 0x95, 0xca, 0xde, 0x2a, 0x84, 0x86, 0xaf, 0x17,
+ 0x9a, 0x46, 0xa7, 0x91, 0xdd, 0x35, 0x5a, 0xb5, 0xd1, 0xc9, 0x58, 0x60, 0x5b, 0x68, 0x9a, 0x2a,
+ 0x88, 0xa4, 0xf1, 0xf4, 0x62, 0x42, 0x4f, 0xf9, 0x85, 0xad, 0x69, 0x36, 0x3f, 0x23, 0x6d, 0xfe,
+ 0xbe, 0xe8, 0x48, 0x7b, 0xb7, 0x77, 0xd1, 0x6c, 0xcc, 0x77, 0x36, 0xa1, 0x07, 0x81, 0xe2, 0xc2,
+ 0x98, 0x5a, 0xb9, 0xa6, 0x29, 0xd2, 0x81, 0xde, 0x08, 0xea, 0xcd, 0x27, 0xc3, 0xc6, 0x6c, 0x3b,
+ 0xe7, 0xf2, 0xc7, 0x89, 0xed, 0x03, 0xb4, 0xc0, 0x48, 0x04, 0x32, 0x26, 0x01, 0x9c, 0xa9, 0x55,
+ 0x27, 0x57, 0xbb, 0x9f, 0x0c, 0x1b, 0x0b, 0xeb, 0x17, 0x19, 0xfd, 0xa2, 0x48, 0xf3, 0x6b, 0xc1,
+ 0x37, 0x17, 0xca, 0x7e, 0x8f, 0x6a, 0xe9, 0xcb, 0x0c, 0x78, 0x2f, 0x35, 0x7d, 0xdb, 0x7b, 0xa6,
+ 0x53, 0x69, 0x9b, 0xb3, 0x3f, 0xc3, 0xc6, 0x83, 0xab, 0xbe, 0x16, 0x3c, 0x2a, 0xf4, 0xcf, 0x68,
+ 0xec, 0x75, 0x34, 0xa5, 0x47, 0xd3, 0xb8, 0x2a, 0x7f, 0xcd, 0xfa, 0x3f, 0xc3, 0xd9, 0x7f, 0x86,
+ 0xd7, 0x98, 0xda, 0x10, 0x9b, 0x4a, 0x50, 0x16, 0x7a, 0x35, 0x3d, 0x82, 0xba, 0x39, 0x3f, 0xe5,
+ 0x69, 0xfe, 0xba, 0xd8, 0xb8, 0x7e, 0x7c, 0xf6, 0xfe, 0x7f, 0x0b, 0xec, 0x9e, 0x19, 0x93, 0xf2,
+ 0xd0, 0x22, 0x34, 0x43, 0xb3, 0x47, 0x6d, 0x46, 0xd2, 0x9b, 0x70, 0x24, 0xc7, 0xbe, 0x06, 0x6f,
+ 0xde, 0xc8, 0xce, 0x8c, 0x0e, 0x47, 0x1a, 0xde, 0xf2, 0xd1, 0xa9, 0x53, 0x39, 0x3e, 0x75, 0x2a,
+ 0x27, 0xa7, 0x4e, 0xe5, 0x73, 0xe2, 0x58, 0x47, 0x89, 0x63, 0x1d, 0x27, 0x8e, 0x75, 0x92, 0x38,
+ 0xd6, 0x8f, 0xc4, 0xb1, 0xbe, 0xfc, 0x74, 0x2a, 0x1f, 0xaa, 0x83, 0xd6, 0xdf, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xfa, 0x8d, 0x62, 0x1f, 0x5e, 0x07, 0x00, 0x00,
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.proto b/vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.proto
new file mode 100644
index 000000000..3170b55f8
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.proto
@@ -0,0 +1,127 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+
+// This file was autogenerated by go-to-protobuf. Do not edit it manually!
+
+syntax = 'proto2';
+
+package k8s.io.client_go.pkg.apis.networking.v1;
+
+import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/generated.proto";
+import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
+import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
+import "k8s.io/kubernetes/pkg/api/v1/generated.proto";
+import "k8s.io/kubernetes/pkg/apis/extensions/v1beta1/generated.proto";
+import "k8s.io/kubernetes/pkg/apis/policy/v1beta1/generated.proto";
+
+// Package-wide variables from generator "generated".
+option go_package = "v1";
+
+// NetworkPolicy describes what network traffic is allowed for a set of Pods
+message NetworkPolicy {
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+
+ // Specification of the desired behavior for this NetworkPolicy.
+ // +optional
+ optional NetworkPolicySpec spec = 2;
+}
+
+// NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods
+// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.
+message NetworkPolicyIngressRule {
+ // List of ports which should be made accessible on the pods selected for this
+ // rule. Each item in this list is combined using a logical OR. If this field is
+ // empty or missing, this rule matches all ports (traffic not restricted by port).
+ // If this field is present and contains at least one item, then this rule allows
+ // traffic only if the traffic matches at least one port in the list.
+ // +optional
+ repeated NetworkPolicyPort ports = 1;
+
+ // List of sources which should be able to access the pods selected for this rule.
+ // Items in this list are combined using a logical OR operation. If this field is
+ // empty or missing, this rule matches all sources (traffic not restricted by
+ // source). If this field is present and contains at least on item, this rule
+ // allows traffic only if the traffic matches at least one item in the from list.
+ // +optional
+ repeated NetworkPolicyPeer from = 2;
+}
+
+// NetworkPolicyList is a list of NetworkPolicy objects.
+message NetworkPolicyList {
+ // Standard list metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+
+ // Items is a list of schema objects.
+ repeated NetworkPolicy items = 2;
+}
+
+// NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its fields
+// must be specified.
+message NetworkPolicyPeer {
+ // This is a label selector which selects Pods in this namespace. This field
+ // follows standard label selector semantics. If present but empty, this selector
+ // selects all pods in this namespace.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
+
+ // Selects Namespaces using cluster scoped-labels. This matches all pods in all
+ // namespaces selected by this label selector. This field follows standard label
+ // selector semantics. If present but empty, this selector selects all namespaces.
+ // +optional
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2;
+}
+
+// NetworkPolicyPort describes a port to allow traffic on
+message NetworkPolicyPort {
+ // The protocol (TCP or UDP) which traffic must match. If not specified, this
+ // field defaults to TCP.
+ // +optional
+ optional string protocol = 1;
+
+ // The port on the given protocol. This can either be a numerical or named port on
+ // a pod. If this field is not provided, this matches all port names and numbers.
+ // +optional
+ optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;
+}
+
+// NetworkPolicySpec provides the specification of a NetworkPolicy
+message NetworkPolicySpec {
+ // Selects the pods to which this NetworkPolicy object applies. The array of
+ // ingress rules is applied to any pods selected by this field. Multiple network
+ // policies can select the same set of pods. In this case, the ingress rules for
+ // each are combined additively. This field is NOT optional and follows standard
+ // label selector semantics. An empty podSelector matches all pods in this
+ // namespace.
+ optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
+
+ // List of ingress rules to be applied to the selected pods. Traffic is allowed to
+ // a pod if there are no NetworkPolicies selecting the pod
+ // (and cluster policy otherwise allows the traffic), OR if the traffic source is
+ // the pod's local node, OR if the traffic matches at least one ingress rule
+ // across all of the NetworkPolicy objects whose podSelector matches the pod. If
+ // this field is empty then this NetworkPolicy does not allow any traffic (and serves
+ // solely to ensure that the pods it selects are isolated by default)
+ // +optional
+ repeated NetworkPolicyIngressRule ingress = 2;
+}
+
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/register.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/register.go
new file mode 100644
index 000000000..c8d3c83bc
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/register.go
@@ -0,0 +1,50 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// GroupName is the group name use in this package
+const GroupName = "networking.k8s.io"
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
+
+// Resource takes an unqualified resource and returns a Group qualified GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs, addConversionFuncs)
+ AddToScheme = SchemeBuilder.AddToScheme
+)
+
+// Adds the list of known types to api.Scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &NetworkPolicy{},
+ &NetworkPolicyList{},
+ )
+
+ metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/types.generated.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/types.generated.go
new file mode 100644
index 000000000..da04aee42
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/types.generated.go
@@ -0,0 +1,2322 @@
+/*
+Copyright 2016 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// ************************************************************
+// DO NOT EDIT.
+// THIS FILE IS AUTO-GENERATED BY codecgen.
+// ************************************************************
+
+package v1
+
+import (
+ "errors"
+ "fmt"
+ codec1978 "github.com/ugorji/go/codec"
+ pkg1_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ pkg2_types "k8s.io/apimachinery/pkg/types"
+ pkg4_intstr "k8s.io/apimachinery/pkg/util/intstr"
+ pkg3_v1 "k8s.io/client-go/pkg/api/v1"
+ "reflect"
+ "runtime"
+ time "time"
+)
+
+const (
+ // ----- content types ----
+ codecSelferC_UTF81234 = 1
+ codecSelferC_RAW1234 = 0
+ // ----- value types used ----
+ codecSelferValueTypeArray1234 = 10
+ codecSelferValueTypeMap1234 = 9
+ // ----- containerStateValues ----
+ codecSelfer_containerMapKey1234 = 2
+ codecSelfer_containerMapValue1234 = 3
+ codecSelfer_containerMapEnd1234 = 4
+ codecSelfer_containerArrayElem1234 = 6
+ codecSelfer_containerArrayEnd1234 = 7
+)
+
+var (
+ codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits())
+ codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`)
+)
+
+type codecSelfer1234 struct{}
+
+func init() {
+ if codec1978.GenVersion != 5 {
+ _, file, _, _ := runtime.Caller(0)
+ err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v",
+ 5, codec1978.GenVersion, file)
+ panic(err)
+ }
+ if false { // reference the types, but skip this branch at build/run time
+ var v0 pkg1_v1.TypeMeta
+ var v1 pkg2_types.UID
+ var v2 pkg4_intstr.IntOrString
+ var v3 pkg3_v1.Protocol
+ var v4 time.Time
+ _, _, _, _, _ = v0, v1, v2, v3, v4
+ }
+}
+
+func (x *NetworkPolicy) CodecEncodeSelf(e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ if x == nil {
+ r.EncodeNil()
+ } else {
+ yym1 := z.EncBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x) {
+ } else {
+ yysep2 := !z.EncBinary()
+ yy2arr2 := z.EncBasicHandle().StructToArray
+ var yyq2 [4]bool
+ _, _, _ = yysep2, yyq2, yy2arr2
+ const yyr2 bool = false
+ yyq2[0] = x.Kind != ""
+ yyq2[1] = x.APIVersion != ""
+ yyq2[2] = true
+ yyq2[3] = true
+ var yynn2 int
+ if yyr2 || yy2arr2 {
+ r.EncodeArrayStart(4)
+ } else {
+ yynn2 = 0
+ for _, b := range yyq2 {
+ if b {
+ yynn2++
+ }
+ }
+ r.EncodeMapStart(yynn2)
+ yynn2 = 0
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[0] {
+ yym4 := z.EncBinary()
+ _ = yym4
+ if false {
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
+ }
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, "")
+ }
+ } else {
+ if yyq2[0] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("kind"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ yym5 := z.EncBinary()
+ _ = yym5
+ if false {
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[1] {
+ yym7 := z.EncBinary()
+ _ = yym7
+ if false {
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
+ }
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, "")
+ }
+ } else {
+ if yyq2[1] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("apiVersion"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ yym8 := z.EncBinary()
+ _ = yym8
+ if false {
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[2] {
+ yy10 := &x.ObjectMeta
+ yym11 := z.EncBinary()
+ _ = yym11
+ if false {
+ } else if z.HasExtensions() && z.EncExt(yy10) {
+ } else {
+ z.EncFallback(yy10)
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[2] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("metadata"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ yy12 := &x.ObjectMeta
+ yym13 := z.EncBinary()
+ _ = yym13
+ if false {
+ } else if z.HasExtensions() && z.EncExt(yy12) {
+ } else {
+ z.EncFallback(yy12)
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[3] {
+ yy15 := &x.Spec
+ yy15.CodecEncodeSelf(e)
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[3] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("spec"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ yy17 := &x.Spec
+ yy17.CodecEncodeSelf(e)
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ z.EncSendContainerState(codecSelfer_containerMapEnd1234)
+ }
+ }
+ }
+}
+
+func (x *NetworkPolicy) CodecDecodeSelf(d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ yym1 := z.DecBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x) {
+ } else {
+ yyct2 := r.ContainerType()
+ if yyct2 == codecSelferValueTypeMap1234 {
+ yyl2 := r.ReadMapStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+ } else {
+ x.codecDecodeSelfFromMap(yyl2, d)
+ }
+ } else if yyct2 == codecSelferValueTypeArray1234 {
+ yyl2 := r.ReadArrayStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ x.codecDecodeSelfFromArray(yyl2, d)
+ }
+ } else {
+ panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
+ }
+ }
+}
+
+func (x *NetworkPolicy) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yys3Slc = z.DecScratchBuffer() // default slice to decode into
+ _ = yys3Slc
+ var yyhl3 bool = l >= 0
+ for yyj3 := 0; ; yyj3++ {
+ if yyhl3 {
+ if yyj3 >= l {
+ break
+ }
+ } else {
+ if r.CheckBreak() {
+ break
+ }
+ }
+ z.DecSendContainerState(codecSelfer_containerMapKey1234)
+ yys3Slc = r.DecodeBytes(yys3Slc, true, true)
+ yys3 := string(yys3Slc)
+ z.DecSendContainerState(codecSelfer_containerMapValue1234)
+ switch yys3 {
+ case "kind":
+ if r.TryDecodeAsNil() {
+ x.Kind = ""
+ } else {
+ yyv4 := &x.Kind
+ yym5 := z.DecBinary()
+ _ = yym5
+ if false {
+ } else {
+ *((*string)(yyv4)) = r.DecodeString()
+ }
+ }
+ case "apiVersion":
+ if r.TryDecodeAsNil() {
+ x.APIVersion = ""
+ } else {
+ yyv6 := &x.APIVersion
+ yym7 := z.DecBinary()
+ _ = yym7
+ if false {
+ } else {
+ *((*string)(yyv6)) = r.DecodeString()
+ }
+ }
+ case "metadata":
+ if r.TryDecodeAsNil() {
+ x.ObjectMeta = pkg1_v1.ObjectMeta{}
+ } else {
+ yyv8 := &x.ObjectMeta
+ yym9 := z.DecBinary()
+ _ = yym9
+ if false {
+ } else if z.HasExtensions() && z.DecExt(yyv8) {
+ } else {
+ z.DecFallback(yyv8, false)
+ }
+ }
+ case "spec":
+ if r.TryDecodeAsNil() {
+ x.Spec = NetworkPolicySpec{}
+ } else {
+ yyv10 := &x.Spec
+ yyv10.CodecDecodeSelf(d)
+ }
+ default:
+ z.DecStructFieldNotFound(-1, yys3)
+ } // end switch yys3
+ } // end for yyj3
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+}
+
+func (x *NetworkPolicy) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yyj11 int
+ var yyb11 bool
+ var yyhl11 bool = l >= 0
+ yyj11++
+ if yyhl11 {
+ yyb11 = yyj11 > l
+ } else {
+ yyb11 = r.CheckBreak()
+ }
+ if yyb11 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.Kind = ""
+ } else {
+ yyv12 := &x.Kind
+ yym13 := z.DecBinary()
+ _ = yym13
+ if false {
+ } else {
+ *((*string)(yyv12)) = r.DecodeString()
+ }
+ }
+ yyj11++
+ if yyhl11 {
+ yyb11 = yyj11 > l
+ } else {
+ yyb11 = r.CheckBreak()
+ }
+ if yyb11 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.APIVersion = ""
+ } else {
+ yyv14 := &x.APIVersion
+ yym15 := z.DecBinary()
+ _ = yym15
+ if false {
+ } else {
+ *((*string)(yyv14)) = r.DecodeString()
+ }
+ }
+ yyj11++
+ if yyhl11 {
+ yyb11 = yyj11 > l
+ } else {
+ yyb11 = r.CheckBreak()
+ }
+ if yyb11 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.ObjectMeta = pkg1_v1.ObjectMeta{}
+ } else {
+ yyv16 := &x.ObjectMeta
+ yym17 := z.DecBinary()
+ _ = yym17
+ if false {
+ } else if z.HasExtensions() && z.DecExt(yyv16) {
+ } else {
+ z.DecFallback(yyv16, false)
+ }
+ }
+ yyj11++
+ if yyhl11 {
+ yyb11 = yyj11 > l
+ } else {
+ yyb11 = r.CheckBreak()
+ }
+ if yyb11 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.Spec = NetworkPolicySpec{}
+ } else {
+ yyv18 := &x.Spec
+ yyv18.CodecDecodeSelf(d)
+ }
+ for {
+ yyj11++
+ if yyhl11 {
+ yyb11 = yyj11 > l
+ } else {
+ yyb11 = r.CheckBreak()
+ }
+ if yyb11 {
+ break
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ z.DecStructFieldNotFound(yyj11-1, "")
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x *NetworkPolicySpec) CodecEncodeSelf(e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ if x == nil {
+ r.EncodeNil()
+ } else {
+ yym1 := z.EncBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x) {
+ } else {
+ yysep2 := !z.EncBinary()
+ yy2arr2 := z.EncBasicHandle().StructToArray
+ var yyq2 [2]bool
+ _, _, _ = yysep2, yyq2, yy2arr2
+ const yyr2 bool = false
+ yyq2[1] = len(x.Ingress) != 0
+ var yynn2 int
+ if yyr2 || yy2arr2 {
+ r.EncodeArrayStart(2)
+ } else {
+ yynn2 = 1
+ for _, b := range yyq2 {
+ if b {
+ yynn2++
+ }
+ }
+ r.EncodeMapStart(yynn2)
+ yynn2 = 0
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ yy4 := &x.PodSelector
+ yym5 := z.EncBinary()
+ _ = yym5
+ if false {
+ } else if z.HasExtensions() && z.EncExt(yy4) {
+ } else {
+ z.EncFallback(yy4)
+ }
+ } else {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("podSelector"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ yy6 := &x.PodSelector
+ yym7 := z.EncBinary()
+ _ = yym7
+ if false {
+ } else if z.HasExtensions() && z.EncExt(yy6) {
+ } else {
+ z.EncFallback(yy6)
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[1] {
+ if x.Ingress == nil {
+ r.EncodeNil()
+ } else {
+ yym9 := z.EncBinary()
+ _ = yym9
+ if false {
+ } else {
+ h.encSliceNetworkPolicyIngressRule(([]NetworkPolicyIngressRule)(x.Ingress), e)
+ }
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[1] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("ingress"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.Ingress == nil {
+ r.EncodeNil()
+ } else {
+ yym10 := z.EncBinary()
+ _ = yym10
+ if false {
+ } else {
+ h.encSliceNetworkPolicyIngressRule(([]NetworkPolicyIngressRule)(x.Ingress), e)
+ }
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ z.EncSendContainerState(codecSelfer_containerMapEnd1234)
+ }
+ }
+ }
+}
+
+func (x *NetworkPolicySpec) CodecDecodeSelf(d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ yym1 := z.DecBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x) {
+ } else {
+ yyct2 := r.ContainerType()
+ if yyct2 == codecSelferValueTypeMap1234 {
+ yyl2 := r.ReadMapStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+ } else {
+ x.codecDecodeSelfFromMap(yyl2, d)
+ }
+ } else if yyct2 == codecSelferValueTypeArray1234 {
+ yyl2 := r.ReadArrayStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ x.codecDecodeSelfFromArray(yyl2, d)
+ }
+ } else {
+ panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
+ }
+ }
+}
+
+func (x *NetworkPolicySpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yys3Slc = z.DecScratchBuffer() // default slice to decode into
+ _ = yys3Slc
+ var yyhl3 bool = l >= 0
+ for yyj3 := 0; ; yyj3++ {
+ if yyhl3 {
+ if yyj3 >= l {
+ break
+ }
+ } else {
+ if r.CheckBreak() {
+ break
+ }
+ }
+ z.DecSendContainerState(codecSelfer_containerMapKey1234)
+ yys3Slc = r.DecodeBytes(yys3Slc, true, true)
+ yys3 := string(yys3Slc)
+ z.DecSendContainerState(codecSelfer_containerMapValue1234)
+ switch yys3 {
+ case "podSelector":
+ if r.TryDecodeAsNil() {
+ x.PodSelector = pkg1_v1.LabelSelector{}
+ } else {
+ yyv4 := &x.PodSelector
+ yym5 := z.DecBinary()
+ _ = yym5
+ if false {
+ } else if z.HasExtensions() && z.DecExt(yyv4) {
+ } else {
+ z.DecFallback(yyv4, false)
+ }
+ }
+ case "ingress":
+ if r.TryDecodeAsNil() {
+ x.Ingress = nil
+ } else {
+ yyv6 := &x.Ingress
+ yym7 := z.DecBinary()
+ _ = yym7
+ if false {
+ } else {
+ h.decSliceNetworkPolicyIngressRule((*[]NetworkPolicyIngressRule)(yyv6), d)
+ }
+ }
+ default:
+ z.DecStructFieldNotFound(-1, yys3)
+ } // end switch yys3
+ } // end for yyj3
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+}
+
+func (x *NetworkPolicySpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yyj8 int
+ var yyb8 bool
+ var yyhl8 bool = l >= 0
+ yyj8++
+ if yyhl8 {
+ yyb8 = yyj8 > l
+ } else {
+ yyb8 = r.CheckBreak()
+ }
+ if yyb8 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.PodSelector = pkg1_v1.LabelSelector{}
+ } else {
+ yyv9 := &x.PodSelector
+ yym10 := z.DecBinary()
+ _ = yym10
+ if false {
+ } else if z.HasExtensions() && z.DecExt(yyv9) {
+ } else {
+ z.DecFallback(yyv9, false)
+ }
+ }
+ yyj8++
+ if yyhl8 {
+ yyb8 = yyj8 > l
+ } else {
+ yyb8 = r.CheckBreak()
+ }
+ if yyb8 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.Ingress = nil
+ } else {
+ yyv11 := &x.Ingress
+ yym12 := z.DecBinary()
+ _ = yym12
+ if false {
+ } else {
+ h.decSliceNetworkPolicyIngressRule((*[]NetworkPolicyIngressRule)(yyv11), d)
+ }
+ }
+ for {
+ yyj8++
+ if yyhl8 {
+ yyb8 = yyj8 > l
+ } else {
+ yyb8 = r.CheckBreak()
+ }
+ if yyb8 {
+ break
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ z.DecStructFieldNotFound(yyj8-1, "")
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x *NetworkPolicyIngressRule) CodecEncodeSelf(e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ if x == nil {
+ r.EncodeNil()
+ } else {
+ yym1 := z.EncBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x) {
+ } else {
+ yysep2 := !z.EncBinary()
+ yy2arr2 := z.EncBasicHandle().StructToArray
+ var yyq2 [2]bool
+ _, _, _ = yysep2, yyq2, yy2arr2
+ const yyr2 bool = false
+ yyq2[0] = len(x.Ports) != 0
+ yyq2[1] = len(x.From) != 0
+ var yynn2 int
+ if yyr2 || yy2arr2 {
+ r.EncodeArrayStart(2)
+ } else {
+ yynn2 = 0
+ for _, b := range yyq2 {
+ if b {
+ yynn2++
+ }
+ }
+ r.EncodeMapStart(yynn2)
+ yynn2 = 0
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[0] {
+ if x.Ports == nil {
+ r.EncodeNil()
+ } else {
+ yym4 := z.EncBinary()
+ _ = yym4
+ if false {
+ } else {
+ h.encSliceNetworkPolicyPort(([]NetworkPolicyPort)(x.Ports), e)
+ }
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[0] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("ports"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.Ports == nil {
+ r.EncodeNil()
+ } else {
+ yym5 := z.EncBinary()
+ _ = yym5
+ if false {
+ } else {
+ h.encSliceNetworkPolicyPort(([]NetworkPolicyPort)(x.Ports), e)
+ }
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[1] {
+ if x.From == nil {
+ r.EncodeNil()
+ } else {
+ yym7 := z.EncBinary()
+ _ = yym7
+ if false {
+ } else {
+ h.encSliceNetworkPolicyPeer(([]NetworkPolicyPeer)(x.From), e)
+ }
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[1] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("from"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.From == nil {
+ r.EncodeNil()
+ } else {
+ yym8 := z.EncBinary()
+ _ = yym8
+ if false {
+ } else {
+ h.encSliceNetworkPolicyPeer(([]NetworkPolicyPeer)(x.From), e)
+ }
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ z.EncSendContainerState(codecSelfer_containerMapEnd1234)
+ }
+ }
+ }
+}
+
+func (x *NetworkPolicyIngressRule) CodecDecodeSelf(d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ yym1 := z.DecBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x) {
+ } else {
+ yyct2 := r.ContainerType()
+ if yyct2 == codecSelferValueTypeMap1234 {
+ yyl2 := r.ReadMapStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+ } else {
+ x.codecDecodeSelfFromMap(yyl2, d)
+ }
+ } else if yyct2 == codecSelferValueTypeArray1234 {
+ yyl2 := r.ReadArrayStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ x.codecDecodeSelfFromArray(yyl2, d)
+ }
+ } else {
+ panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
+ }
+ }
+}
+
+func (x *NetworkPolicyIngressRule) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yys3Slc = z.DecScratchBuffer() // default slice to decode into
+ _ = yys3Slc
+ var yyhl3 bool = l >= 0
+ for yyj3 := 0; ; yyj3++ {
+ if yyhl3 {
+ if yyj3 >= l {
+ break
+ }
+ } else {
+ if r.CheckBreak() {
+ break
+ }
+ }
+ z.DecSendContainerState(codecSelfer_containerMapKey1234)
+ yys3Slc = r.DecodeBytes(yys3Slc, true, true)
+ yys3 := string(yys3Slc)
+ z.DecSendContainerState(codecSelfer_containerMapValue1234)
+ switch yys3 {
+ case "ports":
+ if r.TryDecodeAsNil() {
+ x.Ports = nil
+ } else {
+ yyv4 := &x.Ports
+ yym5 := z.DecBinary()
+ _ = yym5
+ if false {
+ } else {
+ h.decSliceNetworkPolicyPort((*[]NetworkPolicyPort)(yyv4), d)
+ }
+ }
+ case "from":
+ if r.TryDecodeAsNil() {
+ x.From = nil
+ } else {
+ yyv6 := &x.From
+ yym7 := z.DecBinary()
+ _ = yym7
+ if false {
+ } else {
+ h.decSliceNetworkPolicyPeer((*[]NetworkPolicyPeer)(yyv6), d)
+ }
+ }
+ default:
+ z.DecStructFieldNotFound(-1, yys3)
+ } // end switch yys3
+ } // end for yyj3
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+}
+
+func (x *NetworkPolicyIngressRule) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yyj8 int
+ var yyb8 bool
+ var yyhl8 bool = l >= 0
+ yyj8++
+ if yyhl8 {
+ yyb8 = yyj8 > l
+ } else {
+ yyb8 = r.CheckBreak()
+ }
+ if yyb8 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.Ports = nil
+ } else {
+ yyv9 := &x.Ports
+ yym10 := z.DecBinary()
+ _ = yym10
+ if false {
+ } else {
+ h.decSliceNetworkPolicyPort((*[]NetworkPolicyPort)(yyv9), d)
+ }
+ }
+ yyj8++
+ if yyhl8 {
+ yyb8 = yyj8 > l
+ } else {
+ yyb8 = r.CheckBreak()
+ }
+ if yyb8 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.From = nil
+ } else {
+ yyv11 := &x.From
+ yym12 := z.DecBinary()
+ _ = yym12
+ if false {
+ } else {
+ h.decSliceNetworkPolicyPeer((*[]NetworkPolicyPeer)(yyv11), d)
+ }
+ }
+ for {
+ yyj8++
+ if yyhl8 {
+ yyb8 = yyj8 > l
+ } else {
+ yyb8 = r.CheckBreak()
+ }
+ if yyb8 {
+ break
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ z.DecStructFieldNotFound(yyj8-1, "")
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x *NetworkPolicyPort) CodecEncodeSelf(e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ if x == nil {
+ r.EncodeNil()
+ } else {
+ yym1 := z.EncBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x) {
+ } else {
+ yysep2 := !z.EncBinary()
+ yy2arr2 := z.EncBasicHandle().StructToArray
+ var yyq2 [2]bool
+ _, _, _ = yysep2, yyq2, yy2arr2
+ const yyr2 bool = false
+ yyq2[0] = x.Protocol != nil
+ yyq2[1] = x.Port != nil
+ var yynn2 int
+ if yyr2 || yy2arr2 {
+ r.EncodeArrayStart(2)
+ } else {
+ yynn2 = 0
+ for _, b := range yyq2 {
+ if b {
+ yynn2++
+ }
+ }
+ r.EncodeMapStart(yynn2)
+ yynn2 = 0
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[0] {
+ if x.Protocol == nil {
+ r.EncodeNil()
+ } else {
+ yy4 := *x.Protocol
+ yysf5 := &yy4
+ yysf5.CodecEncodeSelf(e)
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[0] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("protocol"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.Protocol == nil {
+ r.EncodeNil()
+ } else {
+ yy6 := *x.Protocol
+ yysf7 := &yy6
+ yysf7.CodecEncodeSelf(e)
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[1] {
+ if x.Port == nil {
+ r.EncodeNil()
+ } else {
+ yym9 := z.EncBinary()
+ _ = yym9
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x.Port) {
+ } else if !yym9 && z.IsJSONHandle() {
+ z.EncJSONMarshal(x.Port)
+ } else {
+ z.EncFallback(x.Port)
+ }
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[1] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("port"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.Port == nil {
+ r.EncodeNil()
+ } else {
+ yym10 := z.EncBinary()
+ _ = yym10
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x.Port) {
+ } else if !yym10 && z.IsJSONHandle() {
+ z.EncJSONMarshal(x.Port)
+ } else {
+ z.EncFallback(x.Port)
+ }
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ z.EncSendContainerState(codecSelfer_containerMapEnd1234)
+ }
+ }
+ }
+}
+
+func (x *NetworkPolicyPort) CodecDecodeSelf(d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ yym1 := z.DecBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x) {
+ } else {
+ yyct2 := r.ContainerType()
+ if yyct2 == codecSelferValueTypeMap1234 {
+ yyl2 := r.ReadMapStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+ } else {
+ x.codecDecodeSelfFromMap(yyl2, d)
+ }
+ } else if yyct2 == codecSelferValueTypeArray1234 {
+ yyl2 := r.ReadArrayStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ x.codecDecodeSelfFromArray(yyl2, d)
+ }
+ } else {
+ panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
+ }
+ }
+}
+
+func (x *NetworkPolicyPort) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yys3Slc = z.DecScratchBuffer() // default slice to decode into
+ _ = yys3Slc
+ var yyhl3 bool = l >= 0
+ for yyj3 := 0; ; yyj3++ {
+ if yyhl3 {
+ if yyj3 >= l {
+ break
+ }
+ } else {
+ if r.CheckBreak() {
+ break
+ }
+ }
+ z.DecSendContainerState(codecSelfer_containerMapKey1234)
+ yys3Slc = r.DecodeBytes(yys3Slc, true, true)
+ yys3 := string(yys3Slc)
+ z.DecSendContainerState(codecSelfer_containerMapValue1234)
+ switch yys3 {
+ case "protocol":
+ if r.TryDecodeAsNil() {
+ if x.Protocol != nil {
+ x.Protocol = nil
+ }
+ } else {
+ if x.Protocol == nil {
+ x.Protocol = new(pkg3_v1.Protocol)
+ }
+ x.Protocol.CodecDecodeSelf(d)
+ }
+ case "port":
+ if r.TryDecodeAsNil() {
+ if x.Port != nil {
+ x.Port = nil
+ }
+ } else {
+ if x.Port == nil {
+ x.Port = new(pkg4_intstr.IntOrString)
+ }
+ yym6 := z.DecBinary()
+ _ = yym6
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x.Port) {
+ } else if !yym6 && z.IsJSONHandle() {
+ z.DecJSONUnmarshal(x.Port)
+ } else {
+ z.DecFallback(x.Port, false)
+ }
+ }
+ default:
+ z.DecStructFieldNotFound(-1, yys3)
+ } // end switch yys3
+ } // end for yyj3
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+}
+
+func (x *NetworkPolicyPort) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yyj7 int
+ var yyb7 bool
+ var yyhl7 bool = l >= 0
+ yyj7++
+ if yyhl7 {
+ yyb7 = yyj7 > l
+ } else {
+ yyb7 = r.CheckBreak()
+ }
+ if yyb7 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ if x.Protocol != nil {
+ x.Protocol = nil
+ }
+ } else {
+ if x.Protocol == nil {
+ x.Protocol = new(pkg3_v1.Protocol)
+ }
+ x.Protocol.CodecDecodeSelf(d)
+ }
+ yyj7++
+ if yyhl7 {
+ yyb7 = yyj7 > l
+ } else {
+ yyb7 = r.CheckBreak()
+ }
+ if yyb7 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ if x.Port != nil {
+ x.Port = nil
+ }
+ } else {
+ if x.Port == nil {
+ x.Port = new(pkg4_intstr.IntOrString)
+ }
+ yym10 := z.DecBinary()
+ _ = yym10
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x.Port) {
+ } else if !yym10 && z.IsJSONHandle() {
+ z.DecJSONUnmarshal(x.Port)
+ } else {
+ z.DecFallback(x.Port, false)
+ }
+ }
+ for {
+ yyj7++
+ if yyhl7 {
+ yyb7 = yyj7 > l
+ } else {
+ yyb7 = r.CheckBreak()
+ }
+ if yyb7 {
+ break
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ z.DecStructFieldNotFound(yyj7-1, "")
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x *NetworkPolicyPeer) CodecEncodeSelf(e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ if x == nil {
+ r.EncodeNil()
+ } else {
+ yym1 := z.EncBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x) {
+ } else {
+ yysep2 := !z.EncBinary()
+ yy2arr2 := z.EncBasicHandle().StructToArray
+ var yyq2 [2]bool
+ _, _, _ = yysep2, yyq2, yy2arr2
+ const yyr2 bool = false
+ yyq2[0] = x.PodSelector != nil
+ yyq2[1] = x.NamespaceSelector != nil
+ var yynn2 int
+ if yyr2 || yy2arr2 {
+ r.EncodeArrayStart(2)
+ } else {
+ yynn2 = 0
+ for _, b := range yyq2 {
+ if b {
+ yynn2++
+ }
+ }
+ r.EncodeMapStart(yynn2)
+ yynn2 = 0
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[0] {
+ if x.PodSelector == nil {
+ r.EncodeNil()
+ } else {
+ yym4 := z.EncBinary()
+ _ = yym4
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x.PodSelector) {
+ } else {
+ z.EncFallback(x.PodSelector)
+ }
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[0] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("podSelector"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.PodSelector == nil {
+ r.EncodeNil()
+ } else {
+ yym5 := z.EncBinary()
+ _ = yym5
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x.PodSelector) {
+ } else {
+ z.EncFallback(x.PodSelector)
+ }
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[1] {
+ if x.NamespaceSelector == nil {
+ r.EncodeNil()
+ } else {
+ yym7 := z.EncBinary()
+ _ = yym7
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x.NamespaceSelector) {
+ } else {
+ z.EncFallback(x.NamespaceSelector)
+ }
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[1] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("namespaceSelector"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.NamespaceSelector == nil {
+ r.EncodeNil()
+ } else {
+ yym8 := z.EncBinary()
+ _ = yym8
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x.NamespaceSelector) {
+ } else {
+ z.EncFallback(x.NamespaceSelector)
+ }
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ z.EncSendContainerState(codecSelfer_containerMapEnd1234)
+ }
+ }
+ }
+}
+
+func (x *NetworkPolicyPeer) CodecDecodeSelf(d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ yym1 := z.DecBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x) {
+ } else {
+ yyct2 := r.ContainerType()
+ if yyct2 == codecSelferValueTypeMap1234 {
+ yyl2 := r.ReadMapStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+ } else {
+ x.codecDecodeSelfFromMap(yyl2, d)
+ }
+ } else if yyct2 == codecSelferValueTypeArray1234 {
+ yyl2 := r.ReadArrayStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ x.codecDecodeSelfFromArray(yyl2, d)
+ }
+ } else {
+ panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
+ }
+ }
+}
+
+func (x *NetworkPolicyPeer) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yys3Slc = z.DecScratchBuffer() // default slice to decode into
+ _ = yys3Slc
+ var yyhl3 bool = l >= 0
+ for yyj3 := 0; ; yyj3++ {
+ if yyhl3 {
+ if yyj3 >= l {
+ break
+ }
+ } else {
+ if r.CheckBreak() {
+ break
+ }
+ }
+ z.DecSendContainerState(codecSelfer_containerMapKey1234)
+ yys3Slc = r.DecodeBytes(yys3Slc, true, true)
+ yys3 := string(yys3Slc)
+ z.DecSendContainerState(codecSelfer_containerMapValue1234)
+ switch yys3 {
+ case "podSelector":
+ if r.TryDecodeAsNil() {
+ if x.PodSelector != nil {
+ x.PodSelector = nil
+ }
+ } else {
+ if x.PodSelector == nil {
+ x.PodSelector = new(pkg1_v1.LabelSelector)
+ }
+ yym5 := z.DecBinary()
+ _ = yym5
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x.PodSelector) {
+ } else {
+ z.DecFallback(x.PodSelector, false)
+ }
+ }
+ case "namespaceSelector":
+ if r.TryDecodeAsNil() {
+ if x.NamespaceSelector != nil {
+ x.NamespaceSelector = nil
+ }
+ } else {
+ if x.NamespaceSelector == nil {
+ x.NamespaceSelector = new(pkg1_v1.LabelSelector)
+ }
+ yym7 := z.DecBinary()
+ _ = yym7
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x.NamespaceSelector) {
+ } else {
+ z.DecFallback(x.NamespaceSelector, false)
+ }
+ }
+ default:
+ z.DecStructFieldNotFound(-1, yys3)
+ } // end switch yys3
+ } // end for yyj3
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+}
+
+func (x *NetworkPolicyPeer) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yyj8 int
+ var yyb8 bool
+ var yyhl8 bool = l >= 0
+ yyj8++
+ if yyhl8 {
+ yyb8 = yyj8 > l
+ } else {
+ yyb8 = r.CheckBreak()
+ }
+ if yyb8 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ if x.PodSelector != nil {
+ x.PodSelector = nil
+ }
+ } else {
+ if x.PodSelector == nil {
+ x.PodSelector = new(pkg1_v1.LabelSelector)
+ }
+ yym10 := z.DecBinary()
+ _ = yym10
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x.PodSelector) {
+ } else {
+ z.DecFallback(x.PodSelector, false)
+ }
+ }
+ yyj8++
+ if yyhl8 {
+ yyb8 = yyj8 > l
+ } else {
+ yyb8 = r.CheckBreak()
+ }
+ if yyb8 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ if x.NamespaceSelector != nil {
+ x.NamespaceSelector = nil
+ }
+ } else {
+ if x.NamespaceSelector == nil {
+ x.NamespaceSelector = new(pkg1_v1.LabelSelector)
+ }
+ yym12 := z.DecBinary()
+ _ = yym12
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x.NamespaceSelector) {
+ } else {
+ z.DecFallback(x.NamespaceSelector, false)
+ }
+ }
+ for {
+ yyj8++
+ if yyhl8 {
+ yyb8 = yyj8 > l
+ } else {
+ yyb8 = r.CheckBreak()
+ }
+ if yyb8 {
+ break
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ z.DecStructFieldNotFound(yyj8-1, "")
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x *NetworkPolicyList) CodecEncodeSelf(e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ if x == nil {
+ r.EncodeNil()
+ } else {
+ yym1 := z.EncBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.EncExt(x) {
+ } else {
+ yysep2 := !z.EncBinary()
+ yy2arr2 := z.EncBasicHandle().StructToArray
+ var yyq2 [4]bool
+ _, _, _ = yysep2, yyq2, yy2arr2
+ const yyr2 bool = false
+ yyq2[0] = x.Kind != ""
+ yyq2[1] = x.APIVersion != ""
+ yyq2[2] = true
+ var yynn2 int
+ if yyr2 || yy2arr2 {
+ r.EncodeArrayStart(4)
+ } else {
+ yynn2 = 1
+ for _, b := range yyq2 {
+ if b {
+ yynn2++
+ }
+ }
+ r.EncodeMapStart(yynn2)
+ yynn2 = 0
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[0] {
+ yym4 := z.EncBinary()
+ _ = yym4
+ if false {
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
+ }
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, "")
+ }
+ } else {
+ if yyq2[0] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("kind"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ yym5 := z.EncBinary()
+ _ = yym5
+ if false {
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[1] {
+ yym7 := z.EncBinary()
+ _ = yym7
+ if false {
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
+ }
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, "")
+ }
+ } else {
+ if yyq2[1] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("apiVersion"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ yym8 := z.EncBinary()
+ _ = yym8
+ if false {
+ } else {
+ r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if yyq2[2] {
+ yy10 := &x.ListMeta
+ yym11 := z.EncBinary()
+ _ = yym11
+ if false {
+ } else if z.HasExtensions() && z.EncExt(yy10) {
+ } else {
+ z.EncFallback(yy10)
+ }
+ } else {
+ r.EncodeNil()
+ }
+ } else {
+ if yyq2[2] {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("metadata"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ yy12 := &x.ListMeta
+ yym13 := z.EncBinary()
+ _ = yym13
+ if false {
+ } else if z.HasExtensions() && z.EncExt(yy12) {
+ } else {
+ z.EncFallback(yy12)
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ if x.Items == nil {
+ r.EncodeNil()
+ } else {
+ yym15 := z.EncBinary()
+ _ = yym15
+ if false {
+ } else {
+ h.encSliceNetworkPolicy(([]NetworkPolicy)(x.Items), e)
+ }
+ }
+ } else {
+ z.EncSendContainerState(codecSelfer_containerMapKey1234)
+ r.EncodeString(codecSelferC_UTF81234, string("items"))
+ z.EncSendContainerState(codecSelfer_containerMapValue1234)
+ if x.Items == nil {
+ r.EncodeNil()
+ } else {
+ yym16 := z.EncBinary()
+ _ = yym16
+ if false {
+ } else {
+ h.encSliceNetworkPolicy(([]NetworkPolicy)(x.Items), e)
+ }
+ }
+ }
+ if yyr2 || yy2arr2 {
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ z.EncSendContainerState(codecSelfer_containerMapEnd1234)
+ }
+ }
+ }
+}
+
+func (x *NetworkPolicyList) CodecDecodeSelf(d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ yym1 := z.DecBinary()
+ _ = yym1
+ if false {
+ } else if z.HasExtensions() && z.DecExt(x) {
+ } else {
+ yyct2 := r.ContainerType()
+ if yyct2 == codecSelferValueTypeMap1234 {
+ yyl2 := r.ReadMapStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+ } else {
+ x.codecDecodeSelfFromMap(yyl2, d)
+ }
+ } else if yyct2 == codecSelferValueTypeArray1234 {
+ yyl2 := r.ReadArrayStart()
+ if yyl2 == 0 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ } else {
+ x.codecDecodeSelfFromArray(yyl2, d)
+ }
+ } else {
+ panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
+ }
+ }
+}
+
+func (x *NetworkPolicyList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yys3Slc = z.DecScratchBuffer() // default slice to decode into
+ _ = yys3Slc
+ var yyhl3 bool = l >= 0
+ for yyj3 := 0; ; yyj3++ {
+ if yyhl3 {
+ if yyj3 >= l {
+ break
+ }
+ } else {
+ if r.CheckBreak() {
+ break
+ }
+ }
+ z.DecSendContainerState(codecSelfer_containerMapKey1234)
+ yys3Slc = r.DecodeBytes(yys3Slc, true, true)
+ yys3 := string(yys3Slc)
+ z.DecSendContainerState(codecSelfer_containerMapValue1234)
+ switch yys3 {
+ case "kind":
+ if r.TryDecodeAsNil() {
+ x.Kind = ""
+ } else {
+ yyv4 := &x.Kind
+ yym5 := z.DecBinary()
+ _ = yym5
+ if false {
+ } else {
+ *((*string)(yyv4)) = r.DecodeString()
+ }
+ }
+ case "apiVersion":
+ if r.TryDecodeAsNil() {
+ x.APIVersion = ""
+ } else {
+ yyv6 := &x.APIVersion
+ yym7 := z.DecBinary()
+ _ = yym7
+ if false {
+ } else {
+ *((*string)(yyv6)) = r.DecodeString()
+ }
+ }
+ case "metadata":
+ if r.TryDecodeAsNil() {
+ x.ListMeta = pkg1_v1.ListMeta{}
+ } else {
+ yyv8 := &x.ListMeta
+ yym9 := z.DecBinary()
+ _ = yym9
+ if false {
+ } else if z.HasExtensions() && z.DecExt(yyv8) {
+ } else {
+ z.DecFallback(yyv8, false)
+ }
+ }
+ case "items":
+ if r.TryDecodeAsNil() {
+ x.Items = nil
+ } else {
+ yyv10 := &x.Items
+ yym11 := z.DecBinary()
+ _ = yym11
+ if false {
+ } else {
+ h.decSliceNetworkPolicy((*[]NetworkPolicy)(yyv10), d)
+ }
+ }
+ default:
+ z.DecStructFieldNotFound(-1, yys3)
+ } // end switch yys3
+ } // end for yyj3
+ z.DecSendContainerState(codecSelfer_containerMapEnd1234)
+}
+
+func (x *NetworkPolicyList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+ var yyj12 int
+ var yyb12 bool
+ var yyhl12 bool = l >= 0
+ yyj12++
+ if yyhl12 {
+ yyb12 = yyj12 > l
+ } else {
+ yyb12 = r.CheckBreak()
+ }
+ if yyb12 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.Kind = ""
+ } else {
+ yyv13 := &x.Kind
+ yym14 := z.DecBinary()
+ _ = yym14
+ if false {
+ } else {
+ *((*string)(yyv13)) = r.DecodeString()
+ }
+ }
+ yyj12++
+ if yyhl12 {
+ yyb12 = yyj12 > l
+ } else {
+ yyb12 = r.CheckBreak()
+ }
+ if yyb12 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.APIVersion = ""
+ } else {
+ yyv15 := &x.APIVersion
+ yym16 := z.DecBinary()
+ _ = yym16
+ if false {
+ } else {
+ *((*string)(yyv15)) = r.DecodeString()
+ }
+ }
+ yyj12++
+ if yyhl12 {
+ yyb12 = yyj12 > l
+ } else {
+ yyb12 = r.CheckBreak()
+ }
+ if yyb12 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.ListMeta = pkg1_v1.ListMeta{}
+ } else {
+ yyv17 := &x.ListMeta
+ yym18 := z.DecBinary()
+ _ = yym18
+ if false {
+ } else if z.HasExtensions() && z.DecExt(yyv17) {
+ } else {
+ z.DecFallback(yyv17, false)
+ }
+ }
+ yyj12++
+ if yyhl12 {
+ yyb12 = yyj12 > l
+ } else {
+ yyb12 = r.CheckBreak()
+ }
+ if yyb12 {
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+ return
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ if r.TryDecodeAsNil() {
+ x.Items = nil
+ } else {
+ yyv19 := &x.Items
+ yym20 := z.DecBinary()
+ _ = yym20
+ if false {
+ } else {
+ h.decSliceNetworkPolicy((*[]NetworkPolicy)(yyv19), d)
+ }
+ }
+ for {
+ yyj12++
+ if yyhl12 {
+ yyb12 = yyj12 > l
+ } else {
+ yyb12 = r.CheckBreak()
+ }
+ if yyb12 {
+ break
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayElem1234)
+ z.DecStructFieldNotFound(yyj12-1, "")
+ }
+ z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x codecSelfer1234) encSliceNetworkPolicyIngressRule(v []NetworkPolicyIngressRule, e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ r.EncodeArrayStart(len(v))
+ for _, yyv1 := range v {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ yy2 := &yyv1
+ yy2.CodecEncodeSelf(e)
+ }
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x codecSelfer1234) decSliceNetworkPolicyIngressRule(v *[]NetworkPolicyIngressRule, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+
+ yyv1 := *v
+ yyh1, yyl1 := z.DecSliceHelperStart()
+ var yyc1 bool
+ _ = yyc1
+ if yyl1 == 0 {
+ if yyv1 == nil {
+ yyv1 = []NetworkPolicyIngressRule{}
+ yyc1 = true
+ } else if len(yyv1) != 0 {
+ yyv1 = yyv1[:0]
+ yyc1 = true
+ }
+ } else if yyl1 > 0 {
+ var yyrr1, yyrl1 int
+ var yyrt1 bool
+ _, _ = yyrl1, yyrt1
+ yyrr1 = yyl1 // len(yyv1)
+ if yyl1 > cap(yyv1) {
+
+ yyrg1 := len(yyv1) > 0
+ yyv21 := yyv1
+ yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 48)
+ if yyrt1 {
+ if yyrl1 <= cap(yyv1) {
+ yyv1 = yyv1[:yyrl1]
+ } else {
+ yyv1 = make([]NetworkPolicyIngressRule, yyrl1)
+ }
+ } else {
+ yyv1 = make([]NetworkPolicyIngressRule, yyrl1)
+ }
+ yyc1 = true
+ yyrr1 = len(yyv1)
+ if yyrg1 {
+ copy(yyv1, yyv21)
+ }
+ } else if yyl1 != len(yyv1) {
+ yyv1 = yyv1[:yyl1]
+ yyc1 = true
+ }
+ yyj1 := 0
+ for ; yyj1 < yyrr1; yyj1++ {
+ yyh1.ElemContainerState(yyj1)
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicyIngressRule{}
+ } else {
+ yyv2 := &yyv1[yyj1]
+ yyv2.CodecDecodeSelf(d)
+ }
+
+ }
+ if yyrt1 {
+ for ; yyj1 < yyl1; yyj1++ {
+ yyv1 = append(yyv1, NetworkPolicyIngressRule{})
+ yyh1.ElemContainerState(yyj1)
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicyIngressRule{}
+ } else {
+ yyv3 := &yyv1[yyj1]
+ yyv3.CodecDecodeSelf(d)
+ }
+
+ }
+ }
+
+ } else {
+ yyj1 := 0
+ for ; !r.CheckBreak(); yyj1++ {
+
+ if yyj1 >= len(yyv1) {
+ yyv1 = append(yyv1, NetworkPolicyIngressRule{}) // var yyz1 NetworkPolicyIngressRule
+ yyc1 = true
+ }
+ yyh1.ElemContainerState(yyj1)
+ if yyj1 < len(yyv1) {
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicyIngressRule{}
+ } else {
+ yyv4 := &yyv1[yyj1]
+ yyv4.CodecDecodeSelf(d)
+ }
+
+ } else {
+ z.DecSwallow()
+ }
+
+ }
+ if yyj1 < len(yyv1) {
+ yyv1 = yyv1[:yyj1]
+ yyc1 = true
+ } else if yyj1 == 0 && yyv1 == nil {
+ yyv1 = []NetworkPolicyIngressRule{}
+ yyc1 = true
+ }
+ }
+ yyh1.End()
+ if yyc1 {
+ *v = yyv1
+ }
+}
+
+func (x codecSelfer1234) encSliceNetworkPolicyPort(v []NetworkPolicyPort, e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ r.EncodeArrayStart(len(v))
+ for _, yyv1 := range v {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ yy2 := &yyv1
+ yy2.CodecEncodeSelf(e)
+ }
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x codecSelfer1234) decSliceNetworkPolicyPort(v *[]NetworkPolicyPort, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+
+ yyv1 := *v
+ yyh1, yyl1 := z.DecSliceHelperStart()
+ var yyc1 bool
+ _ = yyc1
+ if yyl1 == 0 {
+ if yyv1 == nil {
+ yyv1 = []NetworkPolicyPort{}
+ yyc1 = true
+ } else if len(yyv1) != 0 {
+ yyv1 = yyv1[:0]
+ yyc1 = true
+ }
+ } else if yyl1 > 0 {
+ var yyrr1, yyrl1 int
+ var yyrt1 bool
+ _, _ = yyrl1, yyrt1
+ yyrr1 = yyl1 // len(yyv1)
+ if yyl1 > cap(yyv1) {
+
+ yyrg1 := len(yyv1) > 0
+ yyv21 := yyv1
+ yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 16)
+ if yyrt1 {
+ if yyrl1 <= cap(yyv1) {
+ yyv1 = yyv1[:yyrl1]
+ } else {
+ yyv1 = make([]NetworkPolicyPort, yyrl1)
+ }
+ } else {
+ yyv1 = make([]NetworkPolicyPort, yyrl1)
+ }
+ yyc1 = true
+ yyrr1 = len(yyv1)
+ if yyrg1 {
+ copy(yyv1, yyv21)
+ }
+ } else if yyl1 != len(yyv1) {
+ yyv1 = yyv1[:yyl1]
+ yyc1 = true
+ }
+ yyj1 := 0
+ for ; yyj1 < yyrr1; yyj1++ {
+ yyh1.ElemContainerState(yyj1)
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicyPort{}
+ } else {
+ yyv2 := &yyv1[yyj1]
+ yyv2.CodecDecodeSelf(d)
+ }
+
+ }
+ if yyrt1 {
+ for ; yyj1 < yyl1; yyj1++ {
+ yyv1 = append(yyv1, NetworkPolicyPort{})
+ yyh1.ElemContainerState(yyj1)
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicyPort{}
+ } else {
+ yyv3 := &yyv1[yyj1]
+ yyv3.CodecDecodeSelf(d)
+ }
+
+ }
+ }
+
+ } else {
+ yyj1 := 0
+ for ; !r.CheckBreak(); yyj1++ {
+
+ if yyj1 >= len(yyv1) {
+ yyv1 = append(yyv1, NetworkPolicyPort{}) // var yyz1 NetworkPolicyPort
+ yyc1 = true
+ }
+ yyh1.ElemContainerState(yyj1)
+ if yyj1 < len(yyv1) {
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicyPort{}
+ } else {
+ yyv4 := &yyv1[yyj1]
+ yyv4.CodecDecodeSelf(d)
+ }
+
+ } else {
+ z.DecSwallow()
+ }
+
+ }
+ if yyj1 < len(yyv1) {
+ yyv1 = yyv1[:yyj1]
+ yyc1 = true
+ } else if yyj1 == 0 && yyv1 == nil {
+ yyv1 = []NetworkPolicyPort{}
+ yyc1 = true
+ }
+ }
+ yyh1.End()
+ if yyc1 {
+ *v = yyv1
+ }
+}
+
+func (x codecSelfer1234) encSliceNetworkPolicyPeer(v []NetworkPolicyPeer, e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ r.EncodeArrayStart(len(v))
+ for _, yyv1 := range v {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ yy2 := &yyv1
+ yy2.CodecEncodeSelf(e)
+ }
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x codecSelfer1234) decSliceNetworkPolicyPeer(v *[]NetworkPolicyPeer, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+
+ yyv1 := *v
+ yyh1, yyl1 := z.DecSliceHelperStart()
+ var yyc1 bool
+ _ = yyc1
+ if yyl1 == 0 {
+ if yyv1 == nil {
+ yyv1 = []NetworkPolicyPeer{}
+ yyc1 = true
+ } else if len(yyv1) != 0 {
+ yyv1 = yyv1[:0]
+ yyc1 = true
+ }
+ } else if yyl1 > 0 {
+ var yyrr1, yyrl1 int
+ var yyrt1 bool
+ _, _ = yyrl1, yyrt1
+ yyrr1 = yyl1 // len(yyv1)
+ if yyl1 > cap(yyv1) {
+
+ yyrg1 := len(yyv1) > 0
+ yyv21 := yyv1
+ yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 16)
+ if yyrt1 {
+ if yyrl1 <= cap(yyv1) {
+ yyv1 = yyv1[:yyrl1]
+ } else {
+ yyv1 = make([]NetworkPolicyPeer, yyrl1)
+ }
+ } else {
+ yyv1 = make([]NetworkPolicyPeer, yyrl1)
+ }
+ yyc1 = true
+ yyrr1 = len(yyv1)
+ if yyrg1 {
+ copy(yyv1, yyv21)
+ }
+ } else if yyl1 != len(yyv1) {
+ yyv1 = yyv1[:yyl1]
+ yyc1 = true
+ }
+ yyj1 := 0
+ for ; yyj1 < yyrr1; yyj1++ {
+ yyh1.ElemContainerState(yyj1)
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicyPeer{}
+ } else {
+ yyv2 := &yyv1[yyj1]
+ yyv2.CodecDecodeSelf(d)
+ }
+
+ }
+ if yyrt1 {
+ for ; yyj1 < yyl1; yyj1++ {
+ yyv1 = append(yyv1, NetworkPolicyPeer{})
+ yyh1.ElemContainerState(yyj1)
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicyPeer{}
+ } else {
+ yyv3 := &yyv1[yyj1]
+ yyv3.CodecDecodeSelf(d)
+ }
+
+ }
+ }
+
+ } else {
+ yyj1 := 0
+ for ; !r.CheckBreak(); yyj1++ {
+
+ if yyj1 >= len(yyv1) {
+ yyv1 = append(yyv1, NetworkPolicyPeer{}) // var yyz1 NetworkPolicyPeer
+ yyc1 = true
+ }
+ yyh1.ElemContainerState(yyj1)
+ if yyj1 < len(yyv1) {
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicyPeer{}
+ } else {
+ yyv4 := &yyv1[yyj1]
+ yyv4.CodecDecodeSelf(d)
+ }
+
+ } else {
+ z.DecSwallow()
+ }
+
+ }
+ if yyj1 < len(yyv1) {
+ yyv1 = yyv1[:yyj1]
+ yyc1 = true
+ } else if yyj1 == 0 && yyv1 == nil {
+ yyv1 = []NetworkPolicyPeer{}
+ yyc1 = true
+ }
+ }
+ yyh1.End()
+ if yyc1 {
+ *v = yyv1
+ }
+}
+
+func (x codecSelfer1234) encSliceNetworkPolicy(v []NetworkPolicy, e *codec1978.Encoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperEncoder(e)
+ _, _, _ = h, z, r
+ r.EncodeArrayStart(len(v))
+ for _, yyv1 := range v {
+ z.EncSendContainerState(codecSelfer_containerArrayElem1234)
+ yy2 := &yyv1
+ yy2.CodecEncodeSelf(e)
+ }
+ z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
+}
+
+func (x codecSelfer1234) decSliceNetworkPolicy(v *[]NetworkPolicy, d *codec1978.Decoder) {
+ var h codecSelfer1234
+ z, r := codec1978.GenHelperDecoder(d)
+ _, _, _ = h, z, r
+
+ yyv1 := *v
+ yyh1, yyl1 := z.DecSliceHelperStart()
+ var yyc1 bool
+ _ = yyc1
+ if yyl1 == 0 {
+ if yyv1 == nil {
+ yyv1 = []NetworkPolicy{}
+ yyc1 = true
+ } else if len(yyv1) != 0 {
+ yyv1 = yyv1[:0]
+ yyc1 = true
+ }
+ } else if yyl1 > 0 {
+ var yyrr1, yyrl1 int
+ var yyrt1 bool
+ _, _ = yyrl1, yyrt1
+ yyrr1 = yyl1 // len(yyv1)
+ if yyl1 > cap(yyv1) {
+
+ yyrg1 := len(yyv1) > 0
+ yyv21 := yyv1
+ yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 320)
+ if yyrt1 {
+ if yyrl1 <= cap(yyv1) {
+ yyv1 = yyv1[:yyrl1]
+ } else {
+ yyv1 = make([]NetworkPolicy, yyrl1)
+ }
+ } else {
+ yyv1 = make([]NetworkPolicy, yyrl1)
+ }
+ yyc1 = true
+ yyrr1 = len(yyv1)
+ if yyrg1 {
+ copy(yyv1, yyv21)
+ }
+ } else if yyl1 != len(yyv1) {
+ yyv1 = yyv1[:yyl1]
+ yyc1 = true
+ }
+ yyj1 := 0
+ for ; yyj1 < yyrr1; yyj1++ {
+ yyh1.ElemContainerState(yyj1)
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicy{}
+ } else {
+ yyv2 := &yyv1[yyj1]
+ yyv2.CodecDecodeSelf(d)
+ }
+
+ }
+ if yyrt1 {
+ for ; yyj1 < yyl1; yyj1++ {
+ yyv1 = append(yyv1, NetworkPolicy{})
+ yyh1.ElemContainerState(yyj1)
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicy{}
+ } else {
+ yyv3 := &yyv1[yyj1]
+ yyv3.CodecDecodeSelf(d)
+ }
+
+ }
+ }
+
+ } else {
+ yyj1 := 0
+ for ; !r.CheckBreak(); yyj1++ {
+
+ if yyj1 >= len(yyv1) {
+ yyv1 = append(yyv1, NetworkPolicy{}) // var yyz1 NetworkPolicy
+ yyc1 = true
+ }
+ yyh1.ElemContainerState(yyj1)
+ if yyj1 < len(yyv1) {
+ if r.TryDecodeAsNil() {
+ yyv1[yyj1] = NetworkPolicy{}
+ } else {
+ yyv4 := &yyv1[yyj1]
+ yyv4.CodecDecodeSelf(d)
+ }
+
+ } else {
+ z.DecSwallow()
+ }
+
+ }
+ if yyj1 < len(yyv1) {
+ yyv1 = yyv1[:yyj1]
+ yyc1 = true
+ } else if yyj1 == 0 && yyv1 == nil {
+ yyv1 = []NetworkPolicy{}
+ yyc1 = true
+ }
+ }
+ yyh1.End()
+ if yyc1 {
+ *v = yyv1
+ }
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/types.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/types.go
new file mode 100644
index 000000000..a31026a67
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/types.go
@@ -0,0 +1,120 @@
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/util/intstr"
+ "k8s.io/client-go/pkg/api/v1"
+)
+
+// +genclient=true
+
+// NetworkPolicy describes what network traffic is allowed for a set of Pods
+type NetworkPolicy struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Specification of the desired behavior for this NetworkPolicy.
+ // +optional
+ Spec NetworkPolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
+}
+
+// NetworkPolicySpec provides the specification of a NetworkPolicy
+type NetworkPolicySpec struct {
+ // Selects the pods to which this NetworkPolicy object applies. The array of
+ // ingress rules is applied to any pods selected by this field. Multiple network
+ // policies can select the same set of pods. In this case, the ingress rules for
+ // each are combined additively. This field is NOT optional and follows standard
+ // label selector semantics. An empty podSelector matches all pods in this
+ // namespace.
+ PodSelector metav1.LabelSelector `json:"podSelector" protobuf:"bytes,1,opt,name=podSelector"`
+
+ // List of ingress rules to be applied to the selected pods. Traffic is allowed to
+ // a pod if there are no NetworkPolicies selecting the pod
+ // (and cluster policy otherwise allows the traffic), OR if the traffic source is
+ // the pod's local node, OR if the traffic matches at least one ingress rule
+ // across all of the NetworkPolicy objects whose podSelector matches the pod. If
+ // this field is empty then this NetworkPolicy does not allow any traffic (and serves
+ // solely to ensure that the pods it selects are isolated by default)
+ // +optional
+ Ingress []NetworkPolicyIngressRule `json:"ingress,omitempty" protobuf:"bytes,2,rep,name=ingress"`
+}
+
+// NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods
+// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.
+type NetworkPolicyIngressRule struct {
+ // List of ports which should be made accessible on the pods selected for this
+ // rule. Each item in this list is combined using a logical OR. If this field is
+ // empty or missing, this rule matches all ports (traffic not restricted by port).
+ // If this field is present and contains at least one item, then this rule allows
+ // traffic only if the traffic matches at least one port in the list.
+ // +optional
+ Ports []NetworkPolicyPort `json:"ports,omitempty" protobuf:"bytes,1,rep,name=ports"`
+
+ // List of sources which should be able to access the pods selected for this rule.
+ // Items in this list are combined using a logical OR operation. If this field is
+ // empty or missing, this rule matches all sources (traffic not restricted by
+ // source). If this field is present and contains at least on item, this rule
+ // allows traffic only if the traffic matches at least one item in the from list.
+ // +optional
+ From []NetworkPolicyPeer `json:"from,omitempty" protobuf:"bytes,2,rep,name=from"`
+}
+
+// NetworkPolicyPort describes a port to allow traffic on
+type NetworkPolicyPort struct {
+ // The protocol (TCP or UDP) which traffic must match. If not specified, this
+ // field defaults to TCP.
+ // +optional
+ Protocol *v1.Protocol `json:"protocol,omitempty" protobuf:"bytes,1,opt,name=protocol,casttype=k8s.io/kubernetes/pkg/api/v1.Protocol"`
+
+ // The port on the given protocol. This can either be a numerical or named port on
+ // a pod. If this field is not provided, this matches all port names and numbers.
+ // +optional
+ Port *intstr.IntOrString `json:"port,omitempty" protobuf:"bytes,2,opt,name=port"`
+}
+
+// NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its fields
+// must be specified.
+type NetworkPolicyPeer struct {
+ // This is a label selector which selects Pods in this namespace. This field
+ // follows standard label selector semantics. If present but empty, this selector
+ // selects all pods in this namespace.
+ // +optional
+ PodSelector *metav1.LabelSelector `json:"podSelector,omitempty" protobuf:"bytes,1,opt,name=podSelector"`
+
+ // Selects Namespaces using cluster scoped-labels. This matches all pods in all
+ // namespaces selected by this label selector. This field follows standard label
+ // selector semantics. If present but empty, this selector selects all namespaces.
+ // +optional
+ NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,2,opt,name=namespaceSelector"`
+}
+
+// NetworkPolicyList is a list of NetworkPolicy objects.
+type NetworkPolicyList struct {
+ metav1.TypeMeta `json:",inline"`
+ // Standard list metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
+
+ // Items is a list of schema objects.
+ Items []NetworkPolicy `json:"items" protobuf:"bytes,2,rep,name=items"`
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/types_swagger_doc_generated.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/types_swagger_doc_generated.go
new file mode 100644
index 000000000..c3c911631
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/types_swagger_doc_generated.go
@@ -0,0 +1,90 @@
+/*
+Copyright 2016 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// This file contains a collection of methods that can be used from go-restful to
+// generate Swagger API documentation for its models. Please read this PR for more
+// information on the implementation: https://github.com/emicklei/go-restful/pull/215
+//
+// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
+// they are on one line! For multiple line or blocks that you want to ignore use ---.
+// Any context after a --- is ignored.
+//
+// Those methods can be generated by using hack/update-generated-swagger-docs.sh
+
+// AUTO-GENERATED FUNCTIONS START HERE
+var map_NetworkPolicy = map[string]string{
+ "": "NetworkPolicy describes what network traffic is allowed for a set of Pods",
+ "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
+ "spec": "Specification of the desired behavior for this NetworkPolicy.",
+}
+
+func (NetworkPolicy) SwaggerDoc() map[string]string {
+ return map_NetworkPolicy
+}
+
+var map_NetworkPolicyIngressRule = map[string]string{
+ "": "NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.",
+ "ports": "List of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.",
+ "from": "List of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least on item, this rule allows traffic only if the traffic matches at least one item in the from list.",
+}
+
+func (NetworkPolicyIngressRule) SwaggerDoc() map[string]string {
+ return map_NetworkPolicyIngressRule
+}
+
+var map_NetworkPolicyList = map[string]string{
+ "": "NetworkPolicyList is a list of NetworkPolicy objects.",
+ "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
+ "items": "Items is a list of schema objects.",
+}
+
+func (NetworkPolicyList) SwaggerDoc() map[string]string {
+ return map_NetworkPolicyList
+}
+
+var map_NetworkPolicyPeer = map[string]string{
+ "": "NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its fields must be specified.",
+ "podSelector": "This is a label selector which selects Pods in this namespace. This field follows standard label selector semantics. If present but empty, this selector selects all pods in this namespace.",
+ "namespaceSelector": "Selects Namespaces using cluster scoped-labels. This matches all pods in all namespaces selected by this label selector. This field follows standard label selector semantics. If present but empty, this selector selects all namespaces.",
+}
+
+func (NetworkPolicyPeer) SwaggerDoc() map[string]string {
+ return map_NetworkPolicyPeer
+}
+
+var map_NetworkPolicyPort = map[string]string{
+ "": "NetworkPolicyPort describes a port to allow traffic on",
+ "protocol": "The protocol (TCP or UDP) which traffic must match. If not specified, this field defaults to TCP.",
+ "port": "The port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers.",
+}
+
+func (NetworkPolicyPort) SwaggerDoc() map[string]string {
+ return map_NetworkPolicyPort
+}
+
+var map_NetworkPolicySpec = map[string]string{
+ "": "NetworkPolicySpec provides the specification of a NetworkPolicy",
+ "podSelector": "Selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace.",
+ "ingress": "List of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default)",
+}
+
+func (NetworkPolicySpec) SwaggerDoc() map[string]string {
+ return map_NetworkPolicySpec
+}
+
+// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.conversion.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.conversion.go
new file mode 100644
index 000000000..500438e92
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.conversion.go
@@ -0,0 +1,195 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by conversion-gen. Do not edit it manually!
+
+package v1
+
+import (
+ meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ intstr "k8s.io/apimachinery/pkg/util/intstr"
+ api "k8s.io/client-go/pkg/api"
+ api_v1 "k8s.io/client-go/pkg/api/v1"
+ networking "k8s.io/client-go/pkg/apis/networking"
+ unsafe "unsafe"
+)
+
+func init() {
+ SchemeBuilder.Register(RegisterConversions)
+}
+
+// RegisterConversions adds conversion functions to the given scheme.
+// Public to allow building arbitrary schemes.
+func RegisterConversions(scheme *runtime.Scheme) error {
+ return scheme.AddGeneratedConversionFuncs(
+ Convert_v1_NetworkPolicy_To_networking_NetworkPolicy,
+ Convert_networking_NetworkPolicy_To_v1_NetworkPolicy,
+ Convert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule,
+ Convert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule,
+ Convert_v1_NetworkPolicyList_To_networking_NetworkPolicyList,
+ Convert_networking_NetworkPolicyList_To_v1_NetworkPolicyList,
+ Convert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer,
+ Convert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer,
+ Convert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort,
+ Convert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort,
+ Convert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec,
+ Convert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec,
+ )
+}
+
+func autoConvert_v1_NetworkPolicy_To_networking_NetworkPolicy(in *NetworkPolicy, out *networking.NetworkPolicy, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ if err := Convert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec(&in.Spec, &out.Spec, s); err != nil {
+ return err
+ }
+ return nil
+}
+
+// Convert_v1_NetworkPolicy_To_networking_NetworkPolicy is an autogenerated conversion function.
+func Convert_v1_NetworkPolicy_To_networking_NetworkPolicy(in *NetworkPolicy, out *networking.NetworkPolicy, s conversion.Scope) error {
+ return autoConvert_v1_NetworkPolicy_To_networking_NetworkPolicy(in, out, s)
+}
+
+func autoConvert_networking_NetworkPolicy_To_v1_NetworkPolicy(in *networking.NetworkPolicy, out *NetworkPolicy, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ if err := Convert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec(&in.Spec, &out.Spec, s); err != nil {
+ return err
+ }
+ return nil
+}
+
+// Convert_networking_NetworkPolicy_To_v1_NetworkPolicy is an autogenerated conversion function.
+func Convert_networking_NetworkPolicy_To_v1_NetworkPolicy(in *networking.NetworkPolicy, out *NetworkPolicy, s conversion.Scope) error {
+ return autoConvert_networking_NetworkPolicy_To_v1_NetworkPolicy(in, out, s)
+}
+
+func autoConvert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule(in *NetworkPolicyIngressRule, out *networking.NetworkPolicyIngressRule, s conversion.Scope) error {
+ out.Ports = *(*[]networking.NetworkPolicyPort)(unsafe.Pointer(&in.Ports))
+ out.From = *(*[]networking.NetworkPolicyPeer)(unsafe.Pointer(&in.From))
+ return nil
+}
+
+// Convert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule is an autogenerated conversion function.
+func Convert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule(in *NetworkPolicyIngressRule, out *networking.NetworkPolicyIngressRule, s conversion.Scope) error {
+ return autoConvert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule(in, out, s)
+}
+
+func autoConvert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(in *networking.NetworkPolicyIngressRule, out *NetworkPolicyIngressRule, s conversion.Scope) error {
+ out.Ports = *(*[]NetworkPolicyPort)(unsafe.Pointer(&in.Ports))
+ out.From = *(*[]NetworkPolicyPeer)(unsafe.Pointer(&in.From))
+ return nil
+}
+
+// Convert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule is an autogenerated conversion function.
+func Convert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(in *networking.NetworkPolicyIngressRule, out *NetworkPolicyIngressRule, s conversion.Scope) error {
+ return autoConvert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(in, out, s)
+}
+
+func autoConvert_v1_NetworkPolicyList_To_networking_NetworkPolicyList(in *NetworkPolicyList, out *networking.NetworkPolicyList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]networking.NetworkPolicy)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convert_v1_NetworkPolicyList_To_networking_NetworkPolicyList is an autogenerated conversion function.
+func Convert_v1_NetworkPolicyList_To_networking_NetworkPolicyList(in *NetworkPolicyList, out *networking.NetworkPolicyList, s conversion.Scope) error {
+ return autoConvert_v1_NetworkPolicyList_To_networking_NetworkPolicyList(in, out, s)
+}
+
+func autoConvert_networking_NetworkPolicyList_To_v1_NetworkPolicyList(in *networking.NetworkPolicyList, out *NetworkPolicyList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ if in.Items == nil {
+ out.Items = make([]NetworkPolicy, 0)
+ } else {
+ out.Items = *(*[]NetworkPolicy)(unsafe.Pointer(&in.Items))
+ }
+ return nil
+}
+
+// Convert_networking_NetworkPolicyList_To_v1_NetworkPolicyList is an autogenerated conversion function.
+func Convert_networking_NetworkPolicyList_To_v1_NetworkPolicyList(in *networking.NetworkPolicyList, out *NetworkPolicyList, s conversion.Scope) error {
+ return autoConvert_networking_NetworkPolicyList_To_v1_NetworkPolicyList(in, out, s)
+}
+
+func autoConvert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer(in *NetworkPolicyPeer, out *networking.NetworkPolicyPeer, s conversion.Scope) error {
+ out.PodSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.PodSelector))
+ out.NamespaceSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
+ return nil
+}
+
+// Convert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer is an autogenerated conversion function.
+func Convert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer(in *NetworkPolicyPeer, out *networking.NetworkPolicyPeer, s conversion.Scope) error {
+ return autoConvert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer(in, out, s)
+}
+
+func autoConvert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer(in *networking.NetworkPolicyPeer, out *NetworkPolicyPeer, s conversion.Scope) error {
+ out.PodSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.PodSelector))
+ out.NamespaceSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
+ return nil
+}
+
+// Convert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer is an autogenerated conversion function.
+func Convert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer(in *networking.NetworkPolicyPeer, out *NetworkPolicyPeer, s conversion.Scope) error {
+ return autoConvert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer(in, out, s)
+}
+
+func autoConvert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort(in *NetworkPolicyPort, out *networking.NetworkPolicyPort, s conversion.Scope) error {
+ out.Protocol = (*api.Protocol)(unsafe.Pointer(in.Protocol))
+ out.Port = (*intstr.IntOrString)(unsafe.Pointer(in.Port))
+ return nil
+}
+
+// Convert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort is an autogenerated conversion function.
+func Convert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort(in *NetworkPolicyPort, out *networking.NetworkPolicyPort, s conversion.Scope) error {
+ return autoConvert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort(in, out, s)
+}
+
+func autoConvert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort(in *networking.NetworkPolicyPort, out *NetworkPolicyPort, s conversion.Scope) error {
+ out.Protocol = (*api_v1.Protocol)(unsafe.Pointer(in.Protocol))
+ out.Port = (*intstr.IntOrString)(unsafe.Pointer(in.Port))
+ return nil
+}
+
+// Convert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort is an autogenerated conversion function.
+func Convert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort(in *networking.NetworkPolicyPort, out *NetworkPolicyPort, s conversion.Scope) error {
+ return autoConvert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort(in, out, s)
+}
+
+func autoConvert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec(in *NetworkPolicySpec, out *networking.NetworkPolicySpec, s conversion.Scope) error {
+ out.PodSelector = in.PodSelector
+ out.Ingress = *(*[]networking.NetworkPolicyIngressRule)(unsafe.Pointer(&in.Ingress))
+ return nil
+}
+
+// Convert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec is an autogenerated conversion function.
+func Convert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec(in *NetworkPolicySpec, out *networking.NetworkPolicySpec, s conversion.Scope) error {
+ return autoConvert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec(in, out, s)
+}
+
+func autoConvert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec(in *networking.NetworkPolicySpec, out *NetworkPolicySpec, s conversion.Scope) error {
+ out.PodSelector = in.PodSelector
+ out.Ingress = *(*[]NetworkPolicyIngressRule)(unsafe.Pointer(&in.Ingress))
+ return nil
+}
+
+// Convert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec is an autogenerated conversion function.
+func Convert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec(in *networking.NetworkPolicySpec, out *NetworkPolicySpec, s conversion.Scope) error {
+ return autoConvert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec(in, out, s)
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.deepcopy.go
new file mode 100644
index 000000000..6d9b335d4
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.deepcopy.go
@@ -0,0 +1,182 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by deepcopy-gen. Do not edit it manually!
+
+package v1
+
+import (
+ meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ intstr "k8s.io/apimachinery/pkg/util/intstr"
+ api_v1 "k8s.io/client-go/pkg/api/v1"
+ reflect "reflect"
+)
+
+func init() {
+ SchemeBuilder.Register(RegisterDeepCopies)
+}
+
+// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
+// to allow building arbitrary schemes.
+func RegisterDeepCopies(scheme *runtime.Scheme) error {
+ return scheme.AddGeneratedDeepCopyFuncs(
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NetworkPolicy, InType: reflect.TypeOf(&NetworkPolicy{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NetworkPolicyIngressRule, InType: reflect.TypeOf(&NetworkPolicyIngressRule{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NetworkPolicyList, InType: reflect.TypeOf(&NetworkPolicyList{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NetworkPolicyPeer, InType: reflect.TypeOf(&NetworkPolicyPeer{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NetworkPolicyPort, InType: reflect.TypeOf(&NetworkPolicyPort{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NetworkPolicySpec, InType: reflect.TypeOf(&NetworkPolicySpec{})},
+ )
+}
+
+// DeepCopy_v1_NetworkPolicy is an autogenerated deepcopy function.
+func DeepCopy_v1_NetworkPolicy(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicy)
+ out := out.(*NetworkPolicy)
+ *out = *in
+ if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
+ return err
+ } else {
+ out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
+ }
+ if err := DeepCopy_v1_NetworkPolicySpec(&in.Spec, &out.Spec, c); err != nil {
+ return err
+ }
+ return nil
+ }
+}
+
+// DeepCopy_v1_NetworkPolicyIngressRule is an autogenerated deepcopy function.
+func DeepCopy_v1_NetworkPolicyIngressRule(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicyIngressRule)
+ out := out.(*NetworkPolicyIngressRule)
+ *out = *in
+ if in.Ports != nil {
+ in, out := &in.Ports, &out.Ports
+ *out = make([]NetworkPolicyPort, len(*in))
+ for i := range *in {
+ if err := DeepCopy_v1_NetworkPolicyPort(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ if in.From != nil {
+ in, out := &in.From, &out.From
+ *out = make([]NetworkPolicyPeer, len(*in))
+ for i := range *in {
+ if err := DeepCopy_v1_NetworkPolicyPeer(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+}
+
+// DeepCopy_v1_NetworkPolicyList is an autogenerated deepcopy function.
+func DeepCopy_v1_NetworkPolicyList(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicyList)
+ out := out.(*NetworkPolicyList)
+ *out = *in
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]NetworkPolicy, len(*in))
+ for i := range *in {
+ if err := DeepCopy_v1_NetworkPolicy(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+}
+
+// DeepCopy_v1_NetworkPolicyPeer is an autogenerated deepcopy function.
+func DeepCopy_v1_NetworkPolicyPeer(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicyPeer)
+ out := out.(*NetworkPolicyPeer)
+ *out = *in
+ if in.PodSelector != nil {
+ in, out := &in.PodSelector, &out.PodSelector
+ if newVal, err := c.DeepCopy(*in); err != nil {
+ return err
+ } else {
+ *out = newVal.(*meta_v1.LabelSelector)
+ }
+ }
+ if in.NamespaceSelector != nil {
+ in, out := &in.NamespaceSelector, &out.NamespaceSelector
+ if newVal, err := c.DeepCopy(*in); err != nil {
+ return err
+ } else {
+ *out = newVal.(*meta_v1.LabelSelector)
+ }
+ }
+ return nil
+ }
+}
+
+// DeepCopy_v1_NetworkPolicyPort is an autogenerated deepcopy function.
+func DeepCopy_v1_NetworkPolicyPort(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicyPort)
+ out := out.(*NetworkPolicyPort)
+ *out = *in
+ if in.Protocol != nil {
+ in, out := &in.Protocol, &out.Protocol
+ *out = new(api_v1.Protocol)
+ **out = **in
+ }
+ if in.Port != nil {
+ in, out := &in.Port, &out.Port
+ *out = new(intstr.IntOrString)
+ **out = **in
+ }
+ return nil
+ }
+}
+
+// DeepCopy_v1_NetworkPolicySpec is an autogenerated deepcopy function.
+func DeepCopy_v1_NetworkPolicySpec(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicySpec)
+ out := out.(*NetworkPolicySpec)
+ *out = *in
+ if newVal, err := c.DeepCopy(&in.PodSelector); err != nil {
+ return err
+ } else {
+ out.PodSelector = *newVal.(*meta_v1.LabelSelector)
+ }
+ if in.Ingress != nil {
+ in, out := &in.Ingress, &out.Ingress
+ *out = make([]NetworkPolicyIngressRule, len(*in))
+ for i := range *in {
+ if err := DeepCopy_v1_NetworkPolicyIngressRule(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.defaults.go b/vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.defaults.go
new file mode 100644
index 000000000..0319c88a7
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.defaults.go
@@ -0,0 +1,51 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by defaulter-gen. Do not edit it manually!
+
+package v1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// RegisterDefaults adds defaulters functions to the given scheme.
+// Public to allow building arbitrary schemes.
+// All generated defaulters are covering - they call all nested defaulters.
+func RegisterDefaults(scheme *runtime.Scheme) error {
+ scheme.AddTypeDefaultingFunc(&NetworkPolicy{}, func(obj interface{}) { SetObjectDefaults_NetworkPolicy(obj.(*NetworkPolicy)) })
+ scheme.AddTypeDefaultingFunc(&NetworkPolicyList{}, func(obj interface{}) { SetObjectDefaults_NetworkPolicyList(obj.(*NetworkPolicyList)) })
+ return nil
+}
+
+func SetObjectDefaults_NetworkPolicy(in *NetworkPolicy) {
+ for i := range in.Spec.Ingress {
+ a := &in.Spec.Ingress[i]
+ for j := range a.Ports {
+ b := &a.Ports[j]
+ SetDefaults_NetworkPolicyPort(b)
+ }
+ }
+}
+
+func SetObjectDefaults_NetworkPolicyList(in *NetworkPolicyList) {
+ for i := range in.Items {
+ a := &in.Items[i]
+ SetObjectDefaults_NetworkPolicy(a)
+ }
+}
diff --git a/vendor/k8s.io/client-go/pkg/apis/networking/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/pkg/apis/networking/zz_generated.deepcopy.go
new file mode 100644
index 000000000..802868447
--- /dev/null
+++ b/vendor/k8s.io/client-go/pkg/apis/networking/zz_generated.deepcopy.go
@@ -0,0 +1,182 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright 2017 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// This file was autogenerated by deepcopy-gen. Do not edit it manually!
+
+package networking
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ intstr "k8s.io/apimachinery/pkg/util/intstr"
+ api "k8s.io/client-go/pkg/api"
+ reflect "reflect"
+)
+
+func init() {
+ SchemeBuilder.Register(RegisterDeepCopies)
+}
+
+// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
+// to allow building arbitrary schemes.
+func RegisterDeepCopies(scheme *runtime.Scheme) error {
+ return scheme.AddGeneratedDeepCopyFuncs(
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_networking_NetworkPolicy, InType: reflect.TypeOf(&NetworkPolicy{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_networking_NetworkPolicyIngressRule, InType: reflect.TypeOf(&NetworkPolicyIngressRule{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_networking_NetworkPolicyList, InType: reflect.TypeOf(&NetworkPolicyList{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_networking_NetworkPolicyPeer, InType: reflect.TypeOf(&NetworkPolicyPeer{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_networking_NetworkPolicyPort, InType: reflect.TypeOf(&NetworkPolicyPort{})},
+ conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_networking_NetworkPolicySpec, InType: reflect.TypeOf(&NetworkPolicySpec{})},
+ )
+}
+
+// DeepCopy_networking_NetworkPolicy is an autogenerated deepcopy function.
+func DeepCopy_networking_NetworkPolicy(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicy)
+ out := out.(*NetworkPolicy)
+ *out = *in
+ if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
+ return err
+ } else {
+ out.ObjectMeta = *newVal.(*v1.ObjectMeta)
+ }
+ if err := DeepCopy_networking_NetworkPolicySpec(&in.Spec, &out.Spec, c); err != nil {
+ return err
+ }
+ return nil
+ }
+}
+
+// DeepCopy_networking_NetworkPolicyIngressRule is an autogenerated deepcopy function.
+func DeepCopy_networking_NetworkPolicyIngressRule(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicyIngressRule)
+ out := out.(*NetworkPolicyIngressRule)
+ *out = *in
+ if in.Ports != nil {
+ in, out := &in.Ports, &out.Ports
+ *out = make([]NetworkPolicyPort, len(*in))
+ for i := range *in {
+ if err := DeepCopy_networking_NetworkPolicyPort(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ if in.From != nil {
+ in, out := &in.From, &out.From
+ *out = make([]NetworkPolicyPeer, len(*in))
+ for i := range *in {
+ if err := DeepCopy_networking_NetworkPolicyPeer(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+}
+
+// DeepCopy_networking_NetworkPolicyList is an autogenerated deepcopy function.
+func DeepCopy_networking_NetworkPolicyList(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicyList)
+ out := out.(*NetworkPolicyList)
+ *out = *in
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]NetworkPolicy, len(*in))
+ for i := range *in {
+ if err := DeepCopy_networking_NetworkPolicy(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+}
+
+// DeepCopy_networking_NetworkPolicyPeer is an autogenerated deepcopy function.
+func DeepCopy_networking_NetworkPolicyPeer(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicyPeer)
+ out := out.(*NetworkPolicyPeer)
+ *out = *in
+ if in.PodSelector != nil {
+ in, out := &in.PodSelector, &out.PodSelector
+ if newVal, err := c.DeepCopy(*in); err != nil {
+ return err
+ } else {
+ *out = newVal.(*v1.LabelSelector)
+ }
+ }
+ if in.NamespaceSelector != nil {
+ in, out := &in.NamespaceSelector, &out.NamespaceSelector
+ if newVal, err := c.DeepCopy(*in); err != nil {
+ return err
+ } else {
+ *out = newVal.(*v1.LabelSelector)
+ }
+ }
+ return nil
+ }
+}
+
+// DeepCopy_networking_NetworkPolicyPort is an autogenerated deepcopy function.
+func DeepCopy_networking_NetworkPolicyPort(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicyPort)
+ out := out.(*NetworkPolicyPort)
+ *out = *in
+ if in.Protocol != nil {
+ in, out := &in.Protocol, &out.Protocol
+ *out = new(api.Protocol)
+ **out = **in
+ }
+ if in.Port != nil {
+ in, out := &in.Port, &out.Port
+ *out = new(intstr.IntOrString)
+ **out = **in
+ }
+ return nil
+ }
+}
+
+// DeepCopy_networking_NetworkPolicySpec is an autogenerated deepcopy function.
+func DeepCopy_networking_NetworkPolicySpec(in interface{}, out interface{}, c *conversion.Cloner) error {
+ {
+ in := in.(*NetworkPolicySpec)
+ out := out.(*NetworkPolicySpec)
+ *out = *in
+ if newVal, err := c.DeepCopy(&in.PodSelector); err != nil {
+ return err
+ } else {
+ out.PodSelector = *newVal.(*v1.LabelSelector)
+ }
+ if in.Ingress != nil {
+ in, out := &in.Ingress, &out.Ingress
+ *out = make([]NetworkPolicyIngressRule, len(*in))
+ for i := range *in {
+ if err := DeepCopy_networking_NetworkPolicyIngressRule(&(*in)[i], &(*out)[i], c); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+}