*: update kube vendor to v1.7.4
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
c67859731f
commit
d56bf090ce
1032 changed files with 273965 additions and 40081 deletions
195
vendor/k8s.io/client-go/pkg/apis/networking/v1/conversion.go
generated
vendored
Normal file
195
vendor/k8s.io/client-go/pkg/apis/networking/v1/conversion.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
34
vendor/k8s.io/client-go/pkg/apis/networking/v1/defaults.go
generated
vendored
Normal file
34
vendor/k8s.io/client-go/pkg/apis/networking/v1/defaults.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
}
|
18
vendor/k8s.io/client-go/pkg/apis/networking/v1/doc.go
generated
vendored
Normal file
18
vendor/k8s.io/client-go/pkg/apis/networking/v1/doc.go
generated
vendored
Normal file
|
@ -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
|
1345
vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.pb.go
generated
vendored
Normal file
1345
vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
126
vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.proto
generated
vendored
Normal file
126
vendor/k8s.io/client-go/pkg/apis/networking/v1/generated.proto
generated
vendored
Normal file
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
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;
|
||||
}
|
50
vendor/k8s.io/client-go/pkg/apis/networking/v1/register.go
generated
vendored
Normal file
50
vendor/k8s.io/client-go/pkg/apis/networking/v1/register.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
2322
vendor/k8s.io/client-go/pkg/apis/networking/v1/types.generated.go
generated
vendored
Normal file
2322
vendor/k8s.io/client-go/pkg/apis/networking/v1/types.generated.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
120
vendor/k8s.io/client-go/pkg/apis/networking/v1/types.go
generated
vendored
Normal file
120
vendor/k8s.io/client-go/pkg/apis/networking/v1/types.go
generated
vendored
Normal file
|
@ -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"`
|
||||
}
|
90
vendor/k8s.io/client-go/pkg/apis/networking/v1/types_swagger_doc_generated.go
generated
vendored
Normal file
90
vendor/k8s.io/client-go/pkg/apis/networking/v1/types_swagger_doc_generated.go
generated
vendored
Normal file
|
@ -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
|
195
vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.conversion.go
generated
vendored
Normal file
195
vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.conversion.go
generated
vendored
Normal file
|
@ -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)
|
||||
}
|
182
vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.deepcopy.go
generated
vendored
Normal file
182
vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.deepcopy.go
generated
vendored
Normal file
|
@ -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
|
||||
}
|
||||
}
|
51
vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.defaults.go
generated
vendored
Normal file
51
vendor/k8s.io/client-go/pkg/apis/networking/v1/zz_generated.defaults.go
generated
vendored
Normal file
|
@ -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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue