From 412bec918d1e6a8974e5171434bc6773afada60e Mon Sep 17 00:00:00 2001 From: Istio Automation Date: Fri, 10 May 2024 19:07:57 -0700 Subject: [PATCH] Add packages for new v1 APIs (#2086) Co-authored-by: John Howard --- Makefile.core.mk | 8 +- pkg/apis/networking/v1/doc.go | 21 + pkg/apis/networking/v1/register.gen.go | 61 +++ pkg/apis/networking/v1/types.gen.go | 390 ++++++++++++++ .../v1/zz_generated.deepcopy.gen.go | 479 ++++++++++++++++++ pkg/apis/telemetry/v1/doc.go | 21 + pkg/apis/telemetry/v1/register.gen.go | 49 ++ pkg/apis/telemetry/v1/types.gen.go | 75 +++ .../telemetry/v1/zz_generated.deepcopy.gen.go | 89 ++++ .../networking/v1/destinationrule.go | 219 ++++++++ .../networking/v1/gateway.go | 219 ++++++++ .../networking/v1/serviceentry.go | 219 ++++++++ .../networking/v1/sidecar.go | 219 ++++++++ .../networking/v1/virtualservice.go | 219 ++++++++ .../networking/v1/workloadentry.go | 219 ++++++++ .../networking/v1/workloadgroup.go | 219 ++++++++ .../telemetry/v1/telemetry.go | 219 ++++++++ pkg/applyconfiguration/utils.go | 24 + pkg/clientset/versioned/clientset.gen.go | 26 + .../versioned/fake/clientset_generated.gen.go | 14 + pkg/clientset/versioned/fake/register.gen.go | 4 + .../versioned/scheme/register.gen.go | 4 + .../networking/v1/destinationrule.gen.go | 254 ++++++++++ .../versioned/typed/networking/v1/doc.go | 18 + .../versioned/typed/networking/v1/fake/doc.go | 18 + .../v1/fake/fake_destinationrule.gen.go | 187 +++++++ .../networking/v1/fake/fake_gateway.gen.go | 187 +++++++ .../v1/fake/fake_networking_client.gen.go | 62 +++ .../v1/fake/fake_serviceentry.gen.go | 187 +++++++ .../networking/v1/fake/fake_sidecar.gen.go | 187 +++++++ .../v1/fake/fake_virtualservice.gen.go | 187 +++++++ .../v1/fake/fake_workloadentry.gen.go | 187 +++++++ .../v1/fake/fake_workloadgroup.gen.go | 187 +++++++ .../typed/networking/v1/gateway.gen.go | 254 ++++++++++ .../networking/v1/generated_expansion.gen.go | 31 ++ .../networking/v1/networking_client.gen.go | 135 +++++ .../typed/networking/v1/serviceentry.gen.go | 254 ++++++++++ .../typed/networking/v1/sidecar.gen.go | 254 ++++++++++ .../typed/networking/v1/virtualservice.gen.go | 254 ++++++++++ .../typed/networking/v1/workloadentry.gen.go | 254 ++++++++++ .../typed/networking/v1/workloadgroup.gen.go | 254 ++++++++++ .../versioned/typed/telemetry/v1/doc.go | 18 + .../versioned/typed/telemetry/v1/fake/doc.go | 18 + .../telemetry/v1/fake/fake_telemetry.gen.go | 187 +++++++ .../v1/fake/fake_telemetry_client.gen.go | 38 ++ .../telemetry/v1/generated_expansion.gen.go | 19 + .../typed/telemetry/v1/telemetry.gen.go | 254 ++++++++++ .../telemetry/v1/telemetry_client.gen.go | 105 ++++ pkg/informers/externalversions/generic.gen.go | 30 +- .../networking/interface.gen.go | 8 + .../networking/v1/destinationrule.gen.go | 88 ++++ .../networking/v1/gateway.gen.go | 88 ++++ .../networking/v1/interface.gen.go | 85 ++++ .../networking/v1/serviceentry.gen.go | 88 ++++ .../networking/v1/sidecar.gen.go | 88 ++++ .../networking/v1/virtualservice.gen.go | 88 ++++ .../networking/v1/workloadentry.gen.go | 88 ++++ .../networking/v1/workloadgroup.gen.go | 88 ++++ .../telemetry/interface.gen.go | 8 + .../telemetry/v1/interface.gen.go | 43 ++ .../telemetry/v1/telemetry.gen.go | 88 ++++ .../networking/v1/destinationrule.gen.go | 97 ++++ .../networking/v1/expansion_generated.gen.go | 73 +++ pkg/listers/networking/v1/gateway.gen.go | 97 ++++ pkg/listers/networking/v1/serviceentry.gen.go | 97 ++++ pkg/listers/networking/v1/sidecar.gen.go | 97 ++++ .../networking/v1/virtualservice.gen.go | 97 ++++ .../networking/v1/workloadentry.gen.go | 97 ++++ .../networking/v1/workloadgroup.gen.go | 97 ++++ .../telemetry/v1/expansion_generated.gen.go | 25 + pkg/listers/telemetry/v1/telemetry.gen.go | 97 ++++ 71 files changed, 8753 insertions(+), 6 deletions(-) create mode 100644 pkg/apis/networking/v1/doc.go create mode 100644 pkg/apis/networking/v1/register.gen.go create mode 100644 pkg/apis/networking/v1/types.gen.go create mode 100644 pkg/apis/networking/v1/zz_generated.deepcopy.gen.go create mode 100644 pkg/apis/telemetry/v1/doc.go create mode 100644 pkg/apis/telemetry/v1/register.gen.go create mode 100644 pkg/apis/telemetry/v1/types.gen.go create mode 100644 pkg/apis/telemetry/v1/zz_generated.deepcopy.gen.go create mode 100644 pkg/applyconfiguration/networking/v1/destinationrule.go create mode 100644 pkg/applyconfiguration/networking/v1/gateway.go create mode 100644 pkg/applyconfiguration/networking/v1/serviceentry.go create mode 100644 pkg/applyconfiguration/networking/v1/sidecar.go create mode 100644 pkg/applyconfiguration/networking/v1/virtualservice.go create mode 100644 pkg/applyconfiguration/networking/v1/workloadentry.go create mode 100644 pkg/applyconfiguration/networking/v1/workloadgroup.go create mode 100644 pkg/applyconfiguration/telemetry/v1/telemetry.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/destinationrule.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/doc.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/fake/doc.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/fake/fake_destinationrule.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/fake/fake_gateway.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/fake/fake_networking_client.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/fake/fake_serviceentry.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/fake/fake_sidecar.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/fake/fake_virtualservice.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/fake/fake_workloadentry.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/fake/fake_workloadgroup.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/gateway.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/generated_expansion.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/networking_client.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/serviceentry.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/sidecar.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/virtualservice.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/workloadentry.gen.go create mode 100644 pkg/clientset/versioned/typed/networking/v1/workloadgroup.gen.go create mode 100644 pkg/clientset/versioned/typed/telemetry/v1/doc.go create mode 100644 pkg/clientset/versioned/typed/telemetry/v1/fake/doc.go create mode 100644 pkg/clientset/versioned/typed/telemetry/v1/fake/fake_telemetry.gen.go create mode 100644 pkg/clientset/versioned/typed/telemetry/v1/fake/fake_telemetry_client.gen.go create mode 100644 pkg/clientset/versioned/typed/telemetry/v1/generated_expansion.gen.go create mode 100644 pkg/clientset/versioned/typed/telemetry/v1/telemetry.gen.go create mode 100644 pkg/clientset/versioned/typed/telemetry/v1/telemetry_client.gen.go create mode 100644 pkg/informers/externalversions/networking/v1/destinationrule.gen.go create mode 100644 pkg/informers/externalversions/networking/v1/gateway.gen.go create mode 100644 pkg/informers/externalversions/networking/v1/interface.gen.go create mode 100644 pkg/informers/externalversions/networking/v1/serviceentry.gen.go create mode 100644 pkg/informers/externalversions/networking/v1/sidecar.gen.go create mode 100644 pkg/informers/externalversions/networking/v1/virtualservice.gen.go create mode 100644 pkg/informers/externalversions/networking/v1/workloadentry.gen.go create mode 100644 pkg/informers/externalversions/networking/v1/workloadgroup.gen.go create mode 100644 pkg/informers/externalversions/telemetry/v1/interface.gen.go create mode 100644 pkg/informers/externalversions/telemetry/v1/telemetry.gen.go create mode 100644 pkg/listers/networking/v1/destinationrule.gen.go create mode 100644 pkg/listers/networking/v1/expansion_generated.gen.go create mode 100644 pkg/listers/networking/v1/gateway.gen.go create mode 100644 pkg/listers/networking/v1/serviceentry.gen.go create mode 100644 pkg/listers/networking/v1/sidecar.gen.go create mode 100644 pkg/listers/networking/v1/virtualservice.gen.go create mode 100644 pkg/listers/networking/v1/workloadentry.gen.go create mode 100644 pkg/listers/networking/v1/workloadgroup.gen.go create mode 100644 pkg/listers/telemetry/v1/expansion_generated.gen.go create mode 100644 pkg/listers/telemetry/v1/telemetry.gen.go diff --git a/Makefile.core.mk b/Makefile.core.mk index 7df9dfa89..acff9005f 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -45,9 +45,11 @@ kube_istio_source_packages = $(subst $(space),$(empty), \ istio.io/api/extensions/v1alpha1, \ istio.io/api/networking/v1alpha3, \ istio.io/api/networking/v1beta1, \ + istio.io/api/networking/v1, \ istio.io/api/security/v1beta1, \ istio.io/api/security/v1, \ - istio.io/api/telemetry/v1alpha1 \ + istio.io/api/telemetry/v1alpha1, \ + istio.io/api/telemetry/v1 \ ) # base output package for generated files @@ -60,9 +62,11 @@ kube_api_packages = $(subst $(space),$(empty), \ $(kube_api_base_package)/extensions/v1alpha1, \ $(kube_api_base_package)/networking/v1alpha3, \ $(kube_api_base_package)/networking/v1beta1, \ + $(kube_api_base_package)/networking/v1, \ $(kube_api_base_package)/security/v1beta1, \ $(kube_api_base_package)/security/v1, \ - $(kube_api_base_package)/telemetry/v1alpha1 \ + $(kube_api_base_package)/telemetry/v1alpha1, \ + $(kube_api_base_package)/telemetry/v1 \ ) # this is needed to properly generate ssa functions kube_api_applyconfiguration_packages = $(kube_api_packages),k8s.io/apimachinery/pkg/apis/meta/v1 diff --git a/pkg/apis/networking/v1/doc.go b/pkg/apis/networking/v1/doc.go new file mode 100644 index 000000000..040a999a4 --- /dev/null +++ b/pkg/apis/networking/v1/doc.go @@ -0,0 +1,21 @@ +// Copyright Istio 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 kubetype-gen. DO NOT EDIT. + +// Package has auto-generated kube type wrappers for raw types. +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package +// +groupName=networking.istio.io +package v1 diff --git a/pkg/apis/networking/v1/register.gen.go b/pkg/apis/networking/v1/register.gen.go new file mode 100644 index 000000000..26022ff8d --- /dev/null +++ b/pkg/apis/networking/v1/register.gen.go @@ -0,0 +1,61 @@ +// Copyright Istio 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 kubetype-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + // Package-wide variables from generator "register". + SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +const ( + // Package-wide consts from generator "register". + GroupName = "networking.istio.io" +) + +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &DestinationRule{}, + &DestinationRuleList{}, + &Gateway{}, + &GatewayList{}, + &ServiceEntry{}, + &ServiceEntryList{}, + &Sidecar{}, + &SidecarList{}, + &VirtualService{}, + &VirtualServiceList{}, + &WorkloadEntry{}, + &WorkloadEntryList{}, + &WorkloadGroup{}, + &WorkloadGroupList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/pkg/apis/networking/v1/types.gen.go b/pkg/apis/networking/v1/types.gen.go new file mode 100644 index 000000000..e00d21428 --- /dev/null +++ b/pkg/apis/networking/v1/types.gen.go @@ -0,0 +1,390 @@ +// Copyright Istio 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 kubetype-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + networkingv1 "istio.io/api/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DestinationRule defines policies that apply to traffic intended for a service +// after routing has occurred. +// +// +// +// +// +type DestinationRule struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec networkingv1.DestinationRule `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + Status v1alpha1.IstioStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DestinationRuleList is a collection of DestinationRules. +type DestinationRuleList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []*DestinationRule `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Gateway describes a load balancer operating at the edge of the mesh +// receiving incoming or outgoing HTTP/TCP connections. +// +// +// +// +// +type Gateway struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec networkingv1.Gateway `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + Status v1alpha1.IstioStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// GatewayList is a collection of Gateways. +type GatewayList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []*Gateway `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceEntry enables adding additional entries into Istio's internal +// service registry. +// +// +// +// +// +type ServiceEntry struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec networkingv1.ServiceEntry `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + Status v1alpha1.IstioStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceEntryList is a collection of ServiceEntries. +type ServiceEntryList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []*ServiceEntry `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// `Sidecar` describes the configuration of the sidecar proxy that mediates +// inbound and outbound communication of the workload instance to which it is +// attached. +// +// +// +// +// +type Sidecar struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec networkingv1.Sidecar `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + Status v1alpha1.IstioStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// SidecarList is a collection of Sidecars. +type SidecarList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []*Sidecar `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Configuration affecting traffic routing. +// +// +// +// +// +type VirtualService struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec networkingv1.VirtualService `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + Status v1alpha1.IstioStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualServiceList is a collection of VirtualServices. +type VirtualServiceList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []*VirtualService `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// WorkloadEntry enables specifying the properties of a single non-Kubernetes workload such a VM or a bare metal services that can be referred to by service entries. +// +// +// +// +// +type WorkloadEntry struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec networkingv1.WorkloadEntry `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + Status v1alpha1.IstioStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// WorkloadEntryList is a collection of WorkloadEntries. +type WorkloadEntryList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []*WorkloadEntry `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// `WorkloadGroup` enables specifying the properties of a single workload for bootstrap and +// provides a template for `WorkloadEntry`, similar to how `Deployment` specifies properties +// of workloads via `Pod` templates. A `WorkloadGroup` can have more than one `WorkloadEntry`. +// `WorkloadGroup` has no relationship to resources which control service registry like `ServiceEntry` +// and as such doesn't configure host name for these workloads. +// +// +// +// +// +type WorkloadGroup struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec networkingv1.WorkloadGroup `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + Status v1alpha1.IstioStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// WorkloadGroupList is a collection of WorkloadGroups. +type WorkloadGroupList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []*WorkloadGroup `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/pkg/apis/networking/v1/zz_generated.deepcopy.gen.go b/pkg/apis/networking/v1/zz_generated.deepcopy.gen.go new file mode 100644 index 000000000..274e15d45 --- /dev/null +++ b/pkg/apis/networking/v1/zz_generated.deepcopy.gen.go @@ -0,0 +1,479 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright Istio 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 deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRule) DeepCopyInto(out *DestinationRule) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRule. +func (in *DestinationRule) DeepCopy() *DestinationRule { + if in == nil { + return nil + } + out := new(DestinationRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DestinationRule) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRuleList) DeepCopyInto(out *DestinationRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*DestinationRule, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(DestinationRule) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRuleList. +func (in *DestinationRuleList) DeepCopy() *DestinationRuleList { + if in == nil { + return nil + } + out := new(DestinationRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DestinationRuleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Gateway) DeepCopyInto(out *Gateway) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gateway. +func (in *Gateway) DeepCopy() *Gateway { + if in == nil { + return nil + } + out := new(Gateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Gateway) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayList) DeepCopyInto(out *GatewayList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*Gateway, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Gateway) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayList. +func (in *GatewayList) DeepCopy() *GatewayList { + if in == nil { + return nil + } + out := new(GatewayList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntry) DeepCopyInto(out *ServiceEntry) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntry. +func (in *ServiceEntry) DeepCopy() *ServiceEntry { + if in == nil { + return nil + } + out := new(ServiceEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceEntry) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntryList) DeepCopyInto(out *ServiceEntryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*ServiceEntry, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(ServiceEntry) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntryList. +func (in *ServiceEntryList) DeepCopy() *ServiceEntryList { + if in == nil { + return nil + } + out := new(ServiceEntryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceEntryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Sidecar) DeepCopyInto(out *Sidecar) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sidecar. +func (in *Sidecar) DeepCopy() *Sidecar { + if in == nil { + return nil + } + out := new(Sidecar) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Sidecar) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SidecarList) DeepCopyInto(out *SidecarList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*Sidecar, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Sidecar) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SidecarList. +func (in *SidecarList) DeepCopy() *SidecarList { + if in == nil { + return nil + } + out := new(SidecarList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SidecarList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualService) DeepCopyInto(out *VirtualService) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualService. +func (in *VirtualService) DeepCopy() *VirtualService { + if in == nil { + return nil + } + out := new(VirtualService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualService) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceList) DeepCopyInto(out *VirtualServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*VirtualService, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(VirtualService) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceList. +func (in *VirtualServiceList) DeepCopy() *VirtualServiceList { + if in == nil { + return nil + } + out := new(VirtualServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadEntry) DeepCopyInto(out *WorkloadEntry) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadEntry. +func (in *WorkloadEntry) DeepCopy() *WorkloadEntry { + if in == nil { + return nil + } + out := new(WorkloadEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkloadEntry) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadEntryList) DeepCopyInto(out *WorkloadEntryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*WorkloadEntry, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(WorkloadEntry) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadEntryList. +func (in *WorkloadEntryList) DeepCopy() *WorkloadEntryList { + if in == nil { + return nil + } + out := new(WorkloadEntryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkloadEntryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadGroup) DeepCopyInto(out *WorkloadGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadGroup. +func (in *WorkloadGroup) DeepCopy() *WorkloadGroup { + if in == nil { + return nil + } + out := new(WorkloadGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkloadGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadGroupList) DeepCopyInto(out *WorkloadGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*WorkloadGroup, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(WorkloadGroup) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadGroupList. +func (in *WorkloadGroupList) DeepCopy() *WorkloadGroupList { + if in == nil { + return nil + } + out := new(WorkloadGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkloadGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/pkg/apis/telemetry/v1/doc.go b/pkg/apis/telemetry/v1/doc.go new file mode 100644 index 000000000..9780b5ec8 --- /dev/null +++ b/pkg/apis/telemetry/v1/doc.go @@ -0,0 +1,21 @@ +// Copyright Istio 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 kubetype-gen. DO NOT EDIT. + +// Package has auto-generated kube type wrappers for raw types. +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package +// +groupName=telemetry.istio.io +package v1 diff --git a/pkg/apis/telemetry/v1/register.gen.go b/pkg/apis/telemetry/v1/register.gen.go new file mode 100644 index 000000000..24ba668c0 --- /dev/null +++ b/pkg/apis/telemetry/v1/register.gen.go @@ -0,0 +1,49 @@ +// Copyright Istio 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 kubetype-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + // Package-wide variables from generator "register". + SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +const ( + // Package-wide consts from generator "register". + GroupName = "telemetry.istio.io" +) + +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &Telemetry{}, + &TelemetryList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/pkg/apis/telemetry/v1/types.gen.go b/pkg/apis/telemetry/v1/types.gen.go new file mode 100644 index 000000000..0b43b8b93 --- /dev/null +++ b/pkg/apis/telemetry/v1/types.gen.go @@ -0,0 +1,75 @@ +// Copyright Istio 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 kubetype-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + telemetryv1 "istio.io/api/telemetry/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// +// +// +// --> +// +type Telemetry struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec telemetryv1.Telemetry `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + + Status v1alpha1.IstioStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TelemetryList is a collection of Telemetries. +type TelemetryList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []*Telemetry `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/pkg/apis/telemetry/v1/zz_generated.deepcopy.gen.go b/pkg/apis/telemetry/v1/zz_generated.deepcopy.gen.go new file mode 100644 index 000000000..a5d639e54 --- /dev/null +++ b/pkg/apis/telemetry/v1/zz_generated.deepcopy.gen.go @@ -0,0 +1,89 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright Istio 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 deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Telemetry) DeepCopyInto(out *Telemetry) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Telemetry. +func (in *Telemetry) DeepCopy() *Telemetry { + if in == nil { + return nil + } + out := new(Telemetry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Telemetry) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TelemetryList) DeepCopyInto(out *TelemetryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*Telemetry, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Telemetry) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetryList. +func (in *TelemetryList) DeepCopy() *TelemetryList { + if in == nil { + return nil + } + out := new(TelemetryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TelemetryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/pkg/applyconfiguration/networking/v1/destinationrule.go b/pkg/applyconfiguration/networking/v1/destinationrule.go new file mode 100644 index 000000000..9ae8f2531 --- /dev/null +++ b/pkg/applyconfiguration/networking/v1/destinationrule.go @@ -0,0 +1,219 @@ +// Copyright Istio 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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + networkingv1 "istio.io/api/networking/v1" + v1 "istio.io/client-go/pkg/applyconfiguration/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// DestinationRuleApplyConfiguration represents an declarative configuration of the DestinationRule type for use +// with apply. +type DestinationRuleApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *networkingv1.DestinationRule `json:"spec,omitempty"` + Status *v1alpha1.IstioStatus `json:"status,omitempty"` +} + +// DestinationRule constructs an declarative configuration of the DestinationRule type for use with +// apply. +func DestinationRule(name, namespace string) *DestinationRuleApplyConfiguration { + b := &DestinationRuleApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("DestinationRule") + b.WithAPIVersion("networking.istio.io/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithKind(value string) *DestinationRuleApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithAPIVersion(value string) *DestinationRuleApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithName(value string) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithGenerateName(value string) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithNamespace(value string) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithUID(value types.UID) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithResourceVersion(value string) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithGeneration(value int64) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *DestinationRuleApplyConfiguration) WithLabels(entries map[string]string) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *DestinationRuleApplyConfiguration) WithAnnotations(entries map[string]string) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *DestinationRuleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *DestinationRuleApplyConfiguration) WithFinalizers(values ...string) *DestinationRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *DestinationRuleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithSpec(value networkingv1.DestinationRule) *DestinationRuleApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *DestinationRuleApplyConfiguration) WithStatus(value v1alpha1.IstioStatus) *DestinationRuleApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/applyconfiguration/networking/v1/gateway.go b/pkg/applyconfiguration/networking/v1/gateway.go new file mode 100644 index 000000000..448e716dd --- /dev/null +++ b/pkg/applyconfiguration/networking/v1/gateway.go @@ -0,0 +1,219 @@ +// Copyright Istio 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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + networkingv1 "istio.io/api/networking/v1" + v1 "istio.io/client-go/pkg/applyconfiguration/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// GatewayApplyConfiguration represents an declarative configuration of the Gateway type for use +// with apply. +type GatewayApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *networkingv1.Gateway `json:"spec,omitempty"` + Status *v1alpha1.IstioStatus `json:"status,omitempty"` +} + +// Gateway constructs an declarative configuration of the Gateway type for use with +// apply. +func Gateway(name, namespace string) *GatewayApplyConfiguration { + b := &GatewayApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Gateway") + b.WithAPIVersion("networking.istio.io/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithKind(value string) *GatewayApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithAPIVersion(value string) *GatewayApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithName(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithGenerateName(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithNamespace(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithUID(value types.UID) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithResourceVersion(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithGeneration(value int64) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GatewayApplyConfiguration) WithLabels(entries map[string]string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GatewayApplyConfiguration) WithAnnotations(entries map[string]string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GatewayApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GatewayApplyConfiguration) WithFinalizers(values ...string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GatewayApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithSpec(value networkingv1.Gateway) *GatewayApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithStatus(value v1alpha1.IstioStatus) *GatewayApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/applyconfiguration/networking/v1/serviceentry.go b/pkg/applyconfiguration/networking/v1/serviceentry.go new file mode 100644 index 000000000..3a52bf680 --- /dev/null +++ b/pkg/applyconfiguration/networking/v1/serviceentry.go @@ -0,0 +1,219 @@ +// Copyright Istio 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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + networkingv1 "istio.io/api/networking/v1" + v1 "istio.io/client-go/pkg/applyconfiguration/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// ServiceEntryApplyConfiguration represents an declarative configuration of the ServiceEntry type for use +// with apply. +type ServiceEntryApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *networkingv1.ServiceEntry `json:"spec,omitempty"` + Status *v1alpha1.IstioStatus `json:"status,omitempty"` +} + +// ServiceEntry constructs an declarative configuration of the ServiceEntry type for use with +// apply. +func ServiceEntry(name, namespace string) *ServiceEntryApplyConfiguration { + b := &ServiceEntryApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ServiceEntry") + b.WithAPIVersion("networking.istio.io/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithKind(value string) *ServiceEntryApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithAPIVersion(value string) *ServiceEntryApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithName(value string) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithGenerateName(value string) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithNamespace(value string) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithUID(value types.UID) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithResourceVersion(value string) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithGeneration(value int64) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ServiceEntryApplyConfiguration) WithLabels(entries map[string]string) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ServiceEntryApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ServiceEntryApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ServiceEntryApplyConfiguration) WithFinalizers(values ...string) *ServiceEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ServiceEntryApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithSpec(value networkingv1.ServiceEntry) *ServiceEntryApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ServiceEntryApplyConfiguration) WithStatus(value v1alpha1.IstioStatus) *ServiceEntryApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/applyconfiguration/networking/v1/sidecar.go b/pkg/applyconfiguration/networking/v1/sidecar.go new file mode 100644 index 000000000..11b7bd256 --- /dev/null +++ b/pkg/applyconfiguration/networking/v1/sidecar.go @@ -0,0 +1,219 @@ +// Copyright Istio 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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + networkingv1 "istio.io/api/networking/v1" + v1 "istio.io/client-go/pkg/applyconfiguration/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// SidecarApplyConfiguration represents an declarative configuration of the Sidecar type for use +// with apply. +type SidecarApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *networkingv1.Sidecar `json:"spec,omitempty"` + Status *v1alpha1.IstioStatus `json:"status,omitempty"` +} + +// Sidecar constructs an declarative configuration of the Sidecar type for use with +// apply. +func Sidecar(name, namespace string) *SidecarApplyConfiguration { + b := &SidecarApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Sidecar") + b.WithAPIVersion("networking.istio.io/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithKind(value string) *SidecarApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithAPIVersion(value string) *SidecarApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithName(value string) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithGenerateName(value string) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithNamespace(value string) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithUID(value types.UID) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithResourceVersion(value string) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithGeneration(value int64) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithCreationTimestamp(value metav1.Time) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *SidecarApplyConfiguration) WithLabels(entries map[string]string) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *SidecarApplyConfiguration) WithAnnotations(entries map[string]string) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *SidecarApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *SidecarApplyConfiguration) WithFinalizers(values ...string) *SidecarApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *SidecarApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithSpec(value networkingv1.Sidecar) *SidecarApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *SidecarApplyConfiguration) WithStatus(value v1alpha1.IstioStatus) *SidecarApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/applyconfiguration/networking/v1/virtualservice.go b/pkg/applyconfiguration/networking/v1/virtualservice.go new file mode 100644 index 000000000..235655cd5 --- /dev/null +++ b/pkg/applyconfiguration/networking/v1/virtualservice.go @@ -0,0 +1,219 @@ +// Copyright Istio 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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + networkingv1 "istio.io/api/networking/v1" + v1 "istio.io/client-go/pkg/applyconfiguration/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// VirtualServiceApplyConfiguration represents an declarative configuration of the VirtualService type for use +// with apply. +type VirtualServiceApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *networkingv1.VirtualService `json:"spec,omitempty"` + Status *v1alpha1.IstioStatus `json:"status,omitempty"` +} + +// VirtualService constructs an declarative configuration of the VirtualService type for use with +// apply. +func VirtualService(name, namespace string) *VirtualServiceApplyConfiguration { + b := &VirtualServiceApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("VirtualService") + b.WithAPIVersion("networking.istio.io/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithKind(value string) *VirtualServiceApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithAPIVersion(value string) *VirtualServiceApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithName(value string) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithGenerateName(value string) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithNamespace(value string) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithUID(value types.UID) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithResourceVersion(value string) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithGeneration(value int64) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *VirtualServiceApplyConfiguration) WithLabels(entries map[string]string) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *VirtualServiceApplyConfiguration) WithAnnotations(entries map[string]string) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *VirtualServiceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *VirtualServiceApplyConfiguration) WithFinalizers(values ...string) *VirtualServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *VirtualServiceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithSpec(value networkingv1.VirtualService) *VirtualServiceApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *VirtualServiceApplyConfiguration) WithStatus(value v1alpha1.IstioStatus) *VirtualServiceApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/applyconfiguration/networking/v1/workloadentry.go b/pkg/applyconfiguration/networking/v1/workloadentry.go new file mode 100644 index 000000000..db7db632a --- /dev/null +++ b/pkg/applyconfiguration/networking/v1/workloadentry.go @@ -0,0 +1,219 @@ +// Copyright Istio 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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + networkingv1 "istio.io/api/networking/v1" + v1 "istio.io/client-go/pkg/applyconfiguration/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// WorkloadEntryApplyConfiguration represents an declarative configuration of the WorkloadEntry type for use +// with apply. +type WorkloadEntryApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *networkingv1.WorkloadEntry `json:"spec,omitempty"` + Status *v1alpha1.IstioStatus `json:"status,omitempty"` +} + +// WorkloadEntry constructs an declarative configuration of the WorkloadEntry type for use with +// apply. +func WorkloadEntry(name, namespace string) *WorkloadEntryApplyConfiguration { + b := &WorkloadEntryApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("WorkloadEntry") + b.WithAPIVersion("networking.istio.io/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithKind(value string) *WorkloadEntryApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithAPIVersion(value string) *WorkloadEntryApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithName(value string) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithGenerateName(value string) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithNamespace(value string) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithUID(value types.UID) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithResourceVersion(value string) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithGeneration(value int64) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithCreationTimestamp(value metav1.Time) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *WorkloadEntryApplyConfiguration) WithLabels(entries map[string]string) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *WorkloadEntryApplyConfiguration) WithAnnotations(entries map[string]string) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *WorkloadEntryApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *WorkloadEntryApplyConfiguration) WithFinalizers(values ...string) *WorkloadEntryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *WorkloadEntryApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithSpec(value networkingv1.WorkloadEntry) *WorkloadEntryApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *WorkloadEntryApplyConfiguration) WithStatus(value v1alpha1.IstioStatus) *WorkloadEntryApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/applyconfiguration/networking/v1/workloadgroup.go b/pkg/applyconfiguration/networking/v1/workloadgroup.go new file mode 100644 index 000000000..329588a5c --- /dev/null +++ b/pkg/applyconfiguration/networking/v1/workloadgroup.go @@ -0,0 +1,219 @@ +// Copyright Istio 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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + networkingv1 "istio.io/api/networking/v1" + v1 "istio.io/client-go/pkg/applyconfiguration/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// WorkloadGroupApplyConfiguration represents an declarative configuration of the WorkloadGroup type for use +// with apply. +type WorkloadGroupApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *networkingv1.WorkloadGroup `json:"spec,omitempty"` + Status *v1alpha1.IstioStatus `json:"status,omitempty"` +} + +// WorkloadGroup constructs an declarative configuration of the WorkloadGroup type for use with +// apply. +func WorkloadGroup(name, namespace string) *WorkloadGroupApplyConfiguration { + b := &WorkloadGroupApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("WorkloadGroup") + b.WithAPIVersion("networking.istio.io/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithKind(value string) *WorkloadGroupApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithAPIVersion(value string) *WorkloadGroupApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithName(value string) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithGenerateName(value string) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithNamespace(value string) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithUID(value types.UID) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithResourceVersion(value string) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithGeneration(value int64) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithCreationTimestamp(value metav1.Time) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *WorkloadGroupApplyConfiguration) WithLabels(entries map[string]string) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *WorkloadGroupApplyConfiguration) WithAnnotations(entries map[string]string) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *WorkloadGroupApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *WorkloadGroupApplyConfiguration) WithFinalizers(values ...string) *WorkloadGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *WorkloadGroupApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithSpec(value networkingv1.WorkloadGroup) *WorkloadGroupApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *WorkloadGroupApplyConfiguration) WithStatus(value v1alpha1.IstioStatus) *WorkloadGroupApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/applyconfiguration/telemetry/v1/telemetry.go b/pkg/applyconfiguration/telemetry/v1/telemetry.go new file mode 100644 index 000000000..4b984673f --- /dev/null +++ b/pkg/applyconfiguration/telemetry/v1/telemetry.go @@ -0,0 +1,219 @@ +// Copyright Istio 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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha1 "istio.io/api/meta/v1alpha1" + telemetryv1 "istio.io/api/telemetry/v1" + v1 "istio.io/client-go/pkg/applyconfiguration/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// TelemetryApplyConfiguration represents an declarative configuration of the Telemetry type for use +// with apply. +type TelemetryApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *telemetryv1.Telemetry `json:"spec,omitempty"` + Status *v1alpha1.IstioStatus `json:"status,omitempty"` +} + +// Telemetry constructs an declarative configuration of the Telemetry type for use with +// apply. +func Telemetry(name, namespace string) *TelemetryApplyConfiguration { + b := &TelemetryApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Telemetry") + b.WithAPIVersion("telemetry.istio.io/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithKind(value string) *TelemetryApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithAPIVersion(value string) *TelemetryApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithName(value string) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithGenerateName(value string) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithNamespace(value string) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithUID(value types.UID) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithResourceVersion(value string) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithGeneration(value int64) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithCreationTimestamp(value metav1.Time) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *TelemetryApplyConfiguration) WithLabels(entries map[string]string) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *TelemetryApplyConfiguration) WithAnnotations(entries map[string]string) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *TelemetryApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *TelemetryApplyConfiguration) WithFinalizers(values ...string) *TelemetryApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *TelemetryApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithSpec(value telemetryv1.Telemetry) *TelemetryApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *TelemetryApplyConfiguration) WithStatus(value v1alpha1.IstioStatus) *TelemetryApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/applyconfiguration/utils.go b/pkg/applyconfiguration/utils.go index 3c6ccfc72..ee9f64fa0 100644 --- a/pkg/applyconfiguration/utils.go +++ b/pkg/applyconfiguration/utils.go @@ -18,17 +18,21 @@ package applyconfiguration import ( v1alpha1 "istio.io/client-go/pkg/apis/extensions/v1alpha1" + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" securityv1 "istio.io/client-go/pkg/apis/security/v1" securityv1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" + telemetryv1 "istio.io/client-go/pkg/apis/telemetry/v1" telemetryv1alpha1 "istio.io/client-go/pkg/apis/telemetry/v1alpha1" extensionsv1alpha1 "istio.io/client-go/pkg/applyconfiguration/extensions/v1alpha1" metav1 "istio.io/client-go/pkg/applyconfiguration/meta/v1" + applyconfigurationnetworkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" networkingv1alpha3 "istio.io/client-go/pkg/applyconfiguration/networking/v1alpha3" networkingv1beta1 "istio.io/client-go/pkg/applyconfiguration/networking/v1beta1" applyconfigurationsecurityv1 "istio.io/client-go/pkg/applyconfiguration/security/v1" applyconfigurationsecurityv1beta1 "istio.io/client-go/pkg/applyconfiguration/security/v1beta1" + applyconfigurationtelemetryv1 "istio.io/client-go/pkg/applyconfiguration/telemetry/v1" applyconfigurationtelemetryv1alpha1 "istio.io/client-go/pkg/applyconfiguration/telemetry/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -52,6 +56,22 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case v1.SchemeGroupVersion.WithKind("TypeMeta"): return &metav1.TypeMetaApplyConfiguration{} + // Group=networking.istio.io, Version=v1 + case networkingv1.SchemeGroupVersion.WithKind("DestinationRule"): + return &applyconfigurationnetworkingv1.DestinationRuleApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("Gateway"): + return &applyconfigurationnetworkingv1.GatewayApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("ServiceEntry"): + return &applyconfigurationnetworkingv1.ServiceEntryApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("Sidecar"): + return &applyconfigurationnetworkingv1.SidecarApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("VirtualService"): + return &applyconfigurationnetworkingv1.VirtualServiceApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("WorkloadEntry"): + return &applyconfigurationnetworkingv1.WorkloadEntryApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("WorkloadGroup"): + return &applyconfigurationnetworkingv1.WorkloadGroupApplyConfiguration{} + // Group=networking.istio.io, Version=v1alpha3 case v1alpha3.SchemeGroupVersion.WithKind("DestinationRule"): return &networkingv1alpha3.DestinationRuleApplyConfiguration{} @@ -104,6 +124,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case securityv1beta1.SchemeGroupVersion.WithKind("RequestAuthentication"): return &applyconfigurationsecurityv1beta1.RequestAuthenticationApplyConfiguration{} + // Group=telemetry.istio.io, Version=v1 + case telemetryv1.SchemeGroupVersion.WithKind("Telemetry"): + return &applyconfigurationtelemetryv1.TelemetryApplyConfiguration{} + // Group=telemetry.istio.io, Version=v1alpha1 case telemetryv1alpha1.SchemeGroupVersion.WithKind("Telemetry"): return &applyconfigurationtelemetryv1alpha1.TelemetryApplyConfiguration{} diff --git a/pkg/clientset/versioned/clientset.gen.go b/pkg/clientset/versioned/clientset.gen.go index 5c80e6dd6..7714ed088 100644 --- a/pkg/clientset/versioned/clientset.gen.go +++ b/pkg/clientset/versioned/clientset.gen.go @@ -21,10 +21,12 @@ import ( "net/http" extensionsv1alpha1 "istio.io/client-go/pkg/clientset/versioned/typed/extensions/v1alpha1" + networkingv1 "istio.io/client-go/pkg/clientset/versioned/typed/networking/v1" networkingv1alpha3 "istio.io/client-go/pkg/clientset/versioned/typed/networking/v1alpha3" networkingv1beta1 "istio.io/client-go/pkg/clientset/versioned/typed/networking/v1beta1" securityv1 "istio.io/client-go/pkg/clientset/versioned/typed/security/v1" securityv1beta1 "istio.io/client-go/pkg/clientset/versioned/typed/security/v1beta1" + telemetryv1 "istio.io/client-go/pkg/clientset/versioned/typed/telemetry/v1" telemetryv1alpha1 "istio.io/client-go/pkg/clientset/versioned/typed/telemetry/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" @@ -36,9 +38,11 @@ type Interface interface { ExtensionsV1alpha1() extensionsv1alpha1.ExtensionsV1alpha1Interface NetworkingV1alpha3() networkingv1alpha3.NetworkingV1alpha3Interface NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface + NetworkingV1() networkingv1.NetworkingV1Interface SecurityV1beta1() securityv1beta1.SecurityV1beta1Interface SecurityV1() securityv1.SecurityV1Interface TelemetryV1alpha1() telemetryv1alpha1.TelemetryV1alpha1Interface + TelemetryV1() telemetryv1.TelemetryV1Interface } // Clientset contains the clients for groups. @@ -47,9 +51,11 @@ type Clientset struct { extensionsV1alpha1 *extensionsv1alpha1.ExtensionsV1alpha1Client networkingV1alpha3 *networkingv1alpha3.NetworkingV1alpha3Client networkingV1beta1 *networkingv1beta1.NetworkingV1beta1Client + networkingV1 *networkingv1.NetworkingV1Client securityV1beta1 *securityv1beta1.SecurityV1beta1Client securityV1 *securityv1.SecurityV1Client telemetryV1alpha1 *telemetryv1alpha1.TelemetryV1alpha1Client + telemetryV1 *telemetryv1.TelemetryV1Client } // ExtensionsV1alpha1 retrieves the ExtensionsV1alpha1Client @@ -67,6 +73,11 @@ func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Inter return c.networkingV1beta1 } +// NetworkingV1 retrieves the NetworkingV1Client +func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { + return c.networkingV1 +} + // SecurityV1beta1 retrieves the SecurityV1beta1Client func (c *Clientset) SecurityV1beta1() securityv1beta1.SecurityV1beta1Interface { return c.securityV1beta1 @@ -82,6 +93,11 @@ func (c *Clientset) TelemetryV1alpha1() telemetryv1alpha1.TelemetryV1alpha1Inter return c.telemetryV1alpha1 } +// TelemetryV1 retrieves the TelemetryV1Client +func (c *Clientset) TelemetryV1() telemetryv1.TelemetryV1Interface { + return c.telemetryV1 +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -138,6 +154,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.networkingV1, err = networkingv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.securityV1beta1, err = securityv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -150,6 +170,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.telemetryV1, err = telemetryv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { @@ -174,9 +198,11 @@ func New(c rest.Interface) *Clientset { cs.extensionsV1alpha1 = extensionsv1alpha1.New(c) cs.networkingV1alpha3 = networkingv1alpha3.New(c) cs.networkingV1beta1 = networkingv1beta1.New(c) + cs.networkingV1 = networkingv1.New(c) cs.securityV1beta1 = securityv1beta1.New(c) cs.securityV1 = securityv1.New(c) cs.telemetryV1alpha1 = telemetryv1alpha1.New(c) + cs.telemetryV1 = telemetryv1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/clientset/versioned/fake/clientset_generated.gen.go b/pkg/clientset/versioned/fake/clientset_generated.gen.go index b082dd297..9806443f1 100644 --- a/pkg/clientset/versioned/fake/clientset_generated.gen.go +++ b/pkg/clientset/versioned/fake/clientset_generated.gen.go @@ -20,6 +20,8 @@ import ( clientset "istio.io/client-go/pkg/clientset/versioned" extensionsv1alpha1 "istio.io/client-go/pkg/clientset/versioned/typed/extensions/v1alpha1" fakeextensionsv1alpha1 "istio.io/client-go/pkg/clientset/versioned/typed/extensions/v1alpha1/fake" + networkingv1 "istio.io/client-go/pkg/clientset/versioned/typed/networking/v1" + fakenetworkingv1 "istio.io/client-go/pkg/clientset/versioned/typed/networking/v1/fake" networkingv1alpha3 "istio.io/client-go/pkg/clientset/versioned/typed/networking/v1alpha3" fakenetworkingv1alpha3 "istio.io/client-go/pkg/clientset/versioned/typed/networking/v1alpha3/fake" networkingv1beta1 "istio.io/client-go/pkg/clientset/versioned/typed/networking/v1beta1" @@ -28,6 +30,8 @@ import ( fakesecurityv1 "istio.io/client-go/pkg/clientset/versioned/typed/security/v1/fake" securityv1beta1 "istio.io/client-go/pkg/clientset/versioned/typed/security/v1beta1" fakesecurityv1beta1 "istio.io/client-go/pkg/clientset/versioned/typed/security/v1beta1/fake" + telemetryv1 "istio.io/client-go/pkg/clientset/versioned/typed/telemetry/v1" + faketelemetryv1 "istio.io/client-go/pkg/clientset/versioned/typed/telemetry/v1/fake" telemetryv1alpha1 "istio.io/client-go/pkg/clientset/versioned/typed/telemetry/v1alpha1" faketelemetryv1alpha1 "istio.io/client-go/pkg/clientset/versioned/typed/telemetry/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" @@ -102,6 +106,11 @@ func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Inter return &fakenetworkingv1beta1.FakeNetworkingV1beta1{Fake: &c.Fake} } +// NetworkingV1 retrieves the NetworkingV1Client +func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { + return &fakenetworkingv1.FakeNetworkingV1{Fake: &c.Fake} +} + // SecurityV1beta1 retrieves the SecurityV1beta1Client func (c *Clientset) SecurityV1beta1() securityv1beta1.SecurityV1beta1Interface { return &fakesecurityv1beta1.FakeSecurityV1beta1{Fake: &c.Fake} @@ -116,3 +125,8 @@ func (c *Clientset) SecurityV1() securityv1.SecurityV1Interface { func (c *Clientset) TelemetryV1alpha1() telemetryv1alpha1.TelemetryV1alpha1Interface { return &faketelemetryv1alpha1.FakeTelemetryV1alpha1{Fake: &c.Fake} } + +// TelemetryV1 retrieves the TelemetryV1Client +func (c *Clientset) TelemetryV1() telemetryv1.TelemetryV1Interface { + return &faketelemetryv1.FakeTelemetryV1{Fake: &c.Fake} +} diff --git a/pkg/clientset/versioned/fake/register.gen.go b/pkg/clientset/versioned/fake/register.gen.go index 9b8715547..d0eae904a 100644 --- a/pkg/clientset/versioned/fake/register.gen.go +++ b/pkg/clientset/versioned/fake/register.gen.go @@ -18,10 +18,12 @@ package fake import ( extensionsv1alpha1 "istio.io/client-go/pkg/apis/extensions/v1alpha1" + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" securityv1 "istio.io/client-go/pkg/apis/security/v1" securityv1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" + telemetryv1 "istio.io/client-go/pkg/apis/telemetry/v1" telemetryv1alpha1 "istio.io/client-go/pkg/apis/telemetry/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -37,9 +39,11 @@ var localSchemeBuilder = runtime.SchemeBuilder{ extensionsv1alpha1.AddToScheme, networkingv1alpha3.AddToScheme, networkingv1beta1.AddToScheme, + networkingv1.AddToScheme, securityv1beta1.AddToScheme, securityv1.AddToScheme, telemetryv1alpha1.AddToScheme, + telemetryv1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/clientset/versioned/scheme/register.gen.go b/pkg/clientset/versioned/scheme/register.gen.go index f6463c5ac..e647cf6e7 100644 --- a/pkg/clientset/versioned/scheme/register.gen.go +++ b/pkg/clientset/versioned/scheme/register.gen.go @@ -18,10 +18,12 @@ package scheme import ( extensionsv1alpha1 "istio.io/client-go/pkg/apis/extensions/v1alpha1" + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" securityv1 "istio.io/client-go/pkg/apis/security/v1" securityv1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" + telemetryv1 "istio.io/client-go/pkg/apis/telemetry/v1" telemetryv1alpha1 "istio.io/client-go/pkg/apis/telemetry/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -37,9 +39,11 @@ var localSchemeBuilder = runtime.SchemeBuilder{ extensionsv1alpha1.AddToScheme, networkingv1alpha3.AddToScheme, networkingv1beta1.AddToScheme, + networkingv1.AddToScheme, securityv1beta1.AddToScheme, securityv1.AddToScheme, telemetryv1alpha1.AddToScheme, + telemetryv1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/clientset/versioned/typed/networking/v1/destinationrule.gen.go b/pkg/clientset/versioned/typed/networking/v1/destinationrule.gen.go new file mode 100644 index 000000000..e22816946 --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/destinationrule.gen.go @@ -0,0 +1,254 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + scheme "istio.io/client-go/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// DestinationRulesGetter has a method to return a DestinationRuleInterface. +// A group's client should implement this interface. +type DestinationRulesGetter interface { + DestinationRules(namespace string) DestinationRuleInterface +} + +// DestinationRuleInterface has methods to work with DestinationRule resources. +type DestinationRuleInterface interface { + Create(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.CreateOptions) (*v1.DestinationRule, error) + Update(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.UpdateOptions) (*v1.DestinationRule, error) + UpdateStatus(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.UpdateOptions) (*v1.DestinationRule, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DestinationRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DestinationRuleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DestinationRule, err error) + Apply(ctx context.Context, destinationRule *networkingv1.DestinationRuleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DestinationRule, err error) + ApplyStatus(ctx context.Context, destinationRule *networkingv1.DestinationRuleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DestinationRule, err error) + DestinationRuleExpansion +} + +// destinationRules implements DestinationRuleInterface +type destinationRules struct { + client rest.Interface + ns string +} + +// newDestinationRules returns a DestinationRules +func newDestinationRules(c *NetworkingV1Client, namespace string) *destinationRules { + return &destinationRules{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the destinationRule, and returns the corresponding destinationRule object, and an error if there is any. +func (c *destinationRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DestinationRule, err error) { + result = &v1.DestinationRule{} + err = c.client.Get(). + Namespace(c.ns). + Resource("destinationrules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DestinationRules that match those selectors. +func (c *destinationRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DestinationRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DestinationRuleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("destinationrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested destinationRules. +func (c *destinationRules) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("destinationrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a destinationRule and creates it. Returns the server's representation of the destinationRule, and an error, if there is any. +func (c *destinationRules) Create(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.CreateOptions) (result *v1.DestinationRule, err error) { + result = &v1.DestinationRule{} + err = c.client.Post(). + Namespace(c.ns). + Resource("destinationrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(destinationRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a destinationRule and updates it. Returns the server's representation of the destinationRule, and an error, if there is any. +func (c *destinationRules) Update(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.UpdateOptions) (result *v1.DestinationRule, err error) { + result = &v1.DestinationRule{} + err = c.client.Put(). + Namespace(c.ns). + Resource("destinationrules"). + Name(destinationRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(destinationRule). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *destinationRules) UpdateStatus(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.UpdateOptions) (result *v1.DestinationRule, err error) { + result = &v1.DestinationRule{} + err = c.client.Put(). + Namespace(c.ns). + Resource("destinationrules"). + Name(destinationRule.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(destinationRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the destinationRule and deletes it. Returns an error if one occurs. +func (c *destinationRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("destinationrules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *destinationRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("destinationrules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched destinationRule. +func (c *destinationRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DestinationRule, err error) { + result = &v1.DestinationRule{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("destinationrules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied destinationRule. +func (c *destinationRules) Apply(ctx context.Context, destinationRule *networkingv1.DestinationRuleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DestinationRule, err error) { + if destinationRule == nil { + return nil, fmt.Errorf("destinationRule provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(destinationRule) + if err != nil { + return nil, err + } + name := destinationRule.Name + if name == nil { + return nil, fmt.Errorf("destinationRule.Name must be provided to Apply") + } + result = &v1.DestinationRule{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("destinationrules"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *destinationRules) ApplyStatus(ctx context.Context, destinationRule *networkingv1.DestinationRuleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DestinationRule, err error) { + if destinationRule == nil { + return nil, fmt.Errorf("destinationRule provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(destinationRule) + if err != nil { + return nil, err + } + + name := destinationRule.Name + if name == nil { + return nil, fmt.Errorf("destinationRule.Name must be provided to Apply") + } + + result = &v1.DestinationRule{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("destinationrules"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/networking/v1/doc.go b/pkg/clientset/versioned/typed/networking/v1/doc.go new file mode 100644 index 000000000..558d0b55b --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/doc.go @@ -0,0 +1,18 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/pkg/clientset/versioned/typed/networking/v1/fake/doc.go b/pkg/clientset/versioned/typed/networking/v1/fake/doc.go new file mode 100644 index 000000000..e6cc3d6fd --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/fake/doc.go @@ -0,0 +1,18 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/clientset/versioned/typed/networking/v1/fake/fake_destinationrule.gen.go b/pkg/clientset/versioned/typed/networking/v1/fake/fake_destinationrule.gen.go new file mode 100644 index 000000000..66660f15c --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/fake/fake_destinationrule.gen.go @@ -0,0 +1,187 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeDestinationRules implements DestinationRuleInterface +type FakeDestinationRules struct { + Fake *FakeNetworkingV1 + ns string +} + +var destinationrulesResource = v1.SchemeGroupVersion.WithResource("destinationrules") + +var destinationrulesKind = v1.SchemeGroupVersion.WithKind("DestinationRule") + +// Get takes name of the destinationRule, and returns the corresponding destinationRule object, and an error if there is any. +func (c *FakeDestinationRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DestinationRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(destinationrulesResource, c.ns, name), &v1.DestinationRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.DestinationRule), err +} + +// List takes label and field selectors, and returns the list of DestinationRules that match those selectors. +func (c *FakeDestinationRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DestinationRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(destinationrulesResource, destinationrulesKind, c.ns, opts), &v1.DestinationRuleList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.DestinationRuleList{ListMeta: obj.(*v1.DestinationRuleList).ListMeta} + for _, item := range obj.(*v1.DestinationRuleList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested destinationRules. +func (c *FakeDestinationRules) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(destinationrulesResource, c.ns, opts)) + +} + +// Create takes the representation of a destinationRule and creates it. Returns the server's representation of the destinationRule, and an error, if there is any. +func (c *FakeDestinationRules) Create(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.CreateOptions) (result *v1.DestinationRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(destinationrulesResource, c.ns, destinationRule), &v1.DestinationRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.DestinationRule), err +} + +// Update takes the representation of a destinationRule and updates it. Returns the server's representation of the destinationRule, and an error, if there is any. +func (c *FakeDestinationRules) Update(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.UpdateOptions) (result *v1.DestinationRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(destinationrulesResource, c.ns, destinationRule), &v1.DestinationRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.DestinationRule), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeDestinationRules) UpdateStatus(ctx context.Context, destinationRule *v1.DestinationRule, opts metav1.UpdateOptions) (*v1.DestinationRule, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(destinationrulesResource, "status", c.ns, destinationRule), &v1.DestinationRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.DestinationRule), err +} + +// Delete takes name of the destinationRule and deletes it. Returns an error if one occurs. +func (c *FakeDestinationRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(destinationrulesResource, c.ns, name, opts), &v1.DestinationRule{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDestinationRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(destinationrulesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.DestinationRuleList{}) + return err +} + +// Patch applies the patch and returns the patched destinationRule. +func (c *FakeDestinationRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DestinationRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(destinationrulesResource, c.ns, name, pt, data, subresources...), &v1.DestinationRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.DestinationRule), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied destinationRule. +func (c *FakeDestinationRules) Apply(ctx context.Context, destinationRule *networkingv1.DestinationRuleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DestinationRule, err error) { + if destinationRule == nil { + return nil, fmt.Errorf("destinationRule provided to Apply must not be nil") + } + data, err := json.Marshal(destinationRule) + if err != nil { + return nil, err + } + name := destinationRule.Name + if name == nil { + return nil, fmt.Errorf("destinationRule.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(destinationrulesResource, c.ns, *name, types.ApplyPatchType, data), &v1.DestinationRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.DestinationRule), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeDestinationRules) ApplyStatus(ctx context.Context, destinationRule *networkingv1.DestinationRuleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DestinationRule, err error) { + if destinationRule == nil { + return nil, fmt.Errorf("destinationRule provided to Apply must not be nil") + } + data, err := json.Marshal(destinationRule) + if err != nil { + return nil, err + } + name := destinationRule.Name + if name == nil { + return nil, fmt.Errorf("destinationRule.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(destinationrulesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.DestinationRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.DestinationRule), err +} diff --git a/pkg/clientset/versioned/typed/networking/v1/fake/fake_gateway.gen.go b/pkg/clientset/versioned/typed/networking/v1/fake/fake_gateway.gen.go new file mode 100644 index 000000000..3500daaff --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/fake/fake_gateway.gen.go @@ -0,0 +1,187 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGateways implements GatewayInterface +type FakeGateways struct { + Fake *FakeNetworkingV1 + ns string +} + +var gatewaysResource = v1.SchemeGroupVersion.WithResource("gateways") + +var gatewaysKind = v1.SchemeGroupVersion.WithKind("Gateway") + +// Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. +func (c *FakeGateways) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Gateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(gatewaysResource, c.ns, name), &v1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Gateway), err +} + +// List takes label and field selectors, and returns the list of Gateways that match those selectors. +func (c *FakeGateways) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(gatewaysResource, gatewaysKind, c.ns, opts), &v1.GatewayList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.GatewayList{ListMeta: obj.(*v1.GatewayList).ListMeta} + for _, item := range obj.(*v1.GatewayList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested gateways. +func (c *FakeGateways) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(gatewaysResource, c.ns, opts)) + +} + +// Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. +func (c *FakeGateways) Create(ctx context.Context, gateway *v1.Gateway, opts metav1.CreateOptions) (result *v1.Gateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(gatewaysResource, c.ns, gateway), &v1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Gateway), err +} + +// Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. +func (c *FakeGateways) Update(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (result *v1.Gateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(gatewaysResource, c.ns, gateway), &v1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Gateway), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeGateways) UpdateStatus(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (*v1.Gateway, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(gatewaysResource, "status", c.ns, gateway), &v1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Gateway), err +} + +// Delete takes name of the gateway and deletes it. Returns an error if one occurs. +func (c *FakeGateways) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(gatewaysResource, c.ns, name, opts), &v1.Gateway{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGateways) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(gatewaysResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.GatewayList{}) + return err +} + +// Patch applies the patch and returns the patched gateway. +func (c *FakeGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, name, pt, data, subresources...), &v1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Gateway), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied gateway. +func (c *FakeGateways) Apply(ctx context.Context, gateway *networkingv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data), &v1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Gateway), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeGateways) ApplyStatus(ctx context.Context, gateway *networkingv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Gateway), err +} diff --git a/pkg/clientset/versioned/typed/networking/v1/fake/fake_networking_client.gen.go b/pkg/clientset/versioned/typed/networking/v1/fake/fake_networking_client.gen.go new file mode 100644 index 000000000..a2033f10a --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/fake/fake_networking_client.gen.go @@ -0,0 +1,62 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "istio.io/client-go/pkg/clientset/versioned/typed/networking/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeNetworkingV1 struct { + *testing.Fake +} + +func (c *FakeNetworkingV1) DestinationRules(namespace string) v1.DestinationRuleInterface { + return &FakeDestinationRules{c, namespace} +} + +func (c *FakeNetworkingV1) Gateways(namespace string) v1.GatewayInterface { + return &FakeGateways{c, namespace} +} + +func (c *FakeNetworkingV1) ServiceEntries(namespace string) v1.ServiceEntryInterface { + return &FakeServiceEntries{c, namespace} +} + +func (c *FakeNetworkingV1) Sidecars(namespace string) v1.SidecarInterface { + return &FakeSidecars{c, namespace} +} + +func (c *FakeNetworkingV1) VirtualServices(namespace string) v1.VirtualServiceInterface { + return &FakeVirtualServices{c, namespace} +} + +func (c *FakeNetworkingV1) WorkloadEntries(namespace string) v1.WorkloadEntryInterface { + return &FakeWorkloadEntries{c, namespace} +} + +func (c *FakeNetworkingV1) WorkloadGroups(namespace string) v1.WorkloadGroupInterface { + return &FakeWorkloadGroups{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeNetworkingV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/clientset/versioned/typed/networking/v1/fake/fake_serviceentry.gen.go b/pkg/clientset/versioned/typed/networking/v1/fake/fake_serviceentry.gen.go new file mode 100644 index 000000000..d97e87d2f --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/fake/fake_serviceentry.gen.go @@ -0,0 +1,187 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeServiceEntries implements ServiceEntryInterface +type FakeServiceEntries struct { + Fake *FakeNetworkingV1 + ns string +} + +var serviceentriesResource = v1.SchemeGroupVersion.WithResource("serviceentries") + +var serviceentriesKind = v1.SchemeGroupVersion.WithKind("ServiceEntry") + +// Get takes name of the serviceEntry, and returns the corresponding serviceEntry object, and an error if there is any. +func (c *FakeServiceEntries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(serviceentriesResource, c.ns, name), &v1.ServiceEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceEntry), err +} + +// List takes label and field selectors, and returns the list of ServiceEntries that match those selectors. +func (c *FakeServiceEntries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceEntryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(serviceentriesResource, serviceentriesKind, c.ns, opts), &v1.ServiceEntryList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.ServiceEntryList{ListMeta: obj.(*v1.ServiceEntryList).ListMeta} + for _, item := range obj.(*v1.ServiceEntryList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested serviceEntries. +func (c *FakeServiceEntries) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(serviceentriesResource, c.ns, opts)) + +} + +// Create takes the representation of a serviceEntry and creates it. Returns the server's representation of the serviceEntry, and an error, if there is any. +func (c *FakeServiceEntries) Create(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.CreateOptions) (result *v1.ServiceEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(serviceentriesResource, c.ns, serviceEntry), &v1.ServiceEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceEntry), err +} + +// Update takes the representation of a serviceEntry and updates it. Returns the server's representation of the serviceEntry, and an error, if there is any. +func (c *FakeServiceEntries) Update(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.UpdateOptions) (result *v1.ServiceEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(serviceentriesResource, c.ns, serviceEntry), &v1.ServiceEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceEntry), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeServiceEntries) UpdateStatus(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.UpdateOptions) (*v1.ServiceEntry, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(serviceentriesResource, "status", c.ns, serviceEntry), &v1.ServiceEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceEntry), err +} + +// Delete takes name of the serviceEntry and deletes it. Returns an error if one occurs. +func (c *FakeServiceEntries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(serviceentriesResource, c.ns, name, opts), &v1.ServiceEntry{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceEntries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(serviceentriesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.ServiceEntryList{}) + return err +} + +// Patch applies the patch and returns the patched serviceEntry. +func (c *FakeServiceEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(serviceentriesResource, c.ns, name, pt, data, subresources...), &v1.ServiceEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceEntry), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied serviceEntry. +func (c *FakeServiceEntries) Apply(ctx context.Context, serviceEntry *networkingv1.ServiceEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceEntry, err error) { + if serviceEntry == nil { + return nil, fmt.Errorf("serviceEntry provided to Apply must not be nil") + } + data, err := json.Marshal(serviceEntry) + if err != nil { + return nil, err + } + name := serviceEntry.Name + if name == nil { + return nil, fmt.Errorf("serviceEntry.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(serviceentriesResource, c.ns, *name, types.ApplyPatchType, data), &v1.ServiceEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceEntry), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeServiceEntries) ApplyStatus(ctx context.Context, serviceEntry *networkingv1.ServiceEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceEntry, err error) { + if serviceEntry == nil { + return nil, fmt.Errorf("serviceEntry provided to Apply must not be nil") + } + data, err := json.Marshal(serviceEntry) + if err != nil { + return nil, err + } + name := serviceEntry.Name + if name == nil { + return nil, fmt.Errorf("serviceEntry.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(serviceentriesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.ServiceEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceEntry), err +} diff --git a/pkg/clientset/versioned/typed/networking/v1/fake/fake_sidecar.gen.go b/pkg/clientset/versioned/typed/networking/v1/fake/fake_sidecar.gen.go new file mode 100644 index 000000000..1353be483 --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/fake/fake_sidecar.gen.go @@ -0,0 +1,187 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSidecars implements SidecarInterface +type FakeSidecars struct { + Fake *FakeNetworkingV1 + ns string +} + +var sidecarsResource = v1.SchemeGroupVersion.WithResource("sidecars") + +var sidecarsKind = v1.SchemeGroupVersion.WithKind("Sidecar") + +// Get takes name of the sidecar, and returns the corresponding sidecar object, and an error if there is any. +func (c *FakeSidecars) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Sidecar, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sidecarsResource, c.ns, name), &v1.Sidecar{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Sidecar), err +} + +// List takes label and field selectors, and returns the list of Sidecars that match those selectors. +func (c *FakeSidecars) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SidecarList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sidecarsResource, sidecarsKind, c.ns, opts), &v1.SidecarList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.SidecarList{ListMeta: obj.(*v1.SidecarList).ListMeta} + for _, item := range obj.(*v1.SidecarList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested sidecars. +func (c *FakeSidecars) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sidecarsResource, c.ns, opts)) + +} + +// Create takes the representation of a sidecar and creates it. Returns the server's representation of the sidecar, and an error, if there is any. +func (c *FakeSidecars) Create(ctx context.Context, sidecar *v1.Sidecar, opts metav1.CreateOptions) (result *v1.Sidecar, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sidecarsResource, c.ns, sidecar), &v1.Sidecar{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Sidecar), err +} + +// Update takes the representation of a sidecar and updates it. Returns the server's representation of the sidecar, and an error, if there is any. +func (c *FakeSidecars) Update(ctx context.Context, sidecar *v1.Sidecar, opts metav1.UpdateOptions) (result *v1.Sidecar, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sidecarsResource, c.ns, sidecar), &v1.Sidecar{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Sidecar), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeSidecars) UpdateStatus(ctx context.Context, sidecar *v1.Sidecar, opts metav1.UpdateOptions) (*v1.Sidecar, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(sidecarsResource, "status", c.ns, sidecar), &v1.Sidecar{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Sidecar), err +} + +// Delete takes name of the sidecar and deletes it. Returns an error if one occurs. +func (c *FakeSidecars) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(sidecarsResource, c.ns, name, opts), &v1.Sidecar{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSidecars) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sidecarsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.SidecarList{}) + return err +} + +// Patch applies the patch and returns the patched sidecar. +func (c *FakeSidecars) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Sidecar, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sidecarsResource, c.ns, name, pt, data, subresources...), &v1.Sidecar{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Sidecar), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied sidecar. +func (c *FakeSidecars) Apply(ctx context.Context, sidecar *networkingv1.SidecarApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Sidecar, err error) { + if sidecar == nil { + return nil, fmt.Errorf("sidecar provided to Apply must not be nil") + } + data, err := json.Marshal(sidecar) + if err != nil { + return nil, err + } + name := sidecar.Name + if name == nil { + return nil, fmt.Errorf("sidecar.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sidecarsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Sidecar{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Sidecar), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeSidecars) ApplyStatus(ctx context.Context, sidecar *networkingv1.SidecarApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Sidecar, err error) { + if sidecar == nil { + return nil, fmt.Errorf("sidecar provided to Apply must not be nil") + } + data, err := json.Marshal(sidecar) + if err != nil { + return nil, err + } + name := sidecar.Name + if name == nil { + return nil, fmt.Errorf("sidecar.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sidecarsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Sidecar{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Sidecar), err +} diff --git a/pkg/clientset/versioned/typed/networking/v1/fake/fake_virtualservice.gen.go b/pkg/clientset/versioned/typed/networking/v1/fake/fake_virtualservice.gen.go new file mode 100644 index 000000000..75c26f77c --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/fake/fake_virtualservice.gen.go @@ -0,0 +1,187 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVirtualServices implements VirtualServiceInterface +type FakeVirtualServices struct { + Fake *FakeNetworkingV1 + ns string +} + +var virtualservicesResource = v1.SchemeGroupVersion.WithResource("virtualservices") + +var virtualservicesKind = v1.SchemeGroupVersion.WithKind("VirtualService") + +// Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any. +func (c *FakeVirtualServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualservicesResource, c.ns, name), &v1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VirtualService), err +} + +// List takes label and field selectors, and returns the list of VirtualServices that match those selectors. +func (c *FakeVirtualServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualServiceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualservicesResource, virtualservicesKind, c.ns, opts), &v1.VirtualServiceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.VirtualServiceList{ListMeta: obj.(*v1.VirtualServiceList).ListMeta} + for _, item := range obj.(*v1.VirtualServiceList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested virtualServices. +func (c *FakeVirtualServices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualservicesResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *FakeVirtualServices) Create(ctx context.Context, virtualService *v1.VirtualService, opts metav1.CreateOptions) (result *v1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualservicesResource, c.ns, virtualService), &v1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VirtualService), err +} + +// Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *FakeVirtualServices) Update(ctx context.Context, virtualService *v1.VirtualService, opts metav1.UpdateOptions) (result *v1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualservicesResource, c.ns, virtualService), &v1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VirtualService), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualServices) UpdateStatus(ctx context.Context, virtualService *v1.VirtualService, opts metav1.UpdateOptions) (*v1.VirtualService, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualservicesResource, "status", c.ns, virtualService), &v1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VirtualService), err +} + +// Delete takes name of the virtualService and deletes it. Returns an error if one occurs. +func (c *FakeVirtualServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualservicesResource, c.ns, name, opts), &v1.VirtualService{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualServices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualservicesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.VirtualServiceList{}) + return err +} + +// Patch applies the patch and returns the patched virtualService. +func (c *FakeVirtualServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualservicesResource, c.ns, name, pt, data, subresources...), &v1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VirtualService), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied virtualService. +func (c *FakeVirtualServices) Apply(ctx context.Context, virtualService *networkingv1.VirtualServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VirtualService, err error) { + if virtualService == nil { + return nil, fmt.Errorf("virtualService provided to Apply must not be nil") + } + data, err := json.Marshal(virtualService) + if err != nil { + return nil, err + } + name := virtualService.Name + if name == nil { + return nil, fmt.Errorf("virtualService.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualservicesResource, c.ns, *name, types.ApplyPatchType, data), &v1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VirtualService), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeVirtualServices) ApplyStatus(ctx context.Context, virtualService *networkingv1.VirtualServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VirtualService, err error) { + if virtualService == nil { + return nil, fmt.Errorf("virtualService provided to Apply must not be nil") + } + data, err := json.Marshal(virtualService) + if err != nil { + return nil, err + } + name := virtualService.Name + if name == nil { + return nil, fmt.Errorf("virtualService.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualservicesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VirtualService), err +} diff --git a/pkg/clientset/versioned/typed/networking/v1/fake/fake_workloadentry.gen.go b/pkg/clientset/versioned/typed/networking/v1/fake/fake_workloadentry.gen.go new file mode 100644 index 000000000..a249d4656 --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/fake/fake_workloadentry.gen.go @@ -0,0 +1,187 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeWorkloadEntries implements WorkloadEntryInterface +type FakeWorkloadEntries struct { + Fake *FakeNetworkingV1 + ns string +} + +var workloadentriesResource = v1.SchemeGroupVersion.WithResource("workloadentries") + +var workloadentriesKind = v1.SchemeGroupVersion.WithKind("WorkloadEntry") + +// Get takes name of the workloadEntry, and returns the corresponding workloadEntry object, and an error if there is any. +func (c *FakeWorkloadEntries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.WorkloadEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(workloadentriesResource, c.ns, name), &v1.WorkloadEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadEntry), err +} + +// List takes label and field selectors, and returns the list of WorkloadEntries that match those selectors. +func (c *FakeWorkloadEntries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.WorkloadEntryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(workloadentriesResource, workloadentriesKind, c.ns, opts), &v1.WorkloadEntryList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.WorkloadEntryList{ListMeta: obj.(*v1.WorkloadEntryList).ListMeta} + for _, item := range obj.(*v1.WorkloadEntryList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested workloadEntries. +func (c *FakeWorkloadEntries) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(workloadentriesResource, c.ns, opts)) + +} + +// Create takes the representation of a workloadEntry and creates it. Returns the server's representation of the workloadEntry, and an error, if there is any. +func (c *FakeWorkloadEntries) Create(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.CreateOptions) (result *v1.WorkloadEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(workloadentriesResource, c.ns, workloadEntry), &v1.WorkloadEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadEntry), err +} + +// Update takes the representation of a workloadEntry and updates it. Returns the server's representation of the workloadEntry, and an error, if there is any. +func (c *FakeWorkloadEntries) Update(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.UpdateOptions) (result *v1.WorkloadEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(workloadentriesResource, c.ns, workloadEntry), &v1.WorkloadEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadEntry), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeWorkloadEntries) UpdateStatus(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.UpdateOptions) (*v1.WorkloadEntry, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(workloadentriesResource, "status", c.ns, workloadEntry), &v1.WorkloadEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadEntry), err +} + +// Delete takes name of the workloadEntry and deletes it. Returns an error if one occurs. +func (c *FakeWorkloadEntries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(workloadentriesResource, c.ns, name, opts), &v1.WorkloadEntry{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeWorkloadEntries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(workloadentriesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.WorkloadEntryList{}) + return err +} + +// Patch applies the patch and returns the patched workloadEntry. +func (c *FakeWorkloadEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.WorkloadEntry, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(workloadentriesResource, c.ns, name, pt, data, subresources...), &v1.WorkloadEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadEntry), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied workloadEntry. +func (c *FakeWorkloadEntries) Apply(ctx context.Context, workloadEntry *networkingv1.WorkloadEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadEntry, err error) { + if workloadEntry == nil { + return nil, fmt.Errorf("workloadEntry provided to Apply must not be nil") + } + data, err := json.Marshal(workloadEntry) + if err != nil { + return nil, err + } + name := workloadEntry.Name + if name == nil { + return nil, fmt.Errorf("workloadEntry.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(workloadentriesResource, c.ns, *name, types.ApplyPatchType, data), &v1.WorkloadEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadEntry), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeWorkloadEntries) ApplyStatus(ctx context.Context, workloadEntry *networkingv1.WorkloadEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadEntry, err error) { + if workloadEntry == nil { + return nil, fmt.Errorf("workloadEntry provided to Apply must not be nil") + } + data, err := json.Marshal(workloadEntry) + if err != nil { + return nil, err + } + name := workloadEntry.Name + if name == nil { + return nil, fmt.Errorf("workloadEntry.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(workloadentriesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.WorkloadEntry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadEntry), err +} diff --git a/pkg/clientset/versioned/typed/networking/v1/fake/fake_workloadgroup.gen.go b/pkg/clientset/versioned/typed/networking/v1/fake/fake_workloadgroup.gen.go new file mode 100644 index 000000000..29b116799 --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/fake/fake_workloadgroup.gen.go @@ -0,0 +1,187 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeWorkloadGroups implements WorkloadGroupInterface +type FakeWorkloadGroups struct { + Fake *FakeNetworkingV1 + ns string +} + +var workloadgroupsResource = v1.SchemeGroupVersion.WithResource("workloadgroups") + +var workloadgroupsKind = v1.SchemeGroupVersion.WithKind("WorkloadGroup") + +// Get takes name of the workloadGroup, and returns the corresponding workloadGroup object, and an error if there is any. +func (c *FakeWorkloadGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.WorkloadGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(workloadgroupsResource, c.ns, name), &v1.WorkloadGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadGroup), err +} + +// List takes label and field selectors, and returns the list of WorkloadGroups that match those selectors. +func (c *FakeWorkloadGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.WorkloadGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(workloadgroupsResource, workloadgroupsKind, c.ns, opts), &v1.WorkloadGroupList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.WorkloadGroupList{ListMeta: obj.(*v1.WorkloadGroupList).ListMeta} + for _, item := range obj.(*v1.WorkloadGroupList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested workloadGroups. +func (c *FakeWorkloadGroups) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(workloadgroupsResource, c.ns, opts)) + +} + +// Create takes the representation of a workloadGroup and creates it. Returns the server's representation of the workloadGroup, and an error, if there is any. +func (c *FakeWorkloadGroups) Create(ctx context.Context, workloadGroup *v1.WorkloadGroup, opts metav1.CreateOptions) (result *v1.WorkloadGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(workloadgroupsResource, c.ns, workloadGroup), &v1.WorkloadGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadGroup), err +} + +// Update takes the representation of a workloadGroup and updates it. Returns the server's representation of the workloadGroup, and an error, if there is any. +func (c *FakeWorkloadGroups) Update(ctx context.Context, workloadGroup *v1.WorkloadGroup, opts metav1.UpdateOptions) (result *v1.WorkloadGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(workloadgroupsResource, c.ns, workloadGroup), &v1.WorkloadGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadGroup), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeWorkloadGroups) UpdateStatus(ctx context.Context, workloadGroup *v1.WorkloadGroup, opts metav1.UpdateOptions) (*v1.WorkloadGroup, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(workloadgroupsResource, "status", c.ns, workloadGroup), &v1.WorkloadGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadGroup), err +} + +// Delete takes name of the workloadGroup and deletes it. Returns an error if one occurs. +func (c *FakeWorkloadGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(workloadgroupsResource, c.ns, name, opts), &v1.WorkloadGroup{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeWorkloadGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(workloadgroupsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.WorkloadGroupList{}) + return err +} + +// Patch applies the patch and returns the patched workloadGroup. +func (c *FakeWorkloadGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.WorkloadGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(workloadgroupsResource, c.ns, name, pt, data, subresources...), &v1.WorkloadGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadGroup), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied workloadGroup. +func (c *FakeWorkloadGroups) Apply(ctx context.Context, workloadGroup *networkingv1.WorkloadGroupApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadGroup, err error) { + if workloadGroup == nil { + return nil, fmt.Errorf("workloadGroup provided to Apply must not be nil") + } + data, err := json.Marshal(workloadGroup) + if err != nil { + return nil, err + } + name := workloadGroup.Name + if name == nil { + return nil, fmt.Errorf("workloadGroup.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(workloadgroupsResource, c.ns, *name, types.ApplyPatchType, data), &v1.WorkloadGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadGroup), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeWorkloadGroups) ApplyStatus(ctx context.Context, workloadGroup *networkingv1.WorkloadGroupApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadGroup, err error) { + if workloadGroup == nil { + return nil, fmt.Errorf("workloadGroup provided to Apply must not be nil") + } + data, err := json.Marshal(workloadGroup) + if err != nil { + return nil, err + } + name := workloadGroup.Name + if name == nil { + return nil, fmt.Errorf("workloadGroup.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(workloadgroupsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.WorkloadGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.WorkloadGroup), err +} diff --git a/pkg/clientset/versioned/typed/networking/v1/gateway.gen.go b/pkg/clientset/versioned/typed/networking/v1/gateway.gen.go new file mode 100644 index 000000000..83e8815a8 --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/gateway.gen.go @@ -0,0 +1,254 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + scheme "istio.io/client-go/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// GatewaysGetter has a method to return a GatewayInterface. +// A group's client should implement this interface. +type GatewaysGetter interface { + Gateways(namespace string) GatewayInterface +} + +// GatewayInterface has methods to work with Gateway resources. +type GatewayInterface interface { + Create(ctx context.Context, gateway *v1.Gateway, opts metav1.CreateOptions) (*v1.Gateway, error) + Update(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (*v1.Gateway, error) + UpdateStatus(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (*v1.Gateway, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Gateway, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GatewayList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gateway, err error) + Apply(ctx context.Context, gateway *networkingv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) + ApplyStatus(ctx context.Context, gateway *networkingv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) + GatewayExpansion +} + +// gateways implements GatewayInterface +type gateways struct { + client rest.Interface + ns string +} + +// newGateways returns a Gateways +func newGateways(c *NetworkingV1Client, namespace string) *gateways { + return &gateways{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. +func (c *gateways) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Gateway, err error) { + result = &v1.Gateway{} + err = c.client.Get(). + Namespace(c.ns). + Resource("gateways"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Gateways that match those selectors. +func (c *gateways) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GatewayList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("gateways"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gateways. +func (c *gateways) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("gateways"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. +func (c *gateways) Create(ctx context.Context, gateway *v1.Gateway, opts metav1.CreateOptions) (result *v1.Gateway, err error) { + result = &v1.Gateway{} + err = c.client.Post(). + Namespace(c.ns). + Resource("gateways"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gateway). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. +func (c *gateways) Update(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (result *v1.Gateway, err error) { + result = &v1.Gateway{} + err = c.client.Put(). + Namespace(c.ns). + Resource("gateways"). + Name(gateway.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gateway). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *gateways) UpdateStatus(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (result *v1.Gateway, err error) { + result = &v1.Gateway{} + err = c.client.Put(). + Namespace(c.ns). + Resource("gateways"). + Name(gateway.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gateway). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gateway and deletes it. Returns an error if one occurs. +func (c *gateways) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("gateways"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gateways) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("gateways"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gateway. +func (c *gateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gateway, err error) { + result = &v1.Gateway{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("gateways"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied gateway. +func (c *gateways) Apply(ctx context.Context, gateway *networkingv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + result = &v1.Gateway{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gateways"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *gateways) ApplyStatus(ctx context.Context, gateway *networkingv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + + result = &v1.Gateway{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gateways"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/networking/v1/generated_expansion.gen.go b/pkg/clientset/versioned/typed/networking/v1/generated_expansion.gen.go new file mode 100644 index 000000000..3d4ff135f --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/generated_expansion.gen.go @@ -0,0 +1,31 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +type DestinationRuleExpansion interface{} + +type GatewayExpansion interface{} + +type ServiceEntryExpansion interface{} + +type SidecarExpansion interface{} + +type VirtualServiceExpansion interface{} + +type WorkloadEntryExpansion interface{} + +type WorkloadGroupExpansion interface{} diff --git a/pkg/clientset/versioned/typed/networking/v1/networking_client.gen.go b/pkg/clientset/versioned/typed/networking/v1/networking_client.gen.go new file mode 100644 index 000000000..37723b383 --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/networking_client.gen.go @@ -0,0 +1,135 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + "istio.io/client-go/pkg/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type NetworkingV1Interface interface { + RESTClient() rest.Interface + DestinationRulesGetter + GatewaysGetter + ServiceEntriesGetter + SidecarsGetter + VirtualServicesGetter + WorkloadEntriesGetter + WorkloadGroupsGetter +} + +// NetworkingV1Client is used to interact with features provided by the networking.istio.io group. +type NetworkingV1Client struct { + restClient rest.Interface +} + +func (c *NetworkingV1Client) DestinationRules(namespace string) DestinationRuleInterface { + return newDestinationRules(c, namespace) +} + +func (c *NetworkingV1Client) Gateways(namespace string) GatewayInterface { + return newGateways(c, namespace) +} + +func (c *NetworkingV1Client) ServiceEntries(namespace string) ServiceEntryInterface { + return newServiceEntries(c, namespace) +} + +func (c *NetworkingV1Client) Sidecars(namespace string) SidecarInterface { + return newSidecars(c, namespace) +} + +func (c *NetworkingV1Client) VirtualServices(namespace string) VirtualServiceInterface { + return newVirtualServices(c, namespace) +} + +func (c *NetworkingV1Client) WorkloadEntries(namespace string) WorkloadEntryInterface { + return newWorkloadEntries(c, namespace) +} + +func (c *NetworkingV1Client) WorkloadGroups(namespace string) WorkloadGroupInterface { + return newWorkloadGroups(c, namespace) +} + +// NewForConfig creates a new NetworkingV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*NetworkingV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new NetworkingV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &NetworkingV1Client{client}, nil +} + +// NewForConfigOrDie creates a new NetworkingV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *NetworkingV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new NetworkingV1Client for the given RESTClient. +func New(c rest.Interface) *NetworkingV1Client { + return &NetworkingV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *NetworkingV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/clientset/versioned/typed/networking/v1/serviceentry.gen.go b/pkg/clientset/versioned/typed/networking/v1/serviceentry.gen.go new file mode 100644 index 000000000..36ea2d96f --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/serviceentry.gen.go @@ -0,0 +1,254 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + scheme "istio.io/client-go/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ServiceEntriesGetter has a method to return a ServiceEntryInterface. +// A group's client should implement this interface. +type ServiceEntriesGetter interface { + ServiceEntries(namespace string) ServiceEntryInterface +} + +// ServiceEntryInterface has methods to work with ServiceEntry resources. +type ServiceEntryInterface interface { + Create(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.CreateOptions) (*v1.ServiceEntry, error) + Update(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.UpdateOptions) (*v1.ServiceEntry, error) + UpdateStatus(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.UpdateOptions) (*v1.ServiceEntry, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceEntry, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceEntryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceEntry, err error) + Apply(ctx context.Context, serviceEntry *networkingv1.ServiceEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceEntry, err error) + ApplyStatus(ctx context.Context, serviceEntry *networkingv1.ServiceEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceEntry, err error) + ServiceEntryExpansion +} + +// serviceEntries implements ServiceEntryInterface +type serviceEntries struct { + client rest.Interface + ns string +} + +// newServiceEntries returns a ServiceEntries +func newServiceEntries(c *NetworkingV1Client, namespace string) *serviceEntries { + return &serviceEntries{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the serviceEntry, and returns the corresponding serviceEntry object, and an error if there is any. +func (c *serviceEntries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceEntry, err error) { + result = &v1.ServiceEntry{} + err = c.client.Get(). + Namespace(c.ns). + Resource("serviceentries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceEntries that match those selectors. +func (c *serviceEntries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceEntryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceEntryList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("serviceentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceEntries. +func (c *serviceEntries) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("serviceentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceEntry and creates it. Returns the server's representation of the serviceEntry, and an error, if there is any. +func (c *serviceEntries) Create(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.CreateOptions) (result *v1.ServiceEntry, err error) { + result = &v1.ServiceEntry{} + err = c.client.Post(). + Namespace(c.ns). + Resource("serviceentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceEntry). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceEntry and updates it. Returns the server's representation of the serviceEntry, and an error, if there is any. +func (c *serviceEntries) Update(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.UpdateOptions) (result *v1.ServiceEntry, err error) { + result = &v1.ServiceEntry{} + err = c.client.Put(). + Namespace(c.ns). + Resource("serviceentries"). + Name(serviceEntry.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceEntry). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *serviceEntries) UpdateStatus(ctx context.Context, serviceEntry *v1.ServiceEntry, opts metav1.UpdateOptions) (result *v1.ServiceEntry, err error) { + result = &v1.ServiceEntry{} + err = c.client.Put(). + Namespace(c.ns). + Resource("serviceentries"). + Name(serviceEntry.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceEntry). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceEntry and deletes it. Returns an error if one occurs. +func (c *serviceEntries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("serviceentries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceEntries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("serviceentries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceEntry. +func (c *serviceEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceEntry, err error) { + result = &v1.ServiceEntry{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("serviceentries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied serviceEntry. +func (c *serviceEntries) Apply(ctx context.Context, serviceEntry *networkingv1.ServiceEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceEntry, err error) { + if serviceEntry == nil { + return nil, fmt.Errorf("serviceEntry provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(serviceEntry) + if err != nil { + return nil, err + } + name := serviceEntry.Name + if name == nil { + return nil, fmt.Errorf("serviceEntry.Name must be provided to Apply") + } + result = &v1.ServiceEntry{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("serviceentries"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *serviceEntries) ApplyStatus(ctx context.Context, serviceEntry *networkingv1.ServiceEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceEntry, err error) { + if serviceEntry == nil { + return nil, fmt.Errorf("serviceEntry provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(serviceEntry) + if err != nil { + return nil, err + } + + name := serviceEntry.Name + if name == nil { + return nil, fmt.Errorf("serviceEntry.Name must be provided to Apply") + } + + result = &v1.ServiceEntry{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("serviceentries"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/networking/v1/sidecar.gen.go b/pkg/clientset/versioned/typed/networking/v1/sidecar.gen.go new file mode 100644 index 000000000..ddb0886e2 --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/sidecar.gen.go @@ -0,0 +1,254 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + scheme "istio.io/client-go/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// SidecarsGetter has a method to return a SidecarInterface. +// A group's client should implement this interface. +type SidecarsGetter interface { + Sidecars(namespace string) SidecarInterface +} + +// SidecarInterface has methods to work with Sidecar resources. +type SidecarInterface interface { + Create(ctx context.Context, sidecar *v1.Sidecar, opts metav1.CreateOptions) (*v1.Sidecar, error) + Update(ctx context.Context, sidecar *v1.Sidecar, opts metav1.UpdateOptions) (*v1.Sidecar, error) + UpdateStatus(ctx context.Context, sidecar *v1.Sidecar, opts metav1.UpdateOptions) (*v1.Sidecar, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Sidecar, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SidecarList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Sidecar, err error) + Apply(ctx context.Context, sidecar *networkingv1.SidecarApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Sidecar, err error) + ApplyStatus(ctx context.Context, sidecar *networkingv1.SidecarApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Sidecar, err error) + SidecarExpansion +} + +// sidecars implements SidecarInterface +type sidecars struct { + client rest.Interface + ns string +} + +// newSidecars returns a Sidecars +func newSidecars(c *NetworkingV1Client, namespace string) *sidecars { + return &sidecars{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the sidecar, and returns the corresponding sidecar object, and an error if there is any. +func (c *sidecars) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Sidecar, err error) { + result = &v1.Sidecar{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sidecars"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Sidecars that match those selectors. +func (c *sidecars) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SidecarList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SidecarList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sidecars"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sidecars. +func (c *sidecars) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sidecars"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a sidecar and creates it. Returns the server's representation of the sidecar, and an error, if there is any. +func (c *sidecars) Create(ctx context.Context, sidecar *v1.Sidecar, opts metav1.CreateOptions) (result *v1.Sidecar, err error) { + result = &v1.Sidecar{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sidecars"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sidecar). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a sidecar and updates it. Returns the server's representation of the sidecar, and an error, if there is any. +func (c *sidecars) Update(ctx context.Context, sidecar *v1.Sidecar, opts metav1.UpdateOptions) (result *v1.Sidecar, err error) { + result = &v1.Sidecar{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sidecars"). + Name(sidecar.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sidecar). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *sidecars) UpdateStatus(ctx context.Context, sidecar *v1.Sidecar, opts metav1.UpdateOptions) (result *v1.Sidecar, err error) { + result = &v1.Sidecar{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sidecars"). + Name(sidecar.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(sidecar). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the sidecar and deletes it. Returns an error if one occurs. +func (c *sidecars) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sidecars"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sidecars) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("sidecars"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched sidecar. +func (c *sidecars) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Sidecar, err error) { + result = &v1.Sidecar{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sidecars"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied sidecar. +func (c *sidecars) Apply(ctx context.Context, sidecar *networkingv1.SidecarApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Sidecar, err error) { + if sidecar == nil { + return nil, fmt.Errorf("sidecar provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(sidecar) + if err != nil { + return nil, err + } + name := sidecar.Name + if name == nil { + return nil, fmt.Errorf("sidecar.Name must be provided to Apply") + } + result = &v1.Sidecar{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("sidecars"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *sidecars) ApplyStatus(ctx context.Context, sidecar *networkingv1.SidecarApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Sidecar, err error) { + if sidecar == nil { + return nil, fmt.Errorf("sidecar provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(sidecar) + if err != nil { + return nil, err + } + + name := sidecar.Name + if name == nil { + return nil, fmt.Errorf("sidecar.Name must be provided to Apply") + } + + result = &v1.Sidecar{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("sidecars"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/networking/v1/virtualservice.gen.go b/pkg/clientset/versioned/typed/networking/v1/virtualservice.gen.go new file mode 100644 index 000000000..4377eb55f --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/virtualservice.gen.go @@ -0,0 +1,254 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + scheme "istio.io/client-go/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// VirtualServicesGetter has a method to return a VirtualServiceInterface. +// A group's client should implement this interface. +type VirtualServicesGetter interface { + VirtualServices(namespace string) VirtualServiceInterface +} + +// VirtualServiceInterface has methods to work with VirtualService resources. +type VirtualServiceInterface interface { + Create(ctx context.Context, virtualService *v1.VirtualService, opts metav1.CreateOptions) (*v1.VirtualService, error) + Update(ctx context.Context, virtualService *v1.VirtualService, opts metav1.UpdateOptions) (*v1.VirtualService, error) + UpdateStatus(ctx context.Context, virtualService *v1.VirtualService, opts metav1.UpdateOptions) (*v1.VirtualService, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VirtualService, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VirtualServiceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualService, err error) + Apply(ctx context.Context, virtualService *networkingv1.VirtualServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VirtualService, err error) + ApplyStatus(ctx context.Context, virtualService *networkingv1.VirtualServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VirtualService, err error) + VirtualServiceExpansion +} + +// virtualServices implements VirtualServiceInterface +type virtualServices struct { + client rest.Interface + ns string +} + +// newVirtualServices returns a VirtualServices +func newVirtualServices(c *NetworkingV1Client, namespace string) *virtualServices { + return &virtualServices{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any. +func (c *virtualServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualService, err error) { + result = &v1.VirtualService{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualservices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualServices that match those selectors. +func (c *virtualServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualServiceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VirtualServiceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualServices. +func (c *virtualServices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("virtualservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *virtualServices) Create(ctx context.Context, virtualService *v1.VirtualService, opts metav1.CreateOptions) (result *v1.VirtualService, err error) { + result = &v1.VirtualService{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualService). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *virtualServices) Update(ctx context.Context, virtualService *v1.VirtualService, opts metav1.UpdateOptions) (result *v1.VirtualService, err error) { + result = &v1.VirtualService{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualservices"). + Name(virtualService.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualService). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *virtualServices) UpdateStatus(ctx context.Context, virtualService *v1.VirtualService, opts metav1.UpdateOptions) (result *v1.VirtualService, err error) { + result = &v1.VirtualService{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualservices"). + Name(virtualService.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualService). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualService and deletes it. Returns an error if one occurs. +func (c *virtualServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualservices"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualServices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualservices"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualService. +func (c *virtualServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualService, err error) { + result = &v1.VirtualService{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualservices"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied virtualService. +func (c *virtualServices) Apply(ctx context.Context, virtualService *networkingv1.VirtualServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VirtualService, err error) { + if virtualService == nil { + return nil, fmt.Errorf("virtualService provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(virtualService) + if err != nil { + return nil, err + } + name := virtualService.Name + if name == nil { + return nil, fmt.Errorf("virtualService.Name must be provided to Apply") + } + result = &v1.VirtualService{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("virtualservices"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *virtualServices) ApplyStatus(ctx context.Context, virtualService *networkingv1.VirtualServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VirtualService, err error) { + if virtualService == nil { + return nil, fmt.Errorf("virtualService provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(virtualService) + if err != nil { + return nil, err + } + + name := virtualService.Name + if name == nil { + return nil, fmt.Errorf("virtualService.Name must be provided to Apply") + } + + result = &v1.VirtualService{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("virtualservices"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/networking/v1/workloadentry.gen.go b/pkg/clientset/versioned/typed/networking/v1/workloadentry.gen.go new file mode 100644 index 000000000..e81fc2466 --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/workloadentry.gen.go @@ -0,0 +1,254 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + scheme "istio.io/client-go/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// WorkloadEntriesGetter has a method to return a WorkloadEntryInterface. +// A group's client should implement this interface. +type WorkloadEntriesGetter interface { + WorkloadEntries(namespace string) WorkloadEntryInterface +} + +// WorkloadEntryInterface has methods to work with WorkloadEntry resources. +type WorkloadEntryInterface interface { + Create(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.CreateOptions) (*v1.WorkloadEntry, error) + Update(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.UpdateOptions) (*v1.WorkloadEntry, error) + UpdateStatus(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.UpdateOptions) (*v1.WorkloadEntry, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.WorkloadEntry, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.WorkloadEntryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.WorkloadEntry, err error) + Apply(ctx context.Context, workloadEntry *networkingv1.WorkloadEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadEntry, err error) + ApplyStatus(ctx context.Context, workloadEntry *networkingv1.WorkloadEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadEntry, err error) + WorkloadEntryExpansion +} + +// workloadEntries implements WorkloadEntryInterface +type workloadEntries struct { + client rest.Interface + ns string +} + +// newWorkloadEntries returns a WorkloadEntries +func newWorkloadEntries(c *NetworkingV1Client, namespace string) *workloadEntries { + return &workloadEntries{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the workloadEntry, and returns the corresponding workloadEntry object, and an error if there is any. +func (c *workloadEntries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.WorkloadEntry, err error) { + result = &v1.WorkloadEntry{} + err = c.client.Get(). + Namespace(c.ns). + Resource("workloadentries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of WorkloadEntries that match those selectors. +func (c *workloadEntries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.WorkloadEntryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.WorkloadEntryList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("workloadentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested workloadEntries. +func (c *workloadEntries) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("workloadentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a workloadEntry and creates it. Returns the server's representation of the workloadEntry, and an error, if there is any. +func (c *workloadEntries) Create(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.CreateOptions) (result *v1.WorkloadEntry, err error) { + result = &v1.WorkloadEntry{} + err = c.client.Post(). + Namespace(c.ns). + Resource("workloadentries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(workloadEntry). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a workloadEntry and updates it. Returns the server's representation of the workloadEntry, and an error, if there is any. +func (c *workloadEntries) Update(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.UpdateOptions) (result *v1.WorkloadEntry, err error) { + result = &v1.WorkloadEntry{} + err = c.client.Put(). + Namespace(c.ns). + Resource("workloadentries"). + Name(workloadEntry.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(workloadEntry). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *workloadEntries) UpdateStatus(ctx context.Context, workloadEntry *v1.WorkloadEntry, opts metav1.UpdateOptions) (result *v1.WorkloadEntry, err error) { + result = &v1.WorkloadEntry{} + err = c.client.Put(). + Namespace(c.ns). + Resource("workloadentries"). + Name(workloadEntry.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(workloadEntry). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the workloadEntry and deletes it. Returns an error if one occurs. +func (c *workloadEntries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("workloadentries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *workloadEntries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("workloadentries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched workloadEntry. +func (c *workloadEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.WorkloadEntry, err error) { + result = &v1.WorkloadEntry{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("workloadentries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied workloadEntry. +func (c *workloadEntries) Apply(ctx context.Context, workloadEntry *networkingv1.WorkloadEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadEntry, err error) { + if workloadEntry == nil { + return nil, fmt.Errorf("workloadEntry provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(workloadEntry) + if err != nil { + return nil, err + } + name := workloadEntry.Name + if name == nil { + return nil, fmt.Errorf("workloadEntry.Name must be provided to Apply") + } + result = &v1.WorkloadEntry{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("workloadentries"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *workloadEntries) ApplyStatus(ctx context.Context, workloadEntry *networkingv1.WorkloadEntryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadEntry, err error) { + if workloadEntry == nil { + return nil, fmt.Errorf("workloadEntry provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(workloadEntry) + if err != nil { + return nil, err + } + + name := workloadEntry.Name + if name == nil { + return nil, fmt.Errorf("workloadEntry.Name must be provided to Apply") + } + + result = &v1.WorkloadEntry{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("workloadentries"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/networking/v1/workloadgroup.gen.go b/pkg/clientset/versioned/typed/networking/v1/workloadgroup.gen.go new file mode 100644 index 000000000..9069d70f5 --- /dev/null +++ b/pkg/clientset/versioned/typed/networking/v1/workloadgroup.gen.go @@ -0,0 +1,254 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "istio.io/client-go/pkg/apis/networking/v1" + networkingv1 "istio.io/client-go/pkg/applyconfiguration/networking/v1" + scheme "istio.io/client-go/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// WorkloadGroupsGetter has a method to return a WorkloadGroupInterface. +// A group's client should implement this interface. +type WorkloadGroupsGetter interface { + WorkloadGroups(namespace string) WorkloadGroupInterface +} + +// WorkloadGroupInterface has methods to work with WorkloadGroup resources. +type WorkloadGroupInterface interface { + Create(ctx context.Context, workloadGroup *v1.WorkloadGroup, opts metav1.CreateOptions) (*v1.WorkloadGroup, error) + Update(ctx context.Context, workloadGroup *v1.WorkloadGroup, opts metav1.UpdateOptions) (*v1.WorkloadGroup, error) + UpdateStatus(ctx context.Context, workloadGroup *v1.WorkloadGroup, opts metav1.UpdateOptions) (*v1.WorkloadGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.WorkloadGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.WorkloadGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.WorkloadGroup, err error) + Apply(ctx context.Context, workloadGroup *networkingv1.WorkloadGroupApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadGroup, err error) + ApplyStatus(ctx context.Context, workloadGroup *networkingv1.WorkloadGroupApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadGroup, err error) + WorkloadGroupExpansion +} + +// workloadGroups implements WorkloadGroupInterface +type workloadGroups struct { + client rest.Interface + ns string +} + +// newWorkloadGroups returns a WorkloadGroups +func newWorkloadGroups(c *NetworkingV1Client, namespace string) *workloadGroups { + return &workloadGroups{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the workloadGroup, and returns the corresponding workloadGroup object, and an error if there is any. +func (c *workloadGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.WorkloadGroup, err error) { + result = &v1.WorkloadGroup{} + err = c.client.Get(). + Namespace(c.ns). + Resource("workloadgroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of WorkloadGroups that match those selectors. +func (c *workloadGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.WorkloadGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.WorkloadGroupList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("workloadgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested workloadGroups. +func (c *workloadGroups) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("workloadgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a workloadGroup and creates it. Returns the server's representation of the workloadGroup, and an error, if there is any. +func (c *workloadGroups) Create(ctx context.Context, workloadGroup *v1.WorkloadGroup, opts metav1.CreateOptions) (result *v1.WorkloadGroup, err error) { + result = &v1.WorkloadGroup{} + err = c.client.Post(). + Namespace(c.ns). + Resource("workloadgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(workloadGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a workloadGroup and updates it. Returns the server's representation of the workloadGroup, and an error, if there is any. +func (c *workloadGroups) Update(ctx context.Context, workloadGroup *v1.WorkloadGroup, opts metav1.UpdateOptions) (result *v1.WorkloadGroup, err error) { + result = &v1.WorkloadGroup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("workloadgroups"). + Name(workloadGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(workloadGroup). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *workloadGroups) UpdateStatus(ctx context.Context, workloadGroup *v1.WorkloadGroup, opts metav1.UpdateOptions) (result *v1.WorkloadGroup, err error) { + result = &v1.WorkloadGroup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("workloadgroups"). + Name(workloadGroup.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(workloadGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the workloadGroup and deletes it. Returns an error if one occurs. +func (c *workloadGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("workloadgroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *workloadGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("workloadgroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched workloadGroup. +func (c *workloadGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.WorkloadGroup, err error) { + result = &v1.WorkloadGroup{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("workloadgroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied workloadGroup. +func (c *workloadGroups) Apply(ctx context.Context, workloadGroup *networkingv1.WorkloadGroupApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadGroup, err error) { + if workloadGroup == nil { + return nil, fmt.Errorf("workloadGroup provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(workloadGroup) + if err != nil { + return nil, err + } + name := workloadGroup.Name + if name == nil { + return nil, fmt.Errorf("workloadGroup.Name must be provided to Apply") + } + result = &v1.WorkloadGroup{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("workloadgroups"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *workloadGroups) ApplyStatus(ctx context.Context, workloadGroup *networkingv1.WorkloadGroupApplyConfiguration, opts metav1.ApplyOptions) (result *v1.WorkloadGroup, err error) { + if workloadGroup == nil { + return nil, fmt.Errorf("workloadGroup provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(workloadGroup) + if err != nil { + return nil, err + } + + name := workloadGroup.Name + if name == nil { + return nil, fmt.Errorf("workloadGroup.Name must be provided to Apply") + } + + result = &v1.WorkloadGroup{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("workloadgroups"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/telemetry/v1/doc.go b/pkg/clientset/versioned/typed/telemetry/v1/doc.go new file mode 100644 index 000000000..558d0b55b --- /dev/null +++ b/pkg/clientset/versioned/typed/telemetry/v1/doc.go @@ -0,0 +1,18 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/pkg/clientset/versioned/typed/telemetry/v1/fake/doc.go b/pkg/clientset/versioned/typed/telemetry/v1/fake/doc.go new file mode 100644 index 000000000..e6cc3d6fd --- /dev/null +++ b/pkg/clientset/versioned/typed/telemetry/v1/fake/doc.go @@ -0,0 +1,18 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/clientset/versioned/typed/telemetry/v1/fake/fake_telemetry.gen.go b/pkg/clientset/versioned/typed/telemetry/v1/fake/fake_telemetry.gen.go new file mode 100644 index 000000000..2fce6a195 --- /dev/null +++ b/pkg/clientset/versioned/typed/telemetry/v1/fake/fake_telemetry.gen.go @@ -0,0 +1,187 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "istio.io/client-go/pkg/apis/telemetry/v1" + telemetryv1 "istio.io/client-go/pkg/applyconfiguration/telemetry/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeTelemetries implements TelemetryInterface +type FakeTelemetries struct { + Fake *FakeTelemetryV1 + ns string +} + +var telemetriesResource = v1.SchemeGroupVersion.WithResource("telemetries") + +var telemetriesKind = v1.SchemeGroupVersion.WithKind("Telemetry") + +// Get takes name of the telemetry, and returns the corresponding telemetry object, and an error if there is any. +func (c *FakeTelemetries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Telemetry, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(telemetriesResource, c.ns, name), &v1.Telemetry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Telemetry), err +} + +// List takes label and field selectors, and returns the list of Telemetries that match those selectors. +func (c *FakeTelemetries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TelemetryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(telemetriesResource, telemetriesKind, c.ns, opts), &v1.TelemetryList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.TelemetryList{ListMeta: obj.(*v1.TelemetryList).ListMeta} + for _, item := range obj.(*v1.TelemetryList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested telemetries. +func (c *FakeTelemetries) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(telemetriesResource, c.ns, opts)) + +} + +// Create takes the representation of a telemetry and creates it. Returns the server's representation of the telemetry, and an error, if there is any. +func (c *FakeTelemetries) Create(ctx context.Context, telemetry *v1.Telemetry, opts metav1.CreateOptions) (result *v1.Telemetry, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(telemetriesResource, c.ns, telemetry), &v1.Telemetry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Telemetry), err +} + +// Update takes the representation of a telemetry and updates it. Returns the server's representation of the telemetry, and an error, if there is any. +func (c *FakeTelemetries) Update(ctx context.Context, telemetry *v1.Telemetry, opts metav1.UpdateOptions) (result *v1.Telemetry, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(telemetriesResource, c.ns, telemetry), &v1.Telemetry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Telemetry), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTelemetries) UpdateStatus(ctx context.Context, telemetry *v1.Telemetry, opts metav1.UpdateOptions) (*v1.Telemetry, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(telemetriesResource, "status", c.ns, telemetry), &v1.Telemetry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Telemetry), err +} + +// Delete takes name of the telemetry and deletes it. Returns an error if one occurs. +func (c *FakeTelemetries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(telemetriesResource, c.ns, name, opts), &v1.Telemetry{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTelemetries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(telemetriesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.TelemetryList{}) + return err +} + +// Patch applies the patch and returns the patched telemetry. +func (c *FakeTelemetries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Telemetry, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(telemetriesResource, c.ns, name, pt, data, subresources...), &v1.Telemetry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Telemetry), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied telemetry. +func (c *FakeTelemetries) Apply(ctx context.Context, telemetry *telemetryv1.TelemetryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Telemetry, err error) { + if telemetry == nil { + return nil, fmt.Errorf("telemetry provided to Apply must not be nil") + } + data, err := json.Marshal(telemetry) + if err != nil { + return nil, err + } + name := telemetry.Name + if name == nil { + return nil, fmt.Errorf("telemetry.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(telemetriesResource, c.ns, *name, types.ApplyPatchType, data), &v1.Telemetry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Telemetry), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeTelemetries) ApplyStatus(ctx context.Context, telemetry *telemetryv1.TelemetryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Telemetry, err error) { + if telemetry == nil { + return nil, fmt.Errorf("telemetry provided to Apply must not be nil") + } + data, err := json.Marshal(telemetry) + if err != nil { + return nil, err + } + name := telemetry.Name + if name == nil { + return nil, fmt.Errorf("telemetry.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(telemetriesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Telemetry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Telemetry), err +} diff --git a/pkg/clientset/versioned/typed/telemetry/v1/fake/fake_telemetry_client.gen.go b/pkg/clientset/versioned/typed/telemetry/v1/fake/fake_telemetry_client.gen.go new file mode 100644 index 000000000..c48269b10 --- /dev/null +++ b/pkg/clientset/versioned/typed/telemetry/v1/fake/fake_telemetry_client.gen.go @@ -0,0 +1,38 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "istio.io/client-go/pkg/clientset/versioned/typed/telemetry/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeTelemetryV1 struct { + *testing.Fake +} + +func (c *FakeTelemetryV1) Telemetries(namespace string) v1.TelemetryInterface { + return &FakeTelemetries{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeTelemetryV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/clientset/versioned/typed/telemetry/v1/generated_expansion.gen.go b/pkg/clientset/versioned/typed/telemetry/v1/generated_expansion.gen.go new file mode 100644 index 000000000..df588403d --- /dev/null +++ b/pkg/clientset/versioned/typed/telemetry/v1/generated_expansion.gen.go @@ -0,0 +1,19 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +type TelemetryExpansion interface{} diff --git a/pkg/clientset/versioned/typed/telemetry/v1/telemetry.gen.go b/pkg/clientset/versioned/typed/telemetry/v1/telemetry.gen.go new file mode 100644 index 000000000..db737c123 --- /dev/null +++ b/pkg/clientset/versioned/typed/telemetry/v1/telemetry.gen.go @@ -0,0 +1,254 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "istio.io/client-go/pkg/apis/telemetry/v1" + telemetryv1 "istio.io/client-go/pkg/applyconfiguration/telemetry/v1" + scheme "istio.io/client-go/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// TelemetriesGetter has a method to return a TelemetryInterface. +// A group's client should implement this interface. +type TelemetriesGetter interface { + Telemetries(namespace string) TelemetryInterface +} + +// TelemetryInterface has methods to work with Telemetry resources. +type TelemetryInterface interface { + Create(ctx context.Context, telemetry *v1.Telemetry, opts metav1.CreateOptions) (*v1.Telemetry, error) + Update(ctx context.Context, telemetry *v1.Telemetry, opts metav1.UpdateOptions) (*v1.Telemetry, error) + UpdateStatus(ctx context.Context, telemetry *v1.Telemetry, opts metav1.UpdateOptions) (*v1.Telemetry, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Telemetry, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TelemetryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Telemetry, err error) + Apply(ctx context.Context, telemetry *telemetryv1.TelemetryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Telemetry, err error) + ApplyStatus(ctx context.Context, telemetry *telemetryv1.TelemetryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Telemetry, err error) + TelemetryExpansion +} + +// telemetries implements TelemetryInterface +type telemetries struct { + client rest.Interface + ns string +} + +// newTelemetries returns a Telemetries +func newTelemetries(c *TelemetryV1Client, namespace string) *telemetries { + return &telemetries{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the telemetry, and returns the corresponding telemetry object, and an error if there is any. +func (c *telemetries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Telemetry, err error) { + result = &v1.Telemetry{} + err = c.client.Get(). + Namespace(c.ns). + Resource("telemetries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Telemetries that match those selectors. +func (c *telemetries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TelemetryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TelemetryList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("telemetries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested telemetries. +func (c *telemetries) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("telemetries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a telemetry and creates it. Returns the server's representation of the telemetry, and an error, if there is any. +func (c *telemetries) Create(ctx context.Context, telemetry *v1.Telemetry, opts metav1.CreateOptions) (result *v1.Telemetry, err error) { + result = &v1.Telemetry{} + err = c.client.Post(). + Namespace(c.ns). + Resource("telemetries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(telemetry). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a telemetry and updates it. Returns the server's representation of the telemetry, and an error, if there is any. +func (c *telemetries) Update(ctx context.Context, telemetry *v1.Telemetry, opts metav1.UpdateOptions) (result *v1.Telemetry, err error) { + result = &v1.Telemetry{} + err = c.client.Put(). + Namespace(c.ns). + Resource("telemetries"). + Name(telemetry.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(telemetry). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *telemetries) UpdateStatus(ctx context.Context, telemetry *v1.Telemetry, opts metav1.UpdateOptions) (result *v1.Telemetry, err error) { + result = &v1.Telemetry{} + err = c.client.Put(). + Namespace(c.ns). + Resource("telemetries"). + Name(telemetry.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(telemetry). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the telemetry and deletes it. Returns an error if one occurs. +func (c *telemetries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("telemetries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *telemetries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("telemetries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched telemetry. +func (c *telemetries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Telemetry, err error) { + result = &v1.Telemetry{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("telemetries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied telemetry. +func (c *telemetries) Apply(ctx context.Context, telemetry *telemetryv1.TelemetryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Telemetry, err error) { + if telemetry == nil { + return nil, fmt.Errorf("telemetry provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(telemetry) + if err != nil { + return nil, err + } + name := telemetry.Name + if name == nil { + return nil, fmt.Errorf("telemetry.Name must be provided to Apply") + } + result = &v1.Telemetry{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("telemetries"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *telemetries) ApplyStatus(ctx context.Context, telemetry *telemetryv1.TelemetryApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Telemetry, err error) { + if telemetry == nil { + return nil, fmt.Errorf("telemetry provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(telemetry) + if err != nil { + return nil, err + } + + name := telemetry.Name + if name == nil { + return nil, fmt.Errorf("telemetry.Name must be provided to Apply") + } + + result = &v1.Telemetry{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("telemetries"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/telemetry/v1/telemetry_client.gen.go b/pkg/clientset/versioned/typed/telemetry/v1/telemetry_client.gen.go new file mode 100644 index 000000000..f6e5701b3 --- /dev/null +++ b/pkg/clientset/versioned/typed/telemetry/v1/telemetry_client.gen.go @@ -0,0 +1,105 @@ +// Copyright Istio 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 client-gen. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + v1 "istio.io/client-go/pkg/apis/telemetry/v1" + "istio.io/client-go/pkg/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type TelemetryV1Interface interface { + RESTClient() rest.Interface + TelemetriesGetter +} + +// TelemetryV1Client is used to interact with features provided by the telemetry.istio.io group. +type TelemetryV1Client struct { + restClient rest.Interface +} + +func (c *TelemetryV1Client) Telemetries(namespace string) TelemetryInterface { + return newTelemetries(c, namespace) +} + +// NewForConfig creates a new TelemetryV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*TelemetryV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new TelemetryV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*TelemetryV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &TelemetryV1Client{client}, nil +} + +// NewForConfigOrDie creates a new TelemetryV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *TelemetryV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new TelemetryV1Client for the given RESTClient. +func New(c rest.Interface) *TelemetryV1Client { + return &TelemetryV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *TelemetryV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/informers/externalversions/generic.gen.go b/pkg/informers/externalversions/generic.gen.go index 176795f10..04194fcbf 100644 --- a/pkg/informers/externalversions/generic.gen.go +++ b/pkg/informers/externalversions/generic.gen.go @@ -20,10 +20,12 @@ import ( "fmt" v1alpha1 "istio.io/client-go/pkg/apis/extensions/v1alpha1" + v1 "istio.io/client-go/pkg/apis/networking/v1" v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" - v1 "istio.io/client-go/pkg/apis/security/v1" + securityv1 "istio.io/client-go/pkg/apis/security/v1" securityv1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" + telemetryv1 "istio.io/client-go/pkg/apis/telemetry/v1" telemetryv1alpha1 "istio.io/client-go/pkg/apis/telemetry/v1alpha1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" @@ -59,6 +61,22 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1alpha1.SchemeGroupVersion.WithResource("wasmplugins"): return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1alpha1().WasmPlugins().Informer()}, nil + // Group=networking.istio.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("destinationrules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().DestinationRules().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gateways"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().Gateways().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("serviceentries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().ServiceEntries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("sidecars"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().Sidecars().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("virtualservices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().VirtualServices().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("workloadentries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().WorkloadEntries().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("workloadgroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().WorkloadGroups().Informer()}, nil + // Group=networking.istio.io, Version=v1alpha3 case v1alpha3.SchemeGroupVersion.WithResource("destinationrules"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().DestinationRules().Informer()}, nil @@ -96,11 +114,11 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().WorkloadGroups().Informer()}, nil // Group=security.istio.io, Version=v1 - case v1.SchemeGroupVersion.WithResource("authorizationpolicies"): + case securityv1.SchemeGroupVersion.WithResource("authorizationpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Security().V1().AuthorizationPolicies().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("peerauthentications"): + case securityv1.SchemeGroupVersion.WithResource("peerauthentications"): return &genericInformer{resource: resource.GroupResource(), informer: f.Security().V1().PeerAuthentications().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("requestauthentications"): + case securityv1.SchemeGroupVersion.WithResource("requestauthentications"): return &genericInformer{resource: resource.GroupResource(), informer: f.Security().V1().RequestAuthentications().Informer()}, nil // Group=security.istio.io, Version=v1beta1 @@ -111,6 +129,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case securityv1beta1.SchemeGroupVersion.WithResource("requestauthentications"): return &genericInformer{resource: resource.GroupResource(), informer: f.Security().V1beta1().RequestAuthentications().Informer()}, nil + // Group=telemetry.istio.io, Version=v1 + case telemetryv1.SchemeGroupVersion.WithResource("telemetries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Telemetry().V1().Telemetries().Informer()}, nil + // Group=telemetry.istio.io, Version=v1alpha1 case telemetryv1alpha1.SchemeGroupVersion.WithResource("telemetries"): return &genericInformer{resource: resource.GroupResource(), informer: f.Telemetry().V1alpha1().Telemetries().Informer()}, nil diff --git a/pkg/informers/externalversions/networking/interface.gen.go b/pkg/informers/externalversions/networking/interface.gen.go index 85ccf0a7d..ea5ddce5e 100644 --- a/pkg/informers/externalversions/networking/interface.gen.go +++ b/pkg/informers/externalversions/networking/interface.gen.go @@ -18,6 +18,7 @@ package networking import ( internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/informers/externalversions/networking/v1" v1alpha3 "istio.io/client-go/pkg/informers/externalversions/networking/v1alpha3" v1beta1 "istio.io/client-go/pkg/informers/externalversions/networking/v1beta1" ) @@ -28,6 +29,8 @@ type Interface interface { V1alpha3() v1alpha3.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface } type group struct { @@ -50,3 +53,8 @@ func (g *group) V1alpha3() v1alpha3.Interface { func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/informers/externalversions/networking/v1/destinationrule.gen.go b/pkg/informers/externalversions/networking/v1/destinationrule.gen.go new file mode 100644 index 000000000..bb9fd6c92 --- /dev/null +++ b/pkg/informers/externalversions/networking/v1/destinationrule.gen.go @@ -0,0 +1,88 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" + versioned "istio.io/client-go/pkg/clientset/versioned" + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/listers/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DestinationRuleInformer provides access to a shared informer and lister for +// DestinationRules. +type DestinationRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DestinationRuleLister +} + +type destinationRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewDestinationRuleInformer constructs a new informer for DestinationRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDestinationRuleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDestinationRuleInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredDestinationRuleInformer constructs a new informer for DestinationRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDestinationRuleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().DestinationRules(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().DestinationRules(namespace).Watch(context.TODO(), options) + }, + }, + &networkingv1.DestinationRule{}, + resyncPeriod, + indexers, + ) +} + +func (f *destinationRuleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDestinationRuleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *destinationRuleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1.DestinationRule{}, f.defaultInformer) +} + +func (f *destinationRuleInformer) Lister() v1.DestinationRuleLister { + return v1.NewDestinationRuleLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/networking/v1/gateway.gen.go b/pkg/informers/externalversions/networking/v1/gateway.gen.go new file mode 100644 index 000000000..e9dba73fd --- /dev/null +++ b/pkg/informers/externalversions/networking/v1/gateway.gen.go @@ -0,0 +1,88 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" + versioned "istio.io/client-go/pkg/clientset/versioned" + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/listers/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GatewayInformer provides access to a shared informer and lister for +// Gateways. +type GatewayInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.GatewayLister +} + +type gatewayInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewGatewayInformer constructs a new informer for Gateway type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGatewayInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGatewayInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredGatewayInformer constructs a new informer for Gateway type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGatewayInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().Gateways(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().Gateways(namespace).Watch(context.TODO(), options) + }, + }, + &networkingv1.Gateway{}, + resyncPeriod, + indexers, + ) +} + +func (f *gatewayInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGatewayInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *gatewayInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1.Gateway{}, f.defaultInformer) +} + +func (f *gatewayInformer) Lister() v1.GatewayLister { + return v1.NewGatewayLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/networking/v1/interface.gen.go b/pkg/informers/externalversions/networking/v1/interface.gen.go new file mode 100644 index 000000000..566e55517 --- /dev/null +++ b/pkg/informers/externalversions/networking/v1/interface.gen.go @@ -0,0 +1,85 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // DestinationRules returns a DestinationRuleInformer. + DestinationRules() DestinationRuleInformer + // Gateways returns a GatewayInformer. + Gateways() GatewayInformer + // ServiceEntries returns a ServiceEntryInformer. + ServiceEntries() ServiceEntryInformer + // Sidecars returns a SidecarInformer. + Sidecars() SidecarInformer + // VirtualServices returns a VirtualServiceInformer. + VirtualServices() VirtualServiceInformer + // WorkloadEntries returns a WorkloadEntryInformer. + WorkloadEntries() WorkloadEntryInformer + // WorkloadGroups returns a WorkloadGroupInformer. + WorkloadGroups() WorkloadGroupInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// DestinationRules returns a DestinationRuleInformer. +func (v *version) DestinationRules() DestinationRuleInformer { + return &destinationRuleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Gateways returns a GatewayInformer. +func (v *version) Gateways() GatewayInformer { + return &gatewayInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ServiceEntries returns a ServiceEntryInformer. +func (v *version) ServiceEntries() ServiceEntryInformer { + return &serviceEntryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Sidecars returns a SidecarInformer. +func (v *version) Sidecars() SidecarInformer { + return &sidecarInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// VirtualServices returns a VirtualServiceInformer. +func (v *version) VirtualServices() VirtualServiceInformer { + return &virtualServiceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// WorkloadEntries returns a WorkloadEntryInformer. +func (v *version) WorkloadEntries() WorkloadEntryInformer { + return &workloadEntryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// WorkloadGroups returns a WorkloadGroupInformer. +func (v *version) WorkloadGroups() WorkloadGroupInformer { + return &workloadGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/informers/externalversions/networking/v1/serviceentry.gen.go b/pkg/informers/externalversions/networking/v1/serviceentry.gen.go new file mode 100644 index 000000000..283b6f18d --- /dev/null +++ b/pkg/informers/externalversions/networking/v1/serviceentry.gen.go @@ -0,0 +1,88 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" + versioned "istio.io/client-go/pkg/clientset/versioned" + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/listers/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceEntryInformer provides access to a shared informer and lister for +// ServiceEntries. +type ServiceEntryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceEntryLister +} + +type serviceEntryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewServiceEntryInformer constructs a new informer for ServiceEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceEntryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceEntryInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceEntryInformer constructs a new informer for ServiceEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceEntryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().ServiceEntries(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().ServiceEntries(namespace).Watch(context.TODO(), options) + }, + }, + &networkingv1.ServiceEntry{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceEntryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceEntryInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceEntryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1.ServiceEntry{}, f.defaultInformer) +} + +func (f *serviceEntryInformer) Lister() v1.ServiceEntryLister { + return v1.NewServiceEntryLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/networking/v1/sidecar.gen.go b/pkg/informers/externalversions/networking/v1/sidecar.gen.go new file mode 100644 index 000000000..97b2ed2cf --- /dev/null +++ b/pkg/informers/externalversions/networking/v1/sidecar.gen.go @@ -0,0 +1,88 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" + versioned "istio.io/client-go/pkg/clientset/versioned" + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/listers/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SidecarInformer provides access to a shared informer and lister for +// Sidecars. +type SidecarInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SidecarLister +} + +type sidecarInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewSidecarInformer constructs a new informer for Sidecar type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSidecarInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSidecarInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredSidecarInformer constructs a new informer for Sidecar type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSidecarInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().Sidecars(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().Sidecars(namespace).Watch(context.TODO(), options) + }, + }, + &networkingv1.Sidecar{}, + resyncPeriod, + indexers, + ) +} + +func (f *sidecarInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSidecarInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *sidecarInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1.Sidecar{}, f.defaultInformer) +} + +func (f *sidecarInformer) Lister() v1.SidecarLister { + return v1.NewSidecarLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/networking/v1/virtualservice.gen.go b/pkg/informers/externalversions/networking/v1/virtualservice.gen.go new file mode 100644 index 000000000..7fbe14409 --- /dev/null +++ b/pkg/informers/externalversions/networking/v1/virtualservice.gen.go @@ -0,0 +1,88 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" + versioned "istio.io/client-go/pkg/clientset/versioned" + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/listers/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// VirtualServiceInformer provides access to a shared informer and lister for +// VirtualServices. +type VirtualServiceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.VirtualServiceLister +} + +type virtualServiceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewVirtualServiceInformer constructs a new informer for VirtualService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVirtualServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVirtualServiceInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredVirtualServiceInformer constructs a new informer for VirtualService type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVirtualServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().VirtualServices(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().VirtualServices(namespace).Watch(context.TODO(), options) + }, + }, + &networkingv1.VirtualService{}, + resyncPeriod, + indexers, + ) +} + +func (f *virtualServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVirtualServiceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *virtualServiceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1.VirtualService{}, f.defaultInformer) +} + +func (f *virtualServiceInformer) Lister() v1.VirtualServiceLister { + return v1.NewVirtualServiceLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/networking/v1/workloadentry.gen.go b/pkg/informers/externalversions/networking/v1/workloadentry.gen.go new file mode 100644 index 000000000..ee6376b5a --- /dev/null +++ b/pkg/informers/externalversions/networking/v1/workloadentry.gen.go @@ -0,0 +1,88 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" + versioned "istio.io/client-go/pkg/clientset/versioned" + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/listers/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// WorkloadEntryInformer provides access to a shared informer and lister for +// WorkloadEntries. +type WorkloadEntryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.WorkloadEntryLister +} + +type workloadEntryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewWorkloadEntryInformer constructs a new informer for WorkloadEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewWorkloadEntryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredWorkloadEntryInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredWorkloadEntryInformer constructs a new informer for WorkloadEntry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredWorkloadEntryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().WorkloadEntries(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().WorkloadEntries(namespace).Watch(context.TODO(), options) + }, + }, + &networkingv1.WorkloadEntry{}, + resyncPeriod, + indexers, + ) +} + +func (f *workloadEntryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredWorkloadEntryInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *workloadEntryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1.WorkloadEntry{}, f.defaultInformer) +} + +func (f *workloadEntryInformer) Lister() v1.WorkloadEntryLister { + return v1.NewWorkloadEntryLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/networking/v1/workloadgroup.gen.go b/pkg/informers/externalversions/networking/v1/workloadgroup.gen.go new file mode 100644 index 000000000..ec6beccc7 --- /dev/null +++ b/pkg/informers/externalversions/networking/v1/workloadgroup.gen.go @@ -0,0 +1,88 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + networkingv1 "istio.io/client-go/pkg/apis/networking/v1" + versioned "istio.io/client-go/pkg/clientset/versioned" + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/listers/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// WorkloadGroupInformer provides access to a shared informer and lister for +// WorkloadGroups. +type WorkloadGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.WorkloadGroupLister +} + +type workloadGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewWorkloadGroupInformer constructs a new informer for WorkloadGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewWorkloadGroupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredWorkloadGroupInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredWorkloadGroupInformer constructs a new informer for WorkloadGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredWorkloadGroupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().WorkloadGroups(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().WorkloadGroups(namespace).Watch(context.TODO(), options) + }, + }, + &networkingv1.WorkloadGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *workloadGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredWorkloadGroupInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *workloadGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1.WorkloadGroup{}, f.defaultInformer) +} + +func (f *workloadGroupInformer) Lister() v1.WorkloadGroupLister { + return v1.NewWorkloadGroupLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/telemetry/interface.gen.go b/pkg/informers/externalversions/telemetry/interface.gen.go index b8e461ad9..e43748adb 100644 --- a/pkg/informers/externalversions/telemetry/interface.gen.go +++ b/pkg/informers/externalversions/telemetry/interface.gen.go @@ -18,6 +18,7 @@ package telemetry import ( internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/informers/externalversions/telemetry/v1" v1alpha1 "istio.io/client-go/pkg/informers/externalversions/telemetry/v1alpha1" ) @@ -25,6 +26,8 @@ import ( type Interface interface { // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface } type group struct { @@ -42,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/informers/externalversions/telemetry/v1/interface.gen.go b/pkg/informers/externalversions/telemetry/v1/interface.gen.go new file mode 100644 index 000000000..3b67b263b --- /dev/null +++ b/pkg/informers/externalversions/telemetry/v1/interface.gen.go @@ -0,0 +1,43 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Telemetries returns a TelemetryInformer. + Telemetries() TelemetryInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Telemetries returns a TelemetryInformer. +func (v *version) Telemetries() TelemetryInformer { + return &telemetryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/informers/externalversions/telemetry/v1/telemetry.gen.go b/pkg/informers/externalversions/telemetry/v1/telemetry.gen.go new file mode 100644 index 000000000..ec263dc58 --- /dev/null +++ b/pkg/informers/externalversions/telemetry/v1/telemetry.gen.go @@ -0,0 +1,88 @@ +// Copyright Istio 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + telemetryv1 "istio.io/client-go/pkg/apis/telemetry/v1" + versioned "istio.io/client-go/pkg/clientset/versioned" + internalinterfaces "istio.io/client-go/pkg/informers/externalversions/internalinterfaces" + v1 "istio.io/client-go/pkg/listers/telemetry/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// TelemetryInformer provides access to a shared informer and lister for +// Telemetries. +type TelemetryInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TelemetryLister +} + +type telemetryInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTelemetryInformer constructs a new informer for Telemetry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTelemetryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTelemetryInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTelemetryInformer constructs a new informer for Telemetry type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTelemetryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.TelemetryV1().Telemetries(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.TelemetryV1().Telemetries(namespace).Watch(context.TODO(), options) + }, + }, + &telemetryv1.Telemetry{}, + resyncPeriod, + indexers, + ) +} + +func (f *telemetryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTelemetryInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *telemetryInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&telemetryv1.Telemetry{}, f.defaultInformer) +} + +func (f *telemetryInformer) Lister() v1.TelemetryLister { + return v1.NewTelemetryLister(f.Informer().GetIndexer()) +} diff --git a/pkg/listers/networking/v1/destinationrule.gen.go b/pkg/listers/networking/v1/destinationrule.gen.go new file mode 100644 index 000000000..7eb1b6a09 --- /dev/null +++ b/pkg/listers/networking/v1/destinationrule.gen.go @@ -0,0 +1,97 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "istio.io/client-go/pkg/apis/networking/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DestinationRuleLister helps list DestinationRules. +// All objects returned here must be treated as read-only. +type DestinationRuleLister interface { + // List lists all DestinationRules in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DestinationRule, err error) + // DestinationRules returns an object that can list and get DestinationRules. + DestinationRules(namespace string) DestinationRuleNamespaceLister + DestinationRuleListerExpansion +} + +// destinationRuleLister implements the DestinationRuleLister interface. +type destinationRuleLister struct { + indexer cache.Indexer +} + +// NewDestinationRuleLister returns a new DestinationRuleLister. +func NewDestinationRuleLister(indexer cache.Indexer) DestinationRuleLister { + return &destinationRuleLister{indexer: indexer} +} + +// List lists all DestinationRules in the indexer. +func (s *destinationRuleLister) List(selector labels.Selector) (ret []*v1.DestinationRule, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DestinationRule)) + }) + return ret, err +} + +// DestinationRules returns an object that can list and get DestinationRules. +func (s *destinationRuleLister) DestinationRules(namespace string) DestinationRuleNamespaceLister { + return destinationRuleNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// DestinationRuleNamespaceLister helps list and get DestinationRules. +// All objects returned here must be treated as read-only. +type DestinationRuleNamespaceLister interface { + // List lists all DestinationRules in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DestinationRule, err error) + // Get retrieves the DestinationRule from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DestinationRule, error) + DestinationRuleNamespaceListerExpansion +} + +// destinationRuleNamespaceLister implements the DestinationRuleNamespaceLister +// interface. +type destinationRuleNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all DestinationRules in the indexer for a given namespace. +func (s destinationRuleNamespaceLister) List(selector labels.Selector) (ret []*v1.DestinationRule, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DestinationRule)) + }) + return ret, err +} + +// Get retrieves the DestinationRule from the indexer for a given namespace and name. +func (s destinationRuleNamespaceLister) Get(name string) (*v1.DestinationRule, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("destinationrule"), name) + } + return obj.(*v1.DestinationRule), nil +} diff --git a/pkg/listers/networking/v1/expansion_generated.gen.go b/pkg/listers/networking/v1/expansion_generated.gen.go new file mode 100644 index 000000000..af8b3f382 --- /dev/null +++ b/pkg/listers/networking/v1/expansion_generated.gen.go @@ -0,0 +1,73 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +// DestinationRuleListerExpansion allows custom methods to be added to +// DestinationRuleLister. +type DestinationRuleListerExpansion interface{} + +// DestinationRuleNamespaceListerExpansion allows custom methods to be added to +// DestinationRuleNamespaceLister. +type DestinationRuleNamespaceListerExpansion interface{} + +// GatewayListerExpansion allows custom methods to be added to +// GatewayLister. +type GatewayListerExpansion interface{} + +// GatewayNamespaceListerExpansion allows custom methods to be added to +// GatewayNamespaceLister. +type GatewayNamespaceListerExpansion interface{} + +// ServiceEntryListerExpansion allows custom methods to be added to +// ServiceEntryLister. +type ServiceEntryListerExpansion interface{} + +// ServiceEntryNamespaceListerExpansion allows custom methods to be added to +// ServiceEntryNamespaceLister. +type ServiceEntryNamespaceListerExpansion interface{} + +// SidecarListerExpansion allows custom methods to be added to +// SidecarLister. +type SidecarListerExpansion interface{} + +// SidecarNamespaceListerExpansion allows custom methods to be added to +// SidecarNamespaceLister. +type SidecarNamespaceListerExpansion interface{} + +// VirtualServiceListerExpansion allows custom methods to be added to +// VirtualServiceLister. +type VirtualServiceListerExpansion interface{} + +// VirtualServiceNamespaceListerExpansion allows custom methods to be added to +// VirtualServiceNamespaceLister. +type VirtualServiceNamespaceListerExpansion interface{} + +// WorkloadEntryListerExpansion allows custom methods to be added to +// WorkloadEntryLister. +type WorkloadEntryListerExpansion interface{} + +// WorkloadEntryNamespaceListerExpansion allows custom methods to be added to +// WorkloadEntryNamespaceLister. +type WorkloadEntryNamespaceListerExpansion interface{} + +// WorkloadGroupListerExpansion allows custom methods to be added to +// WorkloadGroupLister. +type WorkloadGroupListerExpansion interface{} + +// WorkloadGroupNamespaceListerExpansion allows custom methods to be added to +// WorkloadGroupNamespaceLister. +type WorkloadGroupNamespaceListerExpansion interface{} diff --git a/pkg/listers/networking/v1/gateway.gen.go b/pkg/listers/networking/v1/gateway.gen.go new file mode 100644 index 000000000..66f7f522f --- /dev/null +++ b/pkg/listers/networking/v1/gateway.gen.go @@ -0,0 +1,97 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "istio.io/client-go/pkg/apis/networking/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GatewayLister helps list Gateways. +// All objects returned here must be treated as read-only. +type GatewayLister interface { + // List lists all Gateways in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Gateway, err error) + // Gateways returns an object that can list and get Gateways. + Gateways(namespace string) GatewayNamespaceLister + GatewayListerExpansion +} + +// gatewayLister implements the GatewayLister interface. +type gatewayLister struct { + indexer cache.Indexer +} + +// NewGatewayLister returns a new GatewayLister. +func NewGatewayLister(indexer cache.Indexer) GatewayLister { + return &gatewayLister{indexer: indexer} +} + +// List lists all Gateways in the indexer. +func (s *gatewayLister) List(selector labels.Selector) (ret []*v1.Gateway, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Gateway)) + }) + return ret, err +} + +// Gateways returns an object that can list and get Gateways. +func (s *gatewayLister) Gateways(namespace string) GatewayNamespaceLister { + return gatewayNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// GatewayNamespaceLister helps list and get Gateways. +// All objects returned here must be treated as read-only. +type GatewayNamespaceLister interface { + // List lists all Gateways in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Gateway, err error) + // Get retrieves the Gateway from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Gateway, error) + GatewayNamespaceListerExpansion +} + +// gatewayNamespaceLister implements the GatewayNamespaceLister +// interface. +type gatewayNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Gateways in the indexer for a given namespace. +func (s gatewayNamespaceLister) List(selector labels.Selector) (ret []*v1.Gateway, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Gateway)) + }) + return ret, err +} + +// Get retrieves the Gateway from the indexer for a given namespace and name. +func (s gatewayNamespaceLister) Get(name string) (*v1.Gateway, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("gateway"), name) + } + return obj.(*v1.Gateway), nil +} diff --git a/pkg/listers/networking/v1/serviceentry.gen.go b/pkg/listers/networking/v1/serviceentry.gen.go new file mode 100644 index 000000000..1cab447ae --- /dev/null +++ b/pkg/listers/networking/v1/serviceentry.gen.go @@ -0,0 +1,97 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "istio.io/client-go/pkg/apis/networking/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceEntryLister helps list ServiceEntries. +// All objects returned here must be treated as read-only. +type ServiceEntryLister interface { + // List lists all ServiceEntries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceEntry, err error) + // ServiceEntries returns an object that can list and get ServiceEntries. + ServiceEntries(namespace string) ServiceEntryNamespaceLister + ServiceEntryListerExpansion +} + +// serviceEntryLister implements the ServiceEntryLister interface. +type serviceEntryLister struct { + indexer cache.Indexer +} + +// NewServiceEntryLister returns a new ServiceEntryLister. +func NewServiceEntryLister(indexer cache.Indexer) ServiceEntryLister { + return &serviceEntryLister{indexer: indexer} +} + +// List lists all ServiceEntries in the indexer. +func (s *serviceEntryLister) List(selector labels.Selector) (ret []*v1.ServiceEntry, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceEntry)) + }) + return ret, err +} + +// ServiceEntries returns an object that can list and get ServiceEntries. +func (s *serviceEntryLister) ServiceEntries(namespace string) ServiceEntryNamespaceLister { + return serviceEntryNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ServiceEntryNamespaceLister helps list and get ServiceEntries. +// All objects returned here must be treated as read-only. +type ServiceEntryNamespaceLister interface { + // List lists all ServiceEntries in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceEntry, err error) + // Get retrieves the ServiceEntry from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceEntry, error) + ServiceEntryNamespaceListerExpansion +} + +// serviceEntryNamespaceLister implements the ServiceEntryNamespaceLister +// interface. +type serviceEntryNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ServiceEntries in the indexer for a given namespace. +func (s serviceEntryNamespaceLister) List(selector labels.Selector) (ret []*v1.ServiceEntry, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceEntry)) + }) + return ret, err +} + +// Get retrieves the ServiceEntry from the indexer for a given namespace and name. +func (s serviceEntryNamespaceLister) Get(name string) (*v1.ServiceEntry, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("serviceentry"), name) + } + return obj.(*v1.ServiceEntry), nil +} diff --git a/pkg/listers/networking/v1/sidecar.gen.go b/pkg/listers/networking/v1/sidecar.gen.go new file mode 100644 index 000000000..e5af605b3 --- /dev/null +++ b/pkg/listers/networking/v1/sidecar.gen.go @@ -0,0 +1,97 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "istio.io/client-go/pkg/apis/networking/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SidecarLister helps list Sidecars. +// All objects returned here must be treated as read-only. +type SidecarLister interface { + // List lists all Sidecars in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Sidecar, err error) + // Sidecars returns an object that can list and get Sidecars. + Sidecars(namespace string) SidecarNamespaceLister + SidecarListerExpansion +} + +// sidecarLister implements the SidecarLister interface. +type sidecarLister struct { + indexer cache.Indexer +} + +// NewSidecarLister returns a new SidecarLister. +func NewSidecarLister(indexer cache.Indexer) SidecarLister { + return &sidecarLister{indexer: indexer} +} + +// List lists all Sidecars in the indexer. +func (s *sidecarLister) List(selector labels.Selector) (ret []*v1.Sidecar, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Sidecar)) + }) + return ret, err +} + +// Sidecars returns an object that can list and get Sidecars. +func (s *sidecarLister) Sidecars(namespace string) SidecarNamespaceLister { + return sidecarNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// SidecarNamespaceLister helps list and get Sidecars. +// All objects returned here must be treated as read-only. +type SidecarNamespaceLister interface { + // List lists all Sidecars in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Sidecar, err error) + // Get retrieves the Sidecar from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Sidecar, error) + SidecarNamespaceListerExpansion +} + +// sidecarNamespaceLister implements the SidecarNamespaceLister +// interface. +type sidecarNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Sidecars in the indexer for a given namespace. +func (s sidecarNamespaceLister) List(selector labels.Selector) (ret []*v1.Sidecar, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Sidecar)) + }) + return ret, err +} + +// Get retrieves the Sidecar from the indexer for a given namespace and name. +func (s sidecarNamespaceLister) Get(name string) (*v1.Sidecar, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("sidecar"), name) + } + return obj.(*v1.Sidecar), nil +} diff --git a/pkg/listers/networking/v1/virtualservice.gen.go b/pkg/listers/networking/v1/virtualservice.gen.go new file mode 100644 index 000000000..9e438de5a --- /dev/null +++ b/pkg/listers/networking/v1/virtualservice.gen.go @@ -0,0 +1,97 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "istio.io/client-go/pkg/apis/networking/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VirtualServiceLister helps list VirtualServices. +// All objects returned here must be treated as read-only. +type VirtualServiceLister interface { + // List lists all VirtualServices in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.VirtualService, err error) + // VirtualServices returns an object that can list and get VirtualServices. + VirtualServices(namespace string) VirtualServiceNamespaceLister + VirtualServiceListerExpansion +} + +// virtualServiceLister implements the VirtualServiceLister interface. +type virtualServiceLister struct { + indexer cache.Indexer +} + +// NewVirtualServiceLister returns a new VirtualServiceLister. +func NewVirtualServiceLister(indexer cache.Indexer) VirtualServiceLister { + return &virtualServiceLister{indexer: indexer} +} + +// List lists all VirtualServices in the indexer. +func (s *virtualServiceLister) List(selector labels.Selector) (ret []*v1.VirtualService, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.VirtualService)) + }) + return ret, err +} + +// VirtualServices returns an object that can list and get VirtualServices. +func (s *virtualServiceLister) VirtualServices(namespace string) VirtualServiceNamespaceLister { + return virtualServiceNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// VirtualServiceNamespaceLister helps list and get VirtualServices. +// All objects returned here must be treated as read-only. +type VirtualServiceNamespaceLister interface { + // List lists all VirtualServices in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.VirtualService, err error) + // Get retrieves the VirtualService from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.VirtualService, error) + VirtualServiceNamespaceListerExpansion +} + +// virtualServiceNamespaceLister implements the VirtualServiceNamespaceLister +// interface. +type virtualServiceNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all VirtualServices in the indexer for a given namespace. +func (s virtualServiceNamespaceLister) List(selector labels.Selector) (ret []*v1.VirtualService, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.VirtualService)) + }) + return ret, err +} + +// Get retrieves the VirtualService from the indexer for a given namespace and name. +func (s virtualServiceNamespaceLister) Get(name string) (*v1.VirtualService, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("virtualservice"), name) + } + return obj.(*v1.VirtualService), nil +} diff --git a/pkg/listers/networking/v1/workloadentry.gen.go b/pkg/listers/networking/v1/workloadentry.gen.go new file mode 100644 index 000000000..49cdb5fdd --- /dev/null +++ b/pkg/listers/networking/v1/workloadentry.gen.go @@ -0,0 +1,97 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "istio.io/client-go/pkg/apis/networking/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// WorkloadEntryLister helps list WorkloadEntries. +// All objects returned here must be treated as read-only. +type WorkloadEntryLister interface { + // List lists all WorkloadEntries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.WorkloadEntry, err error) + // WorkloadEntries returns an object that can list and get WorkloadEntries. + WorkloadEntries(namespace string) WorkloadEntryNamespaceLister + WorkloadEntryListerExpansion +} + +// workloadEntryLister implements the WorkloadEntryLister interface. +type workloadEntryLister struct { + indexer cache.Indexer +} + +// NewWorkloadEntryLister returns a new WorkloadEntryLister. +func NewWorkloadEntryLister(indexer cache.Indexer) WorkloadEntryLister { + return &workloadEntryLister{indexer: indexer} +} + +// List lists all WorkloadEntries in the indexer. +func (s *workloadEntryLister) List(selector labels.Selector) (ret []*v1.WorkloadEntry, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.WorkloadEntry)) + }) + return ret, err +} + +// WorkloadEntries returns an object that can list and get WorkloadEntries. +func (s *workloadEntryLister) WorkloadEntries(namespace string) WorkloadEntryNamespaceLister { + return workloadEntryNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// WorkloadEntryNamespaceLister helps list and get WorkloadEntries. +// All objects returned here must be treated as read-only. +type WorkloadEntryNamespaceLister interface { + // List lists all WorkloadEntries in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.WorkloadEntry, err error) + // Get retrieves the WorkloadEntry from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.WorkloadEntry, error) + WorkloadEntryNamespaceListerExpansion +} + +// workloadEntryNamespaceLister implements the WorkloadEntryNamespaceLister +// interface. +type workloadEntryNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all WorkloadEntries in the indexer for a given namespace. +func (s workloadEntryNamespaceLister) List(selector labels.Selector) (ret []*v1.WorkloadEntry, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.WorkloadEntry)) + }) + return ret, err +} + +// Get retrieves the WorkloadEntry from the indexer for a given namespace and name. +func (s workloadEntryNamespaceLister) Get(name string) (*v1.WorkloadEntry, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("workloadentry"), name) + } + return obj.(*v1.WorkloadEntry), nil +} diff --git a/pkg/listers/networking/v1/workloadgroup.gen.go b/pkg/listers/networking/v1/workloadgroup.gen.go new file mode 100644 index 000000000..aca6c6017 --- /dev/null +++ b/pkg/listers/networking/v1/workloadgroup.gen.go @@ -0,0 +1,97 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "istio.io/client-go/pkg/apis/networking/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// WorkloadGroupLister helps list WorkloadGroups. +// All objects returned here must be treated as read-only. +type WorkloadGroupLister interface { + // List lists all WorkloadGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.WorkloadGroup, err error) + // WorkloadGroups returns an object that can list and get WorkloadGroups. + WorkloadGroups(namespace string) WorkloadGroupNamespaceLister + WorkloadGroupListerExpansion +} + +// workloadGroupLister implements the WorkloadGroupLister interface. +type workloadGroupLister struct { + indexer cache.Indexer +} + +// NewWorkloadGroupLister returns a new WorkloadGroupLister. +func NewWorkloadGroupLister(indexer cache.Indexer) WorkloadGroupLister { + return &workloadGroupLister{indexer: indexer} +} + +// List lists all WorkloadGroups in the indexer. +func (s *workloadGroupLister) List(selector labels.Selector) (ret []*v1.WorkloadGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.WorkloadGroup)) + }) + return ret, err +} + +// WorkloadGroups returns an object that can list and get WorkloadGroups. +func (s *workloadGroupLister) WorkloadGroups(namespace string) WorkloadGroupNamespaceLister { + return workloadGroupNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// WorkloadGroupNamespaceLister helps list and get WorkloadGroups. +// All objects returned here must be treated as read-only. +type WorkloadGroupNamespaceLister interface { + // List lists all WorkloadGroups in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.WorkloadGroup, err error) + // Get retrieves the WorkloadGroup from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.WorkloadGroup, error) + WorkloadGroupNamespaceListerExpansion +} + +// workloadGroupNamespaceLister implements the WorkloadGroupNamespaceLister +// interface. +type workloadGroupNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all WorkloadGroups in the indexer for a given namespace. +func (s workloadGroupNamespaceLister) List(selector labels.Selector) (ret []*v1.WorkloadGroup, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.WorkloadGroup)) + }) + return ret, err +} + +// Get retrieves the WorkloadGroup from the indexer for a given namespace and name. +func (s workloadGroupNamespaceLister) Get(name string) (*v1.WorkloadGroup, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("workloadgroup"), name) + } + return obj.(*v1.WorkloadGroup), nil +} diff --git a/pkg/listers/telemetry/v1/expansion_generated.gen.go b/pkg/listers/telemetry/v1/expansion_generated.gen.go new file mode 100644 index 000000000..5862be9ff --- /dev/null +++ b/pkg/listers/telemetry/v1/expansion_generated.gen.go @@ -0,0 +1,25 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +// TelemetryListerExpansion allows custom methods to be added to +// TelemetryLister. +type TelemetryListerExpansion interface{} + +// TelemetryNamespaceListerExpansion allows custom methods to be added to +// TelemetryNamespaceLister. +type TelemetryNamespaceListerExpansion interface{} diff --git a/pkg/listers/telemetry/v1/telemetry.gen.go b/pkg/listers/telemetry/v1/telemetry.gen.go new file mode 100644 index 000000000..962bb2b8b --- /dev/null +++ b/pkg/listers/telemetry/v1/telemetry.gen.go @@ -0,0 +1,97 @@ +// Copyright Istio 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "istio.io/client-go/pkg/apis/telemetry/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TelemetryLister helps list Telemetries. +// All objects returned here must be treated as read-only. +type TelemetryLister interface { + // List lists all Telemetries in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Telemetry, err error) + // Telemetries returns an object that can list and get Telemetries. + Telemetries(namespace string) TelemetryNamespaceLister + TelemetryListerExpansion +} + +// telemetryLister implements the TelemetryLister interface. +type telemetryLister struct { + indexer cache.Indexer +} + +// NewTelemetryLister returns a new TelemetryLister. +func NewTelemetryLister(indexer cache.Indexer) TelemetryLister { + return &telemetryLister{indexer: indexer} +} + +// List lists all Telemetries in the indexer. +func (s *telemetryLister) List(selector labels.Selector) (ret []*v1.Telemetry, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Telemetry)) + }) + return ret, err +} + +// Telemetries returns an object that can list and get Telemetries. +func (s *telemetryLister) Telemetries(namespace string) TelemetryNamespaceLister { + return telemetryNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TelemetryNamespaceLister helps list and get Telemetries. +// All objects returned here must be treated as read-only. +type TelemetryNamespaceLister interface { + // List lists all Telemetries in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Telemetry, err error) + // Get retrieves the Telemetry from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Telemetry, error) + TelemetryNamespaceListerExpansion +} + +// telemetryNamespaceLister implements the TelemetryNamespaceLister +// interface. +type telemetryNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Telemetries in the indexer for a given namespace. +func (s telemetryNamespaceLister) List(selector labels.Selector) (ret []*v1.Telemetry, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Telemetry)) + }) + return ret, err +} + +// Get retrieves the Telemetry from the indexer for a given namespace and name. +func (s telemetryNamespaceLister) Get(name string) (*v1.Telemetry, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("telemetry"), name) + } + return obj.(*v1.Telemetry), nil +}