From 8c7a9507021c1d7c6960c9181ab7311f7df20159 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Wed, 14 Mar 2018 05:42:31 -0700 Subject: [PATCH] Remove internal types for CRDs (#304) --- apis/monitoring/cluster_alert.go | 57 --- apis/monitoring/doc.go | 5 - apis/monitoring/incident.go | 66 --- apis/monitoring/install/install.go | 43 -- apis/monitoring/node_alert.go | 61 --- apis/monitoring/pod_alert.go | 61 --- apis/monitoring/register.go | 38 -- apis/monitoring/types.go | 12 - .../v1alpha1/zz_generated.conversion.go | 437 ---------------- .../v1alpha1/zz_generated.defaults.go | 32 -- apis/monitoring/zz_generated.deepcopy.go | 484 ------------------ client/clientset/internalversion/clientset.go | 104 ---- client/clientset/internalversion/doc.go | 18 - .../fake/clientset_generated.go | 73 --- client/clientset/internalversion/fake/doc.go | 18 - .../internalversion/fake/register.go | 55 -- .../clientset/internalversion/scheme/doc.go | 18 - .../internalversion/scheme/register.go | 49 -- .../internalversion/acknowledgement.go | 73 --- .../typed/incidents/internalversion/doc.go | 18 - .../incidents/internalversion/fake/doc.go | 18 - .../fake/fake_acknowledgement.go | 53 -- .../fake/fake_incidents_client.go | 38 -- .../internalversion/generated_expansion.go | 19 - .../internalversion/incidents_client.go | 99 ---- .../internalversion/clusteralert.go | 155 ------ .../typed/monitoring/internalversion/doc.go | 18 - .../monitoring/internalversion/fake/doc.go | 18 - .../internalversion/fake/fake_clusteralert.go | 126 ----- .../internalversion/fake/fake_incident.go | 126 ----- .../fake/fake_monitoring_client.go | 50 -- .../internalversion/fake/fake_nodealert.go | 126 ----- .../internalversion/fake/fake_podalert.go | 126 ----- .../internalversion/generated_expansion.go | 25 - .../monitoring/internalversion/incident.go | 155 ------ .../internalversion/monitoring_client.go | 114 ----- .../monitoring/internalversion/nodealert.go | 155 ------ .../monitoring/internalversion/podalert.go | 155 ------ client/informers/internalversion/factory.go | 131 ----- client/informers/internalversion/generic.go | 68 --- .../internalinterfaces/factory_interfaces.go | 38 -- .../internalversion/monitoring/interface.go | 46 -- .../internalversion/clusteralert.go | 89 ---- .../monitoring/internalversion/incident.go | 89 ---- .../monitoring/internalversion/interface.go | 66 --- .../monitoring/internalversion/nodealert.go | 89 ---- .../monitoring/internalversion/podalert.go | 89 ---- .../internalversion/clusteralert.go | 94 ---- .../internalversion/expansion_generated.go | 51 -- .../monitoring/internalversion/incident.go | 94 ---- .../monitoring/internalversion/nodealert.go | 94 ---- .../monitoring/internalversion/podalert.go | 94 ---- hack/codegen.sh | 16 +- 53 files changed, 12 insertions(+), 4434 deletions(-) delete mode 100644 apis/monitoring/cluster_alert.go delete mode 100644 apis/monitoring/doc.go delete mode 100644 apis/monitoring/incident.go delete mode 100644 apis/monitoring/install/install.go delete mode 100644 apis/monitoring/node_alert.go delete mode 100644 apis/monitoring/pod_alert.go delete mode 100644 apis/monitoring/types.go delete mode 100644 apis/monitoring/v1alpha1/zz_generated.conversion.go delete mode 100644 apis/monitoring/v1alpha1/zz_generated.defaults.go delete mode 100644 apis/monitoring/zz_generated.deepcopy.go delete mode 100644 client/clientset/internalversion/clientset.go delete mode 100644 client/clientset/internalversion/doc.go delete mode 100644 client/clientset/internalversion/fake/clientset_generated.go delete mode 100644 client/clientset/internalversion/fake/doc.go delete mode 100644 client/clientset/internalversion/fake/register.go delete mode 100644 client/clientset/internalversion/scheme/doc.go delete mode 100644 client/clientset/internalversion/scheme/register.go delete mode 100644 client/clientset/internalversion/typed/incidents/internalversion/acknowledgement.go delete mode 100644 client/clientset/internalversion/typed/incidents/internalversion/doc.go delete mode 100644 client/clientset/internalversion/typed/incidents/internalversion/fake/doc.go delete mode 100644 client/clientset/internalversion/typed/incidents/internalversion/fake/fake_acknowledgement.go delete mode 100644 client/clientset/internalversion/typed/incidents/internalversion/fake/fake_incidents_client.go delete mode 100644 client/clientset/internalversion/typed/incidents/internalversion/generated_expansion.go delete mode 100644 client/clientset/internalversion/typed/incidents/internalversion/incidents_client.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/clusteralert.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/doc.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/fake/doc.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_clusteralert.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_incident.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_monitoring_client.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_nodealert.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_podalert.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/generated_expansion.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/incident.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/monitoring_client.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/nodealert.go delete mode 100644 client/clientset/internalversion/typed/monitoring/internalversion/podalert.go delete mode 100644 client/informers/internalversion/factory.go delete mode 100644 client/informers/internalversion/generic.go delete mode 100644 client/informers/internalversion/internalinterfaces/factory_interfaces.go delete mode 100644 client/informers/internalversion/monitoring/interface.go delete mode 100644 client/informers/internalversion/monitoring/internalversion/clusteralert.go delete mode 100644 client/informers/internalversion/monitoring/internalversion/incident.go delete mode 100644 client/informers/internalversion/monitoring/internalversion/interface.go delete mode 100644 client/informers/internalversion/monitoring/internalversion/nodealert.go delete mode 100644 client/informers/internalversion/monitoring/internalversion/podalert.go delete mode 100644 client/listers/monitoring/internalversion/clusteralert.go delete mode 100644 client/listers/monitoring/internalversion/expansion_generated.go delete mode 100644 client/listers/monitoring/internalversion/incident.go delete mode 100644 client/listers/monitoring/internalversion/nodealert.go delete mode 100644 client/listers/monitoring/internalversion/podalert.go diff --git a/apis/monitoring/cluster_alert.go b/apis/monitoring/cluster_alert.go deleted file mode 100644 index 8baa472a6..000000000 --- a/apis/monitoring/cluster_alert.go +++ /dev/null @@ -1,57 +0,0 @@ -package monitoring - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type CheckCluster string - -// +genclient -// +genclient:skipVerbs=updateStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type ClusterAlert struct { - metav1.TypeMeta - // Standard object's metadata. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#metadata - metav1.ObjectMeta - - // Spec is the desired state of the ClusterAlert. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#spec-and-status - Spec ClusterAlertSpec -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterAlertList is a collection of ClusterAlert. -type ClusterAlertList struct { - metav1.TypeMeta - // Standard object's metadata. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#metadata - metav1.ListMeta - - // Items is the list of ClusterAlert. - Items []ClusterAlert -} - -// ClusterAlertSpec describes the ClusterAlert the user wishes to create. -type ClusterAlertSpec struct { - // Icinga CheckCommand name - Check CheckCluster - - // How frequently Icinga Service will be checked - CheckInterval metav1.Duration - - // How frequently notifications will be send - AlertInterval metav1.Duration - - // Secret containing notifier credentials - NotifierSecretName string - - // NotifierParams contains information to send notifications for Incident - // State, UserUid, Method - Receivers []Receiver - - // Vars contains Icinga Service variables to be used in CheckCommand - Vars map[string]string -} diff --git a/apis/monitoring/doc.go b/apis/monitoring/doc.go deleted file mode 100644 index f2ad0ef23..000000000 --- a/apis/monitoring/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// +k8s:deepcopy-gen=package,register - -// Package api is the internal version of the API. -// +groupName=monitoring.appscode.com -package monitoring diff --git a/apis/monitoring/incident.go b/apis/monitoring/incident.go deleted file mode 100644 index 529cdcc4e..000000000 --- a/apis/monitoring/incident.go +++ /dev/null @@ -1,66 +0,0 @@ -package monitoring - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:skipVerbs=updateStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type Incident struct { - metav1.TypeMeta - // Standard object's metadata. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#metadata - metav1.ObjectMeta - - // Derived information about the incident. - // +optional - Status IncidentStatus -} - -type IncidentStatus struct { - // state of incident, such as Critical, Warning, OK - LastNotificationType IncidentNotificationType - - // Notifications for the incident, such as problem or acknowledge. - // +optional - Notifications []IncidentNotification -} - -type IncidentNotificationType string - -type IncidentNotification struct { - // incident notification type. - Type IncidentNotificationType - // brief output of check command for the incident - // +optional - CheckOutput string - // name of user making comment - // +optional - Author *string - // comment made by user - // +optional - Comment *string - // The time at which this notification was first recorded. (Time of server receipt is in TypeMeta.) - // +optional - FirstTimestamp metav1.Time - // The time at which the most recent occurrence of this notification was recorded. - // +optional - LastTimestamp metav1.Time - // state of incident, such as Critical, Warning, OK, Unknown - LastState string -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// IncidentList is a collection of Incident. -type IncidentList struct { - metav1.TypeMeta - // Standard object's metadata. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#metadata - metav1.ListMeta - - // Items is the list of Incident. - Items []Incident -} diff --git a/apis/monitoring/install/install.go b/apis/monitoring/install/install.go deleted file mode 100644 index 6878d3ce4..000000000 --- a/apis/monitoring/install/install.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package install - -import ( - "github.com/appscode/searchlight/apis/monitoring" - "github.com/appscode/searchlight/apis/monitoring/v1alpha1" - "k8s.io/apimachinery/pkg/apimachinery/announced" - "k8s.io/apimachinery/pkg/apimachinery/registered" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/sets" -) - -// Install registers the API group and adds types to a scheme -func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) { - if err := announced.NewGroupMetaFactory( - &announced.GroupMetaFactoryArgs{ - GroupName: monitoring.GroupName, - RootScopedKinds: sets.NewString(), - VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version}, - AddInternalObjectsToScheme: monitoring.AddToScheme, - }, - announced.VersionToSchemeFunc{ - v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme, - }, - ).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil { - panic(err) - } -} diff --git a/apis/monitoring/node_alert.go b/apis/monitoring/node_alert.go deleted file mode 100644 index 7cf671c1e..000000000 --- a/apis/monitoring/node_alert.go +++ /dev/null @@ -1,61 +0,0 @@ -package monitoring - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type CheckNode string - -// +genclient -// +genclient:skipVerbs=updateStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type NodeAlert struct { - metav1.TypeMeta - // Standard object's metadata. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#metadata - metav1.ObjectMeta - - // Spec is the desired state of the NodeAlert. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#spec-and-status - Spec NodeAlertSpec -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// NodeAlertList is a collection of NodeAlert. -type NodeAlertList struct { - metav1.TypeMeta - // Standard object's metadata. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#metadata - metav1.ListMeta - - // Items is the list of NodeAlert. - Items []NodeAlert -} - -// NodeAlertSpec describes the NodeAlert the user wishes to create. -type NodeAlertSpec struct { - Selector map[string]string - - NodeName *string - - // Icinga CheckCommand name - Check CheckNode - - // How frequently Icinga Service will be checked - CheckInterval metav1.Duration - - // How frequently notifications will be send - AlertInterval metav1.Duration - - // Secret containing notifier credentials - NotifierSecretName string - - // NotifierParams contains information to send notifications for Incident - // State, UserUid, Method - Receivers []Receiver - - // Vars contains Icinga Service variables to be used in CheckCommand - Vars map[string]string -} diff --git a/apis/monitoring/pod_alert.go b/apis/monitoring/pod_alert.go deleted file mode 100644 index bfe2a0f24..000000000 --- a/apis/monitoring/pod_alert.go +++ /dev/null @@ -1,61 +0,0 @@ -package monitoring - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type CheckPod string - -// +genclient -// +genclient:skipVerbs=updateStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type PodAlert struct { - metav1.TypeMeta - // Standard object's metadata. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#metadata - metav1.ObjectMeta - - // Spec is the desired state of the PodAlert. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#spec-and-status - Spec PodAlertSpec -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PodAlertList is a collection of PodAlert. -type PodAlertList struct { - metav1.TypeMeta - // Standard object's metadata. - // More info: http://releases.k8s.io/release-1.2/docs/devel/api-conventions.md#metadata - metav1.ListMeta - - // Items is the list of PodAlert. - Items []PodAlert -} - -// PodAlertSpec describes the PodAlert the user wishes to create. -type PodAlertSpec struct { - Selector *metav1.LabelSelector - - PodName *string - - // Icinga CheckCommand name - Check CheckPod - - // How frequently Icinga Service will be checked - CheckInterval metav1.Duration - - // How frequently notifications will be send - AlertInterval metav1.Duration - - // Secret containing notifier credentials - NotifierSecretName string - - // NotifierParams contains information to send notifications for Incident - // State, UserUid, Method - Receivers []Receiver - - // Vars contains Icinga Service variables to be used in CheckCommand - Vars map[string]string -} diff --git a/apis/monitoring/register.go b/apis/monitoring/register.go index c823b081e..b76ceb032 100644 --- a/apis/monitoring/register.go +++ b/apis/monitoring/register.go @@ -1,41 +1,3 @@ package monitoring -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - const GroupName = "monitoring.appscode.com" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns back a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &ClusterAlert{}, - &ClusterAlertList{}, - &NodeAlert{}, - &NodeAlertList{}, - &PodAlert{}, - &PodAlertList{}, - &Incident{}, - &IncidentList{}, - ) - return nil -} diff --git a/apis/monitoring/types.go b/apis/monitoring/types.go deleted file mode 100644 index a7ceaa8e0..000000000 --- a/apis/monitoring/types.go +++ /dev/null @@ -1,12 +0,0 @@ -package monitoring - -type Receiver struct { - // For which state notification will be sent - State string - - // To whom notification will be sent - To []string - - // How this notification will be sent - Notifier string -} diff --git a/apis/monitoring/v1alpha1/zz_generated.conversion.go b/apis/monitoring/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 49cab3f2c..000000000 --- a/apis/monitoring/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,437 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1alpha1 - -import ( - unsafe "unsafe" - - monitoring "github.com/appscode/searchlight/apis/monitoring" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(scheme *runtime.Scheme) error { - return scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_ClusterAlert_To_monitoring_ClusterAlert, - Convert_monitoring_ClusterAlert_To_v1alpha1_ClusterAlert, - Convert_v1alpha1_ClusterAlertList_To_monitoring_ClusterAlertList, - Convert_monitoring_ClusterAlertList_To_v1alpha1_ClusterAlertList, - Convert_v1alpha1_ClusterAlertSpec_To_monitoring_ClusterAlertSpec, - Convert_monitoring_ClusterAlertSpec_To_v1alpha1_ClusterAlertSpec, - Convert_v1alpha1_Incident_To_monitoring_Incident, - Convert_monitoring_Incident_To_v1alpha1_Incident, - Convert_v1alpha1_IncidentList_To_monitoring_IncidentList, - Convert_monitoring_IncidentList_To_v1alpha1_IncidentList, - Convert_v1alpha1_IncidentNotification_To_monitoring_IncidentNotification, - Convert_monitoring_IncidentNotification_To_v1alpha1_IncidentNotification, - Convert_v1alpha1_IncidentStatus_To_monitoring_IncidentStatus, - Convert_monitoring_IncidentStatus_To_v1alpha1_IncidentStatus, - Convert_v1alpha1_NodeAlert_To_monitoring_NodeAlert, - Convert_monitoring_NodeAlert_To_v1alpha1_NodeAlert, - Convert_v1alpha1_NodeAlertList_To_monitoring_NodeAlertList, - Convert_monitoring_NodeAlertList_To_v1alpha1_NodeAlertList, - Convert_v1alpha1_NodeAlertSpec_To_monitoring_NodeAlertSpec, - Convert_monitoring_NodeAlertSpec_To_v1alpha1_NodeAlertSpec, - Convert_v1alpha1_PodAlert_To_monitoring_PodAlert, - Convert_monitoring_PodAlert_To_v1alpha1_PodAlert, - Convert_v1alpha1_PodAlertList_To_monitoring_PodAlertList, - Convert_monitoring_PodAlertList_To_v1alpha1_PodAlertList, - Convert_v1alpha1_PodAlertSpec_To_monitoring_PodAlertSpec, - Convert_monitoring_PodAlertSpec_To_v1alpha1_PodAlertSpec, - Convert_v1alpha1_Receiver_To_monitoring_Receiver, - Convert_monitoring_Receiver_To_v1alpha1_Receiver, - ) -} - -func autoConvert_v1alpha1_ClusterAlert_To_monitoring_ClusterAlert(in *ClusterAlert, out *monitoring.ClusterAlert, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_ClusterAlertSpec_To_monitoring_ClusterAlertSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_ClusterAlert_To_monitoring_ClusterAlert is an autogenerated conversion function. -func Convert_v1alpha1_ClusterAlert_To_monitoring_ClusterAlert(in *ClusterAlert, out *monitoring.ClusterAlert, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterAlert_To_monitoring_ClusterAlert(in, out, s) -} - -func autoConvert_monitoring_ClusterAlert_To_v1alpha1_ClusterAlert(in *monitoring.ClusterAlert, out *ClusterAlert, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_monitoring_ClusterAlertSpec_To_v1alpha1_ClusterAlertSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_monitoring_ClusterAlert_To_v1alpha1_ClusterAlert is an autogenerated conversion function. -func Convert_monitoring_ClusterAlert_To_v1alpha1_ClusterAlert(in *monitoring.ClusterAlert, out *ClusterAlert, s conversion.Scope) error { - return autoConvert_monitoring_ClusterAlert_To_v1alpha1_ClusterAlert(in, out, s) -} - -func autoConvert_v1alpha1_ClusterAlertList_To_monitoring_ClusterAlertList(in *ClusterAlertList, out *monitoring.ClusterAlertList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]monitoring.ClusterAlert)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_ClusterAlertList_To_monitoring_ClusterAlertList is an autogenerated conversion function. -func Convert_v1alpha1_ClusterAlertList_To_monitoring_ClusterAlertList(in *ClusterAlertList, out *monitoring.ClusterAlertList, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterAlertList_To_monitoring_ClusterAlertList(in, out, s) -} - -func autoConvert_monitoring_ClusterAlertList_To_v1alpha1_ClusterAlertList(in *monitoring.ClusterAlertList, out *ClusterAlertList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]ClusterAlert)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_monitoring_ClusterAlertList_To_v1alpha1_ClusterAlertList is an autogenerated conversion function. -func Convert_monitoring_ClusterAlertList_To_v1alpha1_ClusterAlertList(in *monitoring.ClusterAlertList, out *ClusterAlertList, s conversion.Scope) error { - return autoConvert_monitoring_ClusterAlertList_To_v1alpha1_ClusterAlertList(in, out, s) -} - -func autoConvert_v1alpha1_ClusterAlertSpec_To_monitoring_ClusterAlertSpec(in *ClusterAlertSpec, out *monitoring.ClusterAlertSpec, s conversion.Scope) error { - out.Check = monitoring.CheckCluster(in.Check) - out.CheckInterval = in.CheckInterval - out.AlertInterval = in.AlertInterval - out.NotifierSecretName = in.NotifierSecretName - out.Receivers = *(*[]monitoring.Receiver)(unsafe.Pointer(&in.Receivers)) - out.Vars = *(*map[string]string)(unsafe.Pointer(&in.Vars)) - return nil -} - -// Convert_v1alpha1_ClusterAlertSpec_To_monitoring_ClusterAlertSpec is an autogenerated conversion function. -func Convert_v1alpha1_ClusterAlertSpec_To_monitoring_ClusterAlertSpec(in *ClusterAlertSpec, out *monitoring.ClusterAlertSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterAlertSpec_To_monitoring_ClusterAlertSpec(in, out, s) -} - -func autoConvert_monitoring_ClusterAlertSpec_To_v1alpha1_ClusterAlertSpec(in *monitoring.ClusterAlertSpec, out *ClusterAlertSpec, s conversion.Scope) error { - out.Check = CheckCluster(in.Check) - out.CheckInterval = in.CheckInterval - out.AlertInterval = in.AlertInterval - out.NotifierSecretName = in.NotifierSecretName - out.Receivers = *(*[]Receiver)(unsafe.Pointer(&in.Receivers)) - out.Vars = *(*map[string]string)(unsafe.Pointer(&in.Vars)) - return nil -} - -// Convert_monitoring_ClusterAlertSpec_To_v1alpha1_ClusterAlertSpec is an autogenerated conversion function. -func Convert_monitoring_ClusterAlertSpec_To_v1alpha1_ClusterAlertSpec(in *monitoring.ClusterAlertSpec, out *ClusterAlertSpec, s conversion.Scope) error { - return autoConvert_monitoring_ClusterAlertSpec_To_v1alpha1_ClusterAlertSpec(in, out, s) -} - -func autoConvert_v1alpha1_Incident_To_monitoring_Incident(in *Incident, out *monitoring.Incident, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_IncidentStatus_To_monitoring_IncidentStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_Incident_To_monitoring_Incident is an autogenerated conversion function. -func Convert_v1alpha1_Incident_To_monitoring_Incident(in *Incident, out *monitoring.Incident, s conversion.Scope) error { - return autoConvert_v1alpha1_Incident_To_monitoring_Incident(in, out, s) -} - -func autoConvert_monitoring_Incident_To_v1alpha1_Incident(in *monitoring.Incident, out *Incident, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_monitoring_IncidentStatus_To_v1alpha1_IncidentStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_monitoring_Incident_To_v1alpha1_Incident is an autogenerated conversion function. -func Convert_monitoring_Incident_To_v1alpha1_Incident(in *monitoring.Incident, out *Incident, s conversion.Scope) error { - return autoConvert_monitoring_Incident_To_v1alpha1_Incident(in, out, s) -} - -func autoConvert_v1alpha1_IncidentList_To_monitoring_IncidentList(in *IncidentList, out *monitoring.IncidentList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]monitoring.Incident)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_IncidentList_To_monitoring_IncidentList is an autogenerated conversion function. -func Convert_v1alpha1_IncidentList_To_monitoring_IncidentList(in *IncidentList, out *monitoring.IncidentList, s conversion.Scope) error { - return autoConvert_v1alpha1_IncidentList_To_monitoring_IncidentList(in, out, s) -} - -func autoConvert_monitoring_IncidentList_To_v1alpha1_IncidentList(in *monitoring.IncidentList, out *IncidentList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]Incident)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_monitoring_IncidentList_To_v1alpha1_IncidentList is an autogenerated conversion function. -func Convert_monitoring_IncidentList_To_v1alpha1_IncidentList(in *monitoring.IncidentList, out *IncidentList, s conversion.Scope) error { - return autoConvert_monitoring_IncidentList_To_v1alpha1_IncidentList(in, out, s) -} - -func autoConvert_v1alpha1_IncidentNotification_To_monitoring_IncidentNotification(in *IncidentNotification, out *monitoring.IncidentNotification, s conversion.Scope) error { - out.Type = monitoring.IncidentNotificationType(in.Type) - out.CheckOutput = in.CheckOutput - out.Author = (*string)(unsafe.Pointer(in.Author)) - out.Comment = (*string)(unsafe.Pointer(in.Comment)) - out.FirstTimestamp = in.FirstTimestamp - out.LastTimestamp = in.LastTimestamp - out.LastState = in.LastState - return nil -} - -// Convert_v1alpha1_IncidentNotification_To_monitoring_IncidentNotification is an autogenerated conversion function. -func Convert_v1alpha1_IncidentNotification_To_monitoring_IncidentNotification(in *IncidentNotification, out *monitoring.IncidentNotification, s conversion.Scope) error { - return autoConvert_v1alpha1_IncidentNotification_To_monitoring_IncidentNotification(in, out, s) -} - -func autoConvert_monitoring_IncidentNotification_To_v1alpha1_IncidentNotification(in *monitoring.IncidentNotification, out *IncidentNotification, s conversion.Scope) error { - out.Type = IncidentNotificationType(in.Type) - out.CheckOutput = in.CheckOutput - out.Author = (*string)(unsafe.Pointer(in.Author)) - out.Comment = (*string)(unsafe.Pointer(in.Comment)) - out.FirstTimestamp = in.FirstTimestamp - out.LastTimestamp = in.LastTimestamp - out.LastState = in.LastState - return nil -} - -// Convert_monitoring_IncidentNotification_To_v1alpha1_IncidentNotification is an autogenerated conversion function. -func Convert_monitoring_IncidentNotification_To_v1alpha1_IncidentNotification(in *monitoring.IncidentNotification, out *IncidentNotification, s conversion.Scope) error { - return autoConvert_monitoring_IncidentNotification_To_v1alpha1_IncidentNotification(in, out, s) -} - -func autoConvert_v1alpha1_IncidentStatus_To_monitoring_IncidentStatus(in *IncidentStatus, out *monitoring.IncidentStatus, s conversion.Scope) error { - out.LastNotificationType = monitoring.IncidentNotificationType(in.LastNotificationType) - out.Notifications = *(*[]monitoring.IncidentNotification)(unsafe.Pointer(&in.Notifications)) - return nil -} - -// Convert_v1alpha1_IncidentStatus_To_monitoring_IncidentStatus is an autogenerated conversion function. -func Convert_v1alpha1_IncidentStatus_To_monitoring_IncidentStatus(in *IncidentStatus, out *monitoring.IncidentStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_IncidentStatus_To_monitoring_IncidentStatus(in, out, s) -} - -func autoConvert_monitoring_IncidentStatus_To_v1alpha1_IncidentStatus(in *monitoring.IncidentStatus, out *IncidentStatus, s conversion.Scope) error { - out.LastNotificationType = IncidentNotificationType(in.LastNotificationType) - out.Notifications = *(*[]IncidentNotification)(unsafe.Pointer(&in.Notifications)) - return nil -} - -// Convert_monitoring_IncidentStatus_To_v1alpha1_IncidentStatus is an autogenerated conversion function. -func Convert_monitoring_IncidentStatus_To_v1alpha1_IncidentStatus(in *monitoring.IncidentStatus, out *IncidentStatus, s conversion.Scope) error { - return autoConvert_monitoring_IncidentStatus_To_v1alpha1_IncidentStatus(in, out, s) -} - -func autoConvert_v1alpha1_NodeAlert_To_monitoring_NodeAlert(in *NodeAlert, out *monitoring.NodeAlert, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_NodeAlertSpec_To_monitoring_NodeAlertSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_NodeAlert_To_monitoring_NodeAlert is an autogenerated conversion function. -func Convert_v1alpha1_NodeAlert_To_monitoring_NodeAlert(in *NodeAlert, out *monitoring.NodeAlert, s conversion.Scope) error { - return autoConvert_v1alpha1_NodeAlert_To_monitoring_NodeAlert(in, out, s) -} - -func autoConvert_monitoring_NodeAlert_To_v1alpha1_NodeAlert(in *monitoring.NodeAlert, out *NodeAlert, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_monitoring_NodeAlertSpec_To_v1alpha1_NodeAlertSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_monitoring_NodeAlert_To_v1alpha1_NodeAlert is an autogenerated conversion function. -func Convert_monitoring_NodeAlert_To_v1alpha1_NodeAlert(in *monitoring.NodeAlert, out *NodeAlert, s conversion.Scope) error { - return autoConvert_monitoring_NodeAlert_To_v1alpha1_NodeAlert(in, out, s) -} - -func autoConvert_v1alpha1_NodeAlertList_To_monitoring_NodeAlertList(in *NodeAlertList, out *monitoring.NodeAlertList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]monitoring.NodeAlert)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_NodeAlertList_To_monitoring_NodeAlertList is an autogenerated conversion function. -func Convert_v1alpha1_NodeAlertList_To_monitoring_NodeAlertList(in *NodeAlertList, out *monitoring.NodeAlertList, s conversion.Scope) error { - return autoConvert_v1alpha1_NodeAlertList_To_monitoring_NodeAlertList(in, out, s) -} - -func autoConvert_monitoring_NodeAlertList_To_v1alpha1_NodeAlertList(in *monitoring.NodeAlertList, out *NodeAlertList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]NodeAlert)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_monitoring_NodeAlertList_To_v1alpha1_NodeAlertList is an autogenerated conversion function. -func Convert_monitoring_NodeAlertList_To_v1alpha1_NodeAlertList(in *monitoring.NodeAlertList, out *NodeAlertList, s conversion.Scope) error { - return autoConvert_monitoring_NodeAlertList_To_v1alpha1_NodeAlertList(in, out, s) -} - -func autoConvert_v1alpha1_NodeAlertSpec_To_monitoring_NodeAlertSpec(in *NodeAlertSpec, out *monitoring.NodeAlertSpec, s conversion.Scope) error { - out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) - out.NodeName = (*string)(unsafe.Pointer(in.NodeName)) - out.Check = monitoring.CheckNode(in.Check) - out.CheckInterval = in.CheckInterval - out.AlertInterval = in.AlertInterval - out.NotifierSecretName = in.NotifierSecretName - out.Receivers = *(*[]monitoring.Receiver)(unsafe.Pointer(&in.Receivers)) - out.Vars = *(*map[string]string)(unsafe.Pointer(&in.Vars)) - return nil -} - -// Convert_v1alpha1_NodeAlertSpec_To_monitoring_NodeAlertSpec is an autogenerated conversion function. -func Convert_v1alpha1_NodeAlertSpec_To_monitoring_NodeAlertSpec(in *NodeAlertSpec, out *monitoring.NodeAlertSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_NodeAlertSpec_To_monitoring_NodeAlertSpec(in, out, s) -} - -func autoConvert_monitoring_NodeAlertSpec_To_v1alpha1_NodeAlertSpec(in *monitoring.NodeAlertSpec, out *NodeAlertSpec, s conversion.Scope) error { - out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) - out.NodeName = (*string)(unsafe.Pointer(in.NodeName)) - out.Check = CheckNode(in.Check) - out.CheckInterval = in.CheckInterval - out.AlertInterval = in.AlertInterval - out.NotifierSecretName = in.NotifierSecretName - out.Receivers = *(*[]Receiver)(unsafe.Pointer(&in.Receivers)) - out.Vars = *(*map[string]string)(unsafe.Pointer(&in.Vars)) - return nil -} - -// Convert_monitoring_NodeAlertSpec_To_v1alpha1_NodeAlertSpec is an autogenerated conversion function. -func Convert_monitoring_NodeAlertSpec_To_v1alpha1_NodeAlertSpec(in *monitoring.NodeAlertSpec, out *NodeAlertSpec, s conversion.Scope) error { - return autoConvert_monitoring_NodeAlertSpec_To_v1alpha1_NodeAlertSpec(in, out, s) -} - -func autoConvert_v1alpha1_PodAlert_To_monitoring_PodAlert(in *PodAlert, out *monitoring.PodAlert, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_PodAlertSpec_To_monitoring_PodAlertSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_PodAlert_To_monitoring_PodAlert is an autogenerated conversion function. -func Convert_v1alpha1_PodAlert_To_monitoring_PodAlert(in *PodAlert, out *monitoring.PodAlert, s conversion.Scope) error { - return autoConvert_v1alpha1_PodAlert_To_monitoring_PodAlert(in, out, s) -} - -func autoConvert_monitoring_PodAlert_To_v1alpha1_PodAlert(in *monitoring.PodAlert, out *PodAlert, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_monitoring_PodAlertSpec_To_v1alpha1_PodAlertSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_monitoring_PodAlert_To_v1alpha1_PodAlert is an autogenerated conversion function. -func Convert_monitoring_PodAlert_To_v1alpha1_PodAlert(in *monitoring.PodAlert, out *PodAlert, s conversion.Scope) error { - return autoConvert_monitoring_PodAlert_To_v1alpha1_PodAlert(in, out, s) -} - -func autoConvert_v1alpha1_PodAlertList_To_monitoring_PodAlertList(in *PodAlertList, out *monitoring.PodAlertList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]monitoring.PodAlert)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_PodAlertList_To_monitoring_PodAlertList is an autogenerated conversion function. -func Convert_v1alpha1_PodAlertList_To_monitoring_PodAlertList(in *PodAlertList, out *monitoring.PodAlertList, s conversion.Scope) error { - return autoConvert_v1alpha1_PodAlertList_To_monitoring_PodAlertList(in, out, s) -} - -func autoConvert_monitoring_PodAlertList_To_v1alpha1_PodAlertList(in *monitoring.PodAlertList, out *PodAlertList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]PodAlert)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_monitoring_PodAlertList_To_v1alpha1_PodAlertList is an autogenerated conversion function. -func Convert_monitoring_PodAlertList_To_v1alpha1_PodAlertList(in *monitoring.PodAlertList, out *PodAlertList, s conversion.Scope) error { - return autoConvert_monitoring_PodAlertList_To_v1alpha1_PodAlertList(in, out, s) -} - -func autoConvert_v1alpha1_PodAlertSpec_To_monitoring_PodAlertSpec(in *PodAlertSpec, out *monitoring.PodAlertSpec, s conversion.Scope) error { - out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) - out.PodName = (*string)(unsafe.Pointer(in.PodName)) - out.Check = monitoring.CheckPod(in.Check) - out.CheckInterval = in.CheckInterval - out.AlertInterval = in.AlertInterval - out.NotifierSecretName = in.NotifierSecretName - out.Receivers = *(*[]monitoring.Receiver)(unsafe.Pointer(&in.Receivers)) - out.Vars = *(*map[string]string)(unsafe.Pointer(&in.Vars)) - return nil -} - -// Convert_v1alpha1_PodAlertSpec_To_monitoring_PodAlertSpec is an autogenerated conversion function. -func Convert_v1alpha1_PodAlertSpec_To_monitoring_PodAlertSpec(in *PodAlertSpec, out *monitoring.PodAlertSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_PodAlertSpec_To_monitoring_PodAlertSpec(in, out, s) -} - -func autoConvert_monitoring_PodAlertSpec_To_v1alpha1_PodAlertSpec(in *monitoring.PodAlertSpec, out *PodAlertSpec, s conversion.Scope) error { - out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) - out.PodName = (*string)(unsafe.Pointer(in.PodName)) - out.Check = CheckPod(in.Check) - out.CheckInterval = in.CheckInterval - out.AlertInterval = in.AlertInterval - out.NotifierSecretName = in.NotifierSecretName - out.Receivers = *(*[]Receiver)(unsafe.Pointer(&in.Receivers)) - out.Vars = *(*map[string]string)(unsafe.Pointer(&in.Vars)) - return nil -} - -// Convert_monitoring_PodAlertSpec_To_v1alpha1_PodAlertSpec is an autogenerated conversion function. -func Convert_monitoring_PodAlertSpec_To_v1alpha1_PodAlertSpec(in *monitoring.PodAlertSpec, out *PodAlertSpec, s conversion.Scope) error { - return autoConvert_monitoring_PodAlertSpec_To_v1alpha1_PodAlertSpec(in, out, s) -} - -func autoConvert_v1alpha1_Receiver_To_monitoring_Receiver(in *Receiver, out *monitoring.Receiver, s conversion.Scope) error { - out.State = in.State - out.To = *(*[]string)(unsafe.Pointer(&in.To)) - out.Notifier = in.Notifier - return nil -} - -// Convert_v1alpha1_Receiver_To_monitoring_Receiver is an autogenerated conversion function. -func Convert_v1alpha1_Receiver_To_monitoring_Receiver(in *Receiver, out *monitoring.Receiver, s conversion.Scope) error { - return autoConvert_v1alpha1_Receiver_To_monitoring_Receiver(in, out, s) -} - -func autoConvert_monitoring_Receiver_To_v1alpha1_Receiver(in *monitoring.Receiver, out *Receiver, s conversion.Scope) error { - out.State = in.State - out.To = *(*[]string)(unsafe.Pointer(&in.To)) - out.Notifier = in.Notifier - return nil -} - -// Convert_monitoring_Receiver_To_v1alpha1_Receiver is an autogenerated conversion function. -func Convert_monitoring_Receiver_To_v1alpha1_Receiver(in *monitoring.Receiver, out *Receiver, s conversion.Scope) error { - return autoConvert_monitoring_Receiver_To_v1alpha1_Receiver(in, out, s) -} diff --git a/apis/monitoring/v1alpha1/zz_generated.defaults.go b/apis/monitoring/v1alpha1/zz_generated.defaults.go deleted file mode 100644 index 6faf73376..000000000 --- a/apis/monitoring/v1alpha1/zz_generated.defaults.go +++ /dev/null @@ -1,32 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by defaulter-gen. Do not edit it manually! - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - return nil -} diff --git a/apis/monitoring/zz_generated.deepcopy.go b/apis/monitoring/zz_generated.deepcopy.go deleted file mode 100644 index b86428282..000000000 --- a/apis/monitoring/zz_generated.deepcopy.go +++ /dev/null @@ -1,484 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by deepcopy-gen. Do not edit it manually! - -package monitoring - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - 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 *ClusterAlert) DeepCopyInto(out *ClusterAlert) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlert. -func (in *ClusterAlert) DeepCopy() *ClusterAlert { - if in == nil { - return nil - } - out := new(ClusterAlert) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAlert) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterAlertList) DeepCopyInto(out *ClusterAlertList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterAlert, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertList. -func (in *ClusterAlertList) DeepCopy() *ClusterAlertList { - if in == nil { - return nil - } - out := new(ClusterAlertList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAlertList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterAlertSpec) DeepCopyInto(out *ClusterAlertSpec) { - *out = *in - out.CheckInterval = in.CheckInterval - out.AlertInterval = in.AlertInterval - if in.Receivers != nil { - in, out := &in.Receivers, &out.Receivers - *out = make([]Receiver, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Vars != nil { - in, out := &in.Vars, &out.Vars - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertSpec. -func (in *ClusterAlertSpec) DeepCopy() *ClusterAlertSpec { - if in == nil { - return nil - } - out := new(ClusterAlertSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Incident) DeepCopyInto(out *Incident) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Incident. -func (in *Incident) DeepCopy() *Incident { - if in == nil { - return nil - } - out := new(Incident) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Incident) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IncidentList) DeepCopyInto(out *IncidentList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Incident, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncidentList. -func (in *IncidentList) DeepCopy() *IncidentList { - if in == nil { - return nil - } - out := new(IncidentList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IncidentList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IncidentNotification) DeepCopyInto(out *IncidentNotification) { - *out = *in - if in.Author != nil { - in, out := &in.Author, &out.Author - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } - } - if in.Comment != nil { - in, out := &in.Comment, &out.Comment - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } - } - in.FirstTimestamp.DeepCopyInto(&out.FirstTimestamp) - in.LastTimestamp.DeepCopyInto(&out.LastTimestamp) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncidentNotification. -func (in *IncidentNotification) DeepCopy() *IncidentNotification { - if in == nil { - return nil - } - out := new(IncidentNotification) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IncidentStatus) DeepCopyInto(out *IncidentStatus) { - *out = *in - if in.Notifications != nil { - in, out := &in.Notifications, &out.Notifications - *out = make([]IncidentNotification, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncidentStatus. -func (in *IncidentStatus) DeepCopy() *IncidentStatus { - if in == nil { - return nil - } - out := new(IncidentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAlert) DeepCopyInto(out *NodeAlert) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAlert. -func (in *NodeAlert) DeepCopy() *NodeAlert { - if in == nil { - return nil - } - out := new(NodeAlert) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeAlert) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAlertList) DeepCopyInto(out *NodeAlertList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NodeAlert, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAlertList. -func (in *NodeAlertList) DeepCopy() *NodeAlertList { - if in == nil { - return nil - } - out := new(NodeAlertList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeAlertList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAlertSpec) DeepCopyInto(out *NodeAlertSpec) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NodeName != nil { - in, out := &in.NodeName, &out.NodeName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } - } - out.CheckInterval = in.CheckInterval - out.AlertInterval = in.AlertInterval - if in.Receivers != nil { - in, out := &in.Receivers, &out.Receivers - *out = make([]Receiver, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Vars != nil { - in, out := &in.Vars, &out.Vars - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAlertSpec. -func (in *NodeAlertSpec) DeepCopy() *NodeAlertSpec { - if in == nil { - return nil - } - out := new(NodeAlertSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodAlert) DeepCopyInto(out *PodAlert) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodAlert. -func (in *PodAlert) DeepCopy() *PodAlert { - if in == nil { - return nil - } - out := new(PodAlert) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodAlert) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodAlertList) DeepCopyInto(out *PodAlertList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodAlert, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodAlertList. -func (in *PodAlertList) DeepCopy() *PodAlertList { - if in == nil { - return nil - } - out := new(PodAlertList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodAlertList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodAlertSpec) DeepCopyInto(out *PodAlertSpec) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - if *in == nil { - *out = nil - } else { - *out = new(v1.LabelSelector) - (*in).DeepCopyInto(*out) - } - } - if in.PodName != nil { - in, out := &in.PodName, &out.PodName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } - } - out.CheckInterval = in.CheckInterval - out.AlertInterval = in.AlertInterval - if in.Receivers != nil { - in, out := &in.Receivers, &out.Receivers - *out = make([]Receiver, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Vars != nil { - in, out := &in.Vars, &out.Vars - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodAlertSpec. -func (in *PodAlertSpec) DeepCopy() *PodAlertSpec { - if in == nil { - return nil - } - out := new(PodAlertSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Receiver) DeepCopyInto(out *Receiver) { - *out = *in - if in.To != nil { - in, out := &in.To, &out.To - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Receiver. -func (in *Receiver) DeepCopy() *Receiver { - if in == nil { - return nil - } - out := new(Receiver) - in.DeepCopyInto(out) - return out -} diff --git a/client/clientset/internalversion/clientset.go b/client/clientset/internalversion/clientset.go deleted file mode 100644 index 027b3eb8c..000000000 --- a/client/clientset/internalversion/clientset.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -import ( - incidentsinternalversion "github.com/appscode/searchlight/client/clientset/internalversion/typed/incidents/internalversion" - monitoringinternalversion "github.com/appscode/searchlight/client/clientset/internalversion/typed/monitoring/internalversion" - glog "github.com/golang/glog" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - Incidents() incidentsinternalversion.IncidentsInterface - Monitoring() monitoringinternalversion.MonitoringInterface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - incidents *incidentsinternalversion.IncidentsClient - monitoring *monitoringinternalversion.MonitoringClient -} - -// Incidents retrieves the IncidentsClient -func (c *Clientset) Incidents() incidentsinternalversion.IncidentsInterface { - return c.incidents -} - -// Monitoring retrieves the MonitoringClient -func (c *Clientset) Monitoring() monitoringinternalversion.MonitoringInterface { - return c.monitoring -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.incidents, err = incidentsinternalversion.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.monitoring, err = monitoringinternalversion.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - glog.Errorf("failed to create the DiscoveryClient: %v", err) - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.incidents = incidentsinternalversion.NewForConfigOrDie(c) - cs.monitoring = monitoringinternalversion.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.incidents = incidentsinternalversion.New(c) - cs.monitoring = monitoringinternalversion.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/client/clientset/internalversion/doc.go b/client/clientset/internalversion/doc.go deleted file mode 100644 index df1855ac3..000000000 --- a/client/clientset/internalversion/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated clientset. -package internalversion diff --git a/client/clientset/internalversion/fake/clientset_generated.go b/client/clientset/internalversion/fake/clientset_generated.go deleted file mode 100644 index 3bebbe58c..000000000 --- a/client/clientset/internalversion/fake/clientset_generated.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - clientset "github.com/appscode/searchlight/client/clientset/internalversion" - incidentsinternalversion "github.com/appscode/searchlight/client/clientset/internalversion/typed/incidents/internalversion" - fakeincidentsinternalversion "github.com/appscode/searchlight/client/clientset/internalversion/typed/incidents/internalversion/fake" - monitoringinternalversion "github.com/appscode/searchlight/client/clientset/internalversion/typed/monitoring/internalversion" - fakemonitoringinternalversion "github.com/appscode/searchlight/client/clientset/internalversion/typed/monitoring/internalversion/fake" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - fakePtr := testing.Fake{} - fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) - - return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -var _ clientset.Interface = &Clientset{} - -// Incidents retrieves the IncidentsClient -func (c *Clientset) Incidents() incidentsinternalversion.IncidentsInterface { - return &fakeincidentsinternalversion.FakeIncidents{Fake: &c.Fake} -} - -// Monitoring retrieves the MonitoringClient -func (c *Clientset) Monitoring() monitoringinternalversion.MonitoringInterface { - return &fakemonitoringinternalversion.FakeMonitoring{Fake: &c.Fake} -} diff --git a/client/clientset/internalversion/fake/doc.go b/client/clientset/internalversion/fake/doc.go deleted file mode 100644 index 1604310af..000000000 --- a/client/clientset/internalversion/fake/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated fake clientset. -package fake diff --git a/client/clientset/internalversion/fake/register.go b/client/clientset/internalversion/fake/register.go deleted file mode 100644 index 50f70e5f5..000000000 --- a/client/clientset/internalversion/fake/register.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - incidentsinternalversion "github.com/appscode/searchlight/apis/incidents" - monitoringinternalversion "github.com/appscode/searchlight/apis/monitoring" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(scheme) -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -func AddToScheme(scheme *runtime.Scheme) { - incidentsinternalversion.AddToScheme(scheme) - monitoringinternalversion.AddToScheme(scheme) - -} diff --git a/client/clientset/internalversion/scheme/doc.go b/client/clientset/internalversion/scheme/doc.go deleted file mode 100644 index 86a26dbd1..000000000 --- a/client/clientset/internalversion/scheme/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/client/clientset/internalversion/scheme/register.go b/client/clientset/internalversion/scheme/register.go deleted file mode 100644 index a0b45bad2..000000000 --- a/client/clientset/internalversion/scheme/register.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package scheme - -import ( - os "os" - - incidents "github.com/appscode/searchlight/apis/incidents/install" - monitoring "github.com/appscode/searchlight/apis/monitoring/install" - announced "k8s.io/apimachinery/pkg/apimachinery/announced" - registered "k8s.io/apimachinery/pkg/apimachinery/registered" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) - -var Registry = registered.NewOrDie(os.Getenv("KUBE_API_VERSIONS")) -var GroupFactoryRegistry = make(announced.APIGroupFactoryRegistry) - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - Install(GroupFactoryRegistry, Registry, Scheme) -} - -// Install registers the API group and adds types to a scheme -func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) { - incidents.Install(groupFactoryRegistry, registry, scheme) - monitoring.Install(groupFactoryRegistry, registry, scheme) - -} diff --git a/client/clientset/internalversion/typed/incidents/internalversion/acknowledgement.go b/client/clientset/internalversion/typed/incidents/internalversion/acknowledgement.go deleted file mode 100644 index 51341fab2..000000000 --- a/client/clientset/internalversion/typed/incidents/internalversion/acknowledgement.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -import ( - incidents "github.com/appscode/searchlight/apis/incidents" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" -) - -// AcknowledgementsGetter has a method to return a AcknowledgementInterface. -// A group's client should implement this interface. -type AcknowledgementsGetter interface { - Acknowledgements(namespace string) AcknowledgementInterface -} - -// AcknowledgementInterface has methods to work with Acknowledgement resources. -type AcknowledgementInterface interface { - Create(*incidents.Acknowledgement) (*incidents.Acknowledgement, error) - Delete(name string, options *v1.DeleteOptions) error - AcknowledgementExpansion -} - -// acknowledgements implements AcknowledgementInterface -type acknowledgements struct { - client rest.Interface - ns string -} - -// newAcknowledgements returns a Acknowledgements -func newAcknowledgements(c *IncidentsClient, namespace string) *acknowledgements { - return &acknowledgements{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Create takes the representation of a acknowledgement and creates it. Returns the server's representation of the acknowledgement, and an error, if there is any. -func (c *acknowledgements) Create(acknowledgement *incidents.Acknowledgement) (result *incidents.Acknowledgement, err error) { - result = &incidents.Acknowledgement{} - err = c.client.Post(). - Namespace(c.ns). - Resource("acknowledgements"). - Body(acknowledgement). - Do(). - Into(result) - return -} - -// Delete takes name of the acknowledgement and deletes it. Returns an error if one occurs. -func (c *acknowledgements) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("acknowledgements"). - Name(name). - Body(options). - Do(). - Error() -} diff --git a/client/clientset/internalversion/typed/incidents/internalversion/doc.go b/client/clientset/internalversion/typed/incidents/internalversion/doc.go deleted file mode 100644 index e4fa50541..000000000 --- a/client/clientset/internalversion/typed/incidents/internalversion/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated typed clients. -package internalversion diff --git a/client/clientset/internalversion/typed/incidents/internalversion/fake/doc.go b/client/clientset/internalversion/typed/incidents/internalversion/fake/doc.go deleted file mode 100644 index fae9dcda9..000000000 --- a/client/clientset/internalversion/typed/incidents/internalversion/fake/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package fake has the automatically generated clients. -package fake diff --git a/client/clientset/internalversion/typed/incidents/internalversion/fake/fake_acknowledgement.go b/client/clientset/internalversion/typed/incidents/internalversion/fake/fake_acknowledgement.go deleted file mode 100644 index e751f9676..000000000 --- a/client/clientset/internalversion/typed/incidents/internalversion/fake/fake_acknowledgement.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - incidents "github.com/appscode/searchlight/apis/incidents" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" - testing "k8s.io/client-go/testing" -) - -// FakeAcknowledgements implements AcknowledgementInterface -type FakeAcknowledgements struct { - Fake *FakeIncidents - ns string -} - -var acknowledgementsResource = schema.GroupVersionResource{Group: "incidents.monitoring.appscode.com", Version: "", Resource: "acknowledgements"} - -var acknowledgementsKind = schema.GroupVersionKind{Group: "incidents.monitoring.appscode.com", Version: "", Kind: "Acknowledgement"} - -// Create takes the representation of a acknowledgement and creates it. Returns the server's representation of the acknowledgement, and an error, if there is any. -func (c *FakeAcknowledgements) Create(acknowledgement *incidents.Acknowledgement) (result *incidents.Acknowledgement, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(acknowledgementsResource, c.ns, acknowledgement), &incidents.Acknowledgement{}) - - if obj == nil { - return nil, err - } - return obj.(*incidents.Acknowledgement), err -} - -// Delete takes name of the acknowledgement and deletes it. Returns an error if one occurs. -func (c *FakeAcknowledgements) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(acknowledgementsResource, c.ns, name), &incidents.Acknowledgement{}) - - return err -} diff --git a/client/clientset/internalversion/typed/incidents/internalversion/fake/fake_incidents_client.go b/client/clientset/internalversion/typed/incidents/internalversion/fake/fake_incidents_client.go deleted file mode 100644 index d6ba37b99..000000000 --- a/client/clientset/internalversion/typed/incidents/internalversion/fake/fake_incidents_client.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - internalversion "github.com/appscode/searchlight/client/clientset/internalversion/typed/incidents/internalversion" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeIncidents struct { - *testing.Fake -} - -func (c *FakeIncidents) Acknowledgements(namespace string) internalversion.AcknowledgementInterface { - return &FakeAcknowledgements{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeIncidents) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/client/clientset/internalversion/typed/incidents/internalversion/generated_expansion.go b/client/clientset/internalversion/typed/incidents/internalversion/generated_expansion.go deleted file mode 100644 index a10a71fc0..000000000 --- a/client/clientset/internalversion/typed/incidents/internalversion/generated_expansion.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -type AcknowledgementExpansion interface{} diff --git a/client/clientset/internalversion/typed/incidents/internalversion/incidents_client.go b/client/clientset/internalversion/typed/incidents/internalversion/incidents_client.go deleted file mode 100644 index 3f7166d8c..000000000 --- a/client/clientset/internalversion/typed/incidents/internalversion/incidents_client.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -import ( - "github.com/appscode/searchlight/client/clientset/internalversion/scheme" - rest "k8s.io/client-go/rest" -) - -type IncidentsInterface interface { - RESTClient() rest.Interface - AcknowledgementsGetter -} - -// IncidentsClient is used to interact with features provided by the incidents.monitoring.appscode.com group. -type IncidentsClient struct { - restClient rest.Interface -} - -func (c *IncidentsClient) Acknowledgements(namespace string) AcknowledgementInterface { - return newAcknowledgements(c, namespace) -} - -// NewForConfig creates a new IncidentsClient for the given config. -func NewForConfig(c *rest.Config) (*IncidentsClient, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &IncidentsClient{client}, nil -} - -// NewForConfigOrDie creates a new IncidentsClient for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *IncidentsClient { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new IncidentsClient for the given RESTClient. -func New(c rest.Interface) *IncidentsClient { - return &IncidentsClient{c} -} - -func setConfigDefaults(config *rest.Config) error { - g, err := scheme.Registry.Group("incidents.monitoring.appscode.com") - if err != nil { - return err - } - - config.APIPath = "/apis" - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - if config.GroupVersion == nil || config.GroupVersion.Group != g.GroupVersion.Group { - gv := g.GroupVersion - config.GroupVersion = &gv - } - config.NegotiatedSerializer = scheme.Codecs - - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *IncidentsClient) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/clusteralert.go b/client/clientset/internalversion/typed/monitoring/internalversion/clusteralert.go deleted file mode 100644 index b6e3172e9..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/clusteralert.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - scheme "github.com/appscode/searchlight/client/clientset/internalversion/scheme" - v1 "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" -) - -// ClusterAlertsGetter has a method to return a ClusterAlertInterface. -// A group's client should implement this interface. -type ClusterAlertsGetter interface { - ClusterAlerts(namespace string) ClusterAlertInterface -} - -// ClusterAlertInterface has methods to work with ClusterAlert resources. -type ClusterAlertInterface interface { - Create(*monitoring.ClusterAlert) (*monitoring.ClusterAlert, error) - Update(*monitoring.ClusterAlert) (*monitoring.ClusterAlert, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*monitoring.ClusterAlert, error) - List(opts v1.ListOptions) (*monitoring.ClusterAlertList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.ClusterAlert, err error) - ClusterAlertExpansion -} - -// clusterAlerts implements ClusterAlertInterface -type clusterAlerts struct { - client rest.Interface - ns string -} - -// newClusterAlerts returns a ClusterAlerts -func newClusterAlerts(c *MonitoringClient, namespace string) *clusterAlerts { - return &clusterAlerts{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the clusterAlert, and returns the corresponding clusterAlert object, and an error if there is any. -func (c *clusterAlerts) Get(name string, options v1.GetOptions) (result *monitoring.ClusterAlert, err error) { - result = &monitoring.ClusterAlert{} - err = c.client.Get(). - Namespace(c.ns). - Resource("clusteralerts"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterAlerts that match those selectors. -func (c *clusterAlerts) List(opts v1.ListOptions) (result *monitoring.ClusterAlertList, err error) { - result = &monitoring.ClusterAlertList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("clusteralerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterAlerts. -func (c *clusterAlerts) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("clusteralerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a clusterAlert and creates it. Returns the server's representation of the clusterAlert, and an error, if there is any. -func (c *clusterAlerts) Create(clusterAlert *monitoring.ClusterAlert) (result *monitoring.ClusterAlert, err error) { - result = &monitoring.ClusterAlert{} - err = c.client.Post(). - Namespace(c.ns). - Resource("clusteralerts"). - Body(clusterAlert). - Do(). - Into(result) - return -} - -// Update takes the representation of a clusterAlert and updates it. Returns the server's representation of the clusterAlert, and an error, if there is any. -func (c *clusterAlerts) Update(clusterAlert *monitoring.ClusterAlert) (result *monitoring.ClusterAlert, err error) { - result = &monitoring.ClusterAlert{} - err = c.client.Put(). - Namespace(c.ns). - Resource("clusteralerts"). - Name(clusterAlert.Name). - Body(clusterAlert). - Do(). - Into(result) - return -} - -// Delete takes name of the clusterAlert and deletes it. Returns an error if one occurs. -func (c *clusterAlerts) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("clusteralerts"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterAlerts) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("clusteralerts"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched clusterAlert. -func (c *clusterAlerts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.ClusterAlert, err error) { - result = &monitoring.ClusterAlert{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("clusteralerts"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/doc.go b/client/clientset/internalversion/typed/monitoring/internalversion/doc.go deleted file mode 100644 index e4fa50541..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated typed clients. -package internalversion diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/fake/doc.go b/client/clientset/internalversion/typed/monitoring/internalversion/fake/doc.go deleted file mode 100644 index fae9dcda9..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/fake/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package fake has the automatically generated clients. -package fake diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_clusteralert.go b/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_clusteralert.go deleted file mode 100644 index 1b6144540..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_clusteralert.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeClusterAlerts implements ClusterAlertInterface -type FakeClusterAlerts struct { - Fake *FakeMonitoring - ns string -} - -var clusteralertsResource = schema.GroupVersionResource{Group: "monitoring.appscode.com", Version: "", Resource: "clusteralerts"} - -var clusteralertsKind = schema.GroupVersionKind{Group: "monitoring.appscode.com", Version: "", Kind: "ClusterAlert"} - -// Get takes name of the clusterAlert, and returns the corresponding clusterAlert object, and an error if there is any. -func (c *FakeClusterAlerts) Get(name string, options v1.GetOptions) (result *monitoring.ClusterAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(clusteralertsResource, c.ns, name), &monitoring.ClusterAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.ClusterAlert), err -} - -// List takes label and field selectors, and returns the list of ClusterAlerts that match those selectors. -func (c *FakeClusterAlerts) List(opts v1.ListOptions) (result *monitoring.ClusterAlertList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(clusteralertsResource, clusteralertsKind, c.ns, opts), &monitoring.ClusterAlertList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &monitoring.ClusterAlertList{} - for _, item := range obj.(*monitoring.ClusterAlertList).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 clusterAlerts. -func (c *FakeClusterAlerts) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(clusteralertsResource, c.ns, opts)) - -} - -// Create takes the representation of a clusterAlert and creates it. Returns the server's representation of the clusterAlert, and an error, if there is any. -func (c *FakeClusterAlerts) Create(clusterAlert *monitoring.ClusterAlert) (result *monitoring.ClusterAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(clusteralertsResource, c.ns, clusterAlert), &monitoring.ClusterAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.ClusterAlert), err -} - -// Update takes the representation of a clusterAlert and updates it. Returns the server's representation of the clusterAlert, and an error, if there is any. -func (c *FakeClusterAlerts) Update(clusterAlert *monitoring.ClusterAlert) (result *monitoring.ClusterAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(clusteralertsResource, c.ns, clusterAlert), &monitoring.ClusterAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.ClusterAlert), err -} - -// Delete takes name of the clusterAlert and deletes it. Returns an error if one occurs. -func (c *FakeClusterAlerts) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(clusteralertsResource, c.ns, name), &monitoring.ClusterAlert{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterAlerts) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(clusteralertsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &monitoring.ClusterAlertList{}) - return err -} - -// Patch applies the patch and returns the patched clusterAlert. -func (c *FakeClusterAlerts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.ClusterAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(clusteralertsResource, c.ns, name, data, subresources...), &monitoring.ClusterAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.ClusterAlert), err -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_incident.go b/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_incident.go deleted file mode 100644 index 1bca0d260..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_incident.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeIncidents implements IncidentInterface -type FakeIncidents struct { - Fake *FakeMonitoring - ns string -} - -var incidentsResource = schema.GroupVersionResource{Group: "monitoring.appscode.com", Version: "", Resource: "incidents"} - -var incidentsKind = schema.GroupVersionKind{Group: "monitoring.appscode.com", Version: "", Kind: "Incident"} - -// Get takes name of the incident, and returns the corresponding incident object, and an error if there is any. -func (c *FakeIncidents) Get(name string, options v1.GetOptions) (result *monitoring.Incident, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(incidentsResource, c.ns, name), &monitoring.Incident{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.Incident), err -} - -// List takes label and field selectors, and returns the list of Incidents that match those selectors. -func (c *FakeIncidents) List(opts v1.ListOptions) (result *monitoring.IncidentList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(incidentsResource, incidentsKind, c.ns, opts), &monitoring.IncidentList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &monitoring.IncidentList{} - for _, item := range obj.(*monitoring.IncidentList).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 incidents. -func (c *FakeIncidents) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(incidentsResource, c.ns, opts)) - -} - -// Create takes the representation of a incident and creates it. Returns the server's representation of the incident, and an error, if there is any. -func (c *FakeIncidents) Create(incident *monitoring.Incident) (result *monitoring.Incident, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(incidentsResource, c.ns, incident), &monitoring.Incident{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.Incident), err -} - -// Update takes the representation of a incident and updates it. Returns the server's representation of the incident, and an error, if there is any. -func (c *FakeIncidents) Update(incident *monitoring.Incident) (result *monitoring.Incident, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(incidentsResource, c.ns, incident), &monitoring.Incident{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.Incident), err -} - -// Delete takes name of the incident and deletes it. Returns an error if one occurs. -func (c *FakeIncidents) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(incidentsResource, c.ns, name), &monitoring.Incident{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIncidents) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(incidentsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &monitoring.IncidentList{}) - return err -} - -// Patch applies the patch and returns the patched incident. -func (c *FakeIncidents) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.Incident, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(incidentsResource, c.ns, name, data, subresources...), &monitoring.Incident{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.Incident), err -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_monitoring_client.go b/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_monitoring_client.go deleted file mode 100644 index 38c42fded..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_monitoring_client.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - internalversion "github.com/appscode/searchlight/client/clientset/internalversion/typed/monitoring/internalversion" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeMonitoring struct { - *testing.Fake -} - -func (c *FakeMonitoring) ClusterAlerts(namespace string) internalversion.ClusterAlertInterface { - return &FakeClusterAlerts{c, namespace} -} - -func (c *FakeMonitoring) Incidents(namespace string) internalversion.IncidentInterface { - return &FakeIncidents{c, namespace} -} - -func (c *FakeMonitoring) NodeAlerts(namespace string) internalversion.NodeAlertInterface { - return &FakeNodeAlerts{c, namespace} -} - -func (c *FakeMonitoring) PodAlerts(namespace string) internalversion.PodAlertInterface { - return &FakePodAlerts{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeMonitoring) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_nodealert.go b/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_nodealert.go deleted file mode 100644 index 2569c76ad..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_nodealert.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeNodeAlerts implements NodeAlertInterface -type FakeNodeAlerts struct { - Fake *FakeMonitoring - ns string -} - -var nodealertsResource = schema.GroupVersionResource{Group: "monitoring.appscode.com", Version: "", Resource: "nodealerts"} - -var nodealertsKind = schema.GroupVersionKind{Group: "monitoring.appscode.com", Version: "", Kind: "NodeAlert"} - -// Get takes name of the nodeAlert, and returns the corresponding nodeAlert object, and an error if there is any. -func (c *FakeNodeAlerts) Get(name string, options v1.GetOptions) (result *monitoring.NodeAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(nodealertsResource, c.ns, name), &monitoring.NodeAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.NodeAlert), err -} - -// List takes label and field selectors, and returns the list of NodeAlerts that match those selectors. -func (c *FakeNodeAlerts) List(opts v1.ListOptions) (result *monitoring.NodeAlertList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(nodealertsResource, nodealertsKind, c.ns, opts), &monitoring.NodeAlertList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &monitoring.NodeAlertList{} - for _, item := range obj.(*monitoring.NodeAlertList).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 nodeAlerts. -func (c *FakeNodeAlerts) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(nodealertsResource, c.ns, opts)) - -} - -// Create takes the representation of a nodeAlert and creates it. Returns the server's representation of the nodeAlert, and an error, if there is any. -func (c *FakeNodeAlerts) Create(nodeAlert *monitoring.NodeAlert) (result *monitoring.NodeAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(nodealertsResource, c.ns, nodeAlert), &monitoring.NodeAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.NodeAlert), err -} - -// Update takes the representation of a nodeAlert and updates it. Returns the server's representation of the nodeAlert, and an error, if there is any. -func (c *FakeNodeAlerts) Update(nodeAlert *monitoring.NodeAlert) (result *monitoring.NodeAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(nodealertsResource, c.ns, nodeAlert), &monitoring.NodeAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.NodeAlert), err -} - -// Delete takes name of the nodeAlert and deletes it. Returns an error if one occurs. -func (c *FakeNodeAlerts) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(nodealertsResource, c.ns, name), &monitoring.NodeAlert{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeNodeAlerts) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(nodealertsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &monitoring.NodeAlertList{}) - return err -} - -// Patch applies the patch and returns the patched nodeAlert. -func (c *FakeNodeAlerts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.NodeAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(nodealertsResource, c.ns, name, data, subresources...), &monitoring.NodeAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.NodeAlert), err -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_podalert.go b/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_podalert.go deleted file mode 100644 index 58dc4af01..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/fake/fake_podalert.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakePodAlerts implements PodAlertInterface -type FakePodAlerts struct { - Fake *FakeMonitoring - ns string -} - -var podalertsResource = schema.GroupVersionResource{Group: "monitoring.appscode.com", Version: "", Resource: "podalerts"} - -var podalertsKind = schema.GroupVersionKind{Group: "monitoring.appscode.com", Version: "", Kind: "PodAlert"} - -// Get takes name of the podAlert, and returns the corresponding podAlert object, and an error if there is any. -func (c *FakePodAlerts) Get(name string, options v1.GetOptions) (result *monitoring.PodAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(podalertsResource, c.ns, name), &monitoring.PodAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.PodAlert), err -} - -// List takes label and field selectors, and returns the list of PodAlerts that match those selectors. -func (c *FakePodAlerts) List(opts v1.ListOptions) (result *monitoring.PodAlertList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(podalertsResource, podalertsKind, c.ns, opts), &monitoring.PodAlertList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &monitoring.PodAlertList{} - for _, item := range obj.(*monitoring.PodAlertList).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 podAlerts. -func (c *FakePodAlerts) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(podalertsResource, c.ns, opts)) - -} - -// Create takes the representation of a podAlert and creates it. Returns the server's representation of the podAlert, and an error, if there is any. -func (c *FakePodAlerts) Create(podAlert *monitoring.PodAlert) (result *monitoring.PodAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(podalertsResource, c.ns, podAlert), &monitoring.PodAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.PodAlert), err -} - -// Update takes the representation of a podAlert and updates it. Returns the server's representation of the podAlert, and an error, if there is any. -func (c *FakePodAlerts) Update(podAlert *monitoring.PodAlert) (result *monitoring.PodAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(podalertsResource, c.ns, podAlert), &monitoring.PodAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.PodAlert), err -} - -// Delete takes name of the podAlert and deletes it. Returns an error if one occurs. -func (c *FakePodAlerts) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(podalertsResource, c.ns, name), &monitoring.PodAlert{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePodAlerts) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(podalertsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &monitoring.PodAlertList{}) - return err -} - -// Patch applies the patch and returns the patched podAlert. -func (c *FakePodAlerts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.PodAlert, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podalertsResource, c.ns, name, data, subresources...), &monitoring.PodAlert{}) - - if obj == nil { - return nil, err - } - return obj.(*monitoring.PodAlert), err -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/generated_expansion.go b/client/clientset/internalversion/typed/monitoring/internalversion/generated_expansion.go deleted file mode 100644 index a137f5d6d..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/generated_expansion.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -type ClusterAlertExpansion interface{} - -type IncidentExpansion interface{} - -type NodeAlertExpansion interface{} - -type PodAlertExpansion interface{} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/incident.go b/client/clientset/internalversion/typed/monitoring/internalversion/incident.go deleted file mode 100644 index 49c7af89a..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/incident.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - scheme "github.com/appscode/searchlight/client/clientset/internalversion/scheme" - v1 "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" -) - -// IncidentsGetter has a method to return a IncidentInterface. -// A group's client should implement this interface. -type IncidentsGetter interface { - Incidents(namespace string) IncidentInterface -} - -// IncidentInterface has methods to work with Incident resources. -type IncidentInterface interface { - Create(*monitoring.Incident) (*monitoring.Incident, error) - Update(*monitoring.Incident) (*monitoring.Incident, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*monitoring.Incident, error) - List(opts v1.ListOptions) (*monitoring.IncidentList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.Incident, err error) - IncidentExpansion -} - -// incidents implements IncidentInterface -type incidents struct { - client rest.Interface - ns string -} - -// newIncidents returns a Incidents -func newIncidents(c *MonitoringClient, namespace string) *incidents { - return &incidents{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the incident, and returns the corresponding incident object, and an error if there is any. -func (c *incidents) Get(name string, options v1.GetOptions) (result *monitoring.Incident, err error) { - result = &monitoring.Incident{} - err = c.client.Get(). - Namespace(c.ns). - Resource("incidents"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Incidents that match those selectors. -func (c *incidents) List(opts v1.ListOptions) (result *monitoring.IncidentList, err error) { - result = &monitoring.IncidentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("incidents"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested incidents. -func (c *incidents) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("incidents"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a incident and creates it. Returns the server's representation of the incident, and an error, if there is any. -func (c *incidents) Create(incident *monitoring.Incident) (result *monitoring.Incident, err error) { - result = &monitoring.Incident{} - err = c.client.Post(). - Namespace(c.ns). - Resource("incidents"). - Body(incident). - Do(). - Into(result) - return -} - -// Update takes the representation of a incident and updates it. Returns the server's representation of the incident, and an error, if there is any. -func (c *incidents) Update(incident *monitoring.Incident) (result *monitoring.Incident, err error) { - result = &monitoring.Incident{} - err = c.client.Put(). - Namespace(c.ns). - Resource("incidents"). - Name(incident.Name). - Body(incident). - Do(). - Into(result) - return -} - -// Delete takes name of the incident and deletes it. Returns an error if one occurs. -func (c *incidents) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("incidents"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *incidents) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("incidents"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched incident. -func (c *incidents) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.Incident, err error) { - result = &monitoring.Incident{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("incidents"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/monitoring_client.go b/client/clientset/internalversion/typed/monitoring/internalversion/monitoring_client.go deleted file mode 100644 index 3a2e8101e..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/monitoring_client.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -import ( - "github.com/appscode/searchlight/client/clientset/internalversion/scheme" - rest "k8s.io/client-go/rest" -) - -type MonitoringInterface interface { - RESTClient() rest.Interface - ClusterAlertsGetter - IncidentsGetter - NodeAlertsGetter - PodAlertsGetter -} - -// MonitoringClient is used to interact with features provided by the monitoring.appscode.com group. -type MonitoringClient struct { - restClient rest.Interface -} - -func (c *MonitoringClient) ClusterAlerts(namespace string) ClusterAlertInterface { - return newClusterAlerts(c, namespace) -} - -func (c *MonitoringClient) Incidents(namespace string) IncidentInterface { - return newIncidents(c, namespace) -} - -func (c *MonitoringClient) NodeAlerts(namespace string) NodeAlertInterface { - return newNodeAlerts(c, namespace) -} - -func (c *MonitoringClient) PodAlerts(namespace string) PodAlertInterface { - return newPodAlerts(c, namespace) -} - -// NewForConfig creates a new MonitoringClient for the given config. -func NewForConfig(c *rest.Config) (*MonitoringClient, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &MonitoringClient{client}, nil -} - -// NewForConfigOrDie creates a new MonitoringClient for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *MonitoringClient { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new MonitoringClient for the given RESTClient. -func New(c rest.Interface) *MonitoringClient { - return &MonitoringClient{c} -} - -func setConfigDefaults(config *rest.Config) error { - g, err := scheme.Registry.Group("monitoring.appscode.com") - if err != nil { - return err - } - - config.APIPath = "/apis" - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - if config.GroupVersion == nil || config.GroupVersion.Group != g.GroupVersion.Group { - gv := g.GroupVersion - config.GroupVersion = &gv - } - config.NegotiatedSerializer = scheme.Codecs - - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *MonitoringClient) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/nodealert.go b/client/clientset/internalversion/typed/monitoring/internalversion/nodealert.go deleted file mode 100644 index e46cd5df8..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/nodealert.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - scheme "github.com/appscode/searchlight/client/clientset/internalversion/scheme" - v1 "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" -) - -// NodeAlertsGetter has a method to return a NodeAlertInterface. -// A group's client should implement this interface. -type NodeAlertsGetter interface { - NodeAlerts(namespace string) NodeAlertInterface -} - -// NodeAlertInterface has methods to work with NodeAlert resources. -type NodeAlertInterface interface { - Create(*monitoring.NodeAlert) (*monitoring.NodeAlert, error) - Update(*monitoring.NodeAlert) (*monitoring.NodeAlert, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*monitoring.NodeAlert, error) - List(opts v1.ListOptions) (*monitoring.NodeAlertList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.NodeAlert, err error) - NodeAlertExpansion -} - -// nodeAlerts implements NodeAlertInterface -type nodeAlerts struct { - client rest.Interface - ns string -} - -// newNodeAlerts returns a NodeAlerts -func newNodeAlerts(c *MonitoringClient, namespace string) *nodeAlerts { - return &nodeAlerts{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the nodeAlert, and returns the corresponding nodeAlert object, and an error if there is any. -func (c *nodeAlerts) Get(name string, options v1.GetOptions) (result *monitoring.NodeAlert, err error) { - result = &monitoring.NodeAlert{} - err = c.client.Get(). - Namespace(c.ns). - Resource("nodealerts"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NodeAlerts that match those selectors. -func (c *nodeAlerts) List(opts v1.ListOptions) (result *monitoring.NodeAlertList, err error) { - result = &monitoring.NodeAlertList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("nodealerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested nodeAlerts. -func (c *nodeAlerts) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("nodealerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a nodeAlert and creates it. Returns the server's representation of the nodeAlert, and an error, if there is any. -func (c *nodeAlerts) Create(nodeAlert *monitoring.NodeAlert) (result *monitoring.NodeAlert, err error) { - result = &monitoring.NodeAlert{} - err = c.client.Post(). - Namespace(c.ns). - Resource("nodealerts"). - Body(nodeAlert). - Do(). - Into(result) - return -} - -// Update takes the representation of a nodeAlert and updates it. Returns the server's representation of the nodeAlert, and an error, if there is any. -func (c *nodeAlerts) Update(nodeAlert *monitoring.NodeAlert) (result *monitoring.NodeAlert, err error) { - result = &monitoring.NodeAlert{} - err = c.client.Put(). - Namespace(c.ns). - Resource("nodealerts"). - Name(nodeAlert.Name). - Body(nodeAlert). - Do(). - Into(result) - return -} - -// Delete takes name of the nodeAlert and deletes it. Returns an error if one occurs. -func (c *nodeAlerts) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("nodealerts"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *nodeAlerts) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("nodealerts"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched nodeAlert. -func (c *nodeAlerts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.NodeAlert, err error) { - result = &monitoring.NodeAlert{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("nodealerts"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/client/clientset/internalversion/typed/monitoring/internalversion/podalert.go b/client/clientset/internalversion/typed/monitoring/internalversion/podalert.go deleted file mode 100644 index 4ef3e5763..000000000 --- a/client/clientset/internalversion/typed/monitoring/internalversion/podalert.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package internalversion - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - scheme "github.com/appscode/searchlight/client/clientset/internalversion/scheme" - v1 "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" -) - -// PodAlertsGetter has a method to return a PodAlertInterface. -// A group's client should implement this interface. -type PodAlertsGetter interface { - PodAlerts(namespace string) PodAlertInterface -} - -// PodAlertInterface has methods to work with PodAlert resources. -type PodAlertInterface interface { - Create(*monitoring.PodAlert) (*monitoring.PodAlert, error) - Update(*monitoring.PodAlert) (*monitoring.PodAlert, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*monitoring.PodAlert, error) - List(opts v1.ListOptions) (*monitoring.PodAlertList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.PodAlert, err error) - PodAlertExpansion -} - -// podAlerts implements PodAlertInterface -type podAlerts struct { - client rest.Interface - ns string -} - -// newPodAlerts returns a PodAlerts -func newPodAlerts(c *MonitoringClient, namespace string) *podAlerts { - return &podAlerts{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the podAlert, and returns the corresponding podAlert object, and an error if there is any. -func (c *podAlerts) Get(name string, options v1.GetOptions) (result *monitoring.PodAlert, err error) { - result = &monitoring.PodAlert{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podalerts"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PodAlerts that match those selectors. -func (c *podAlerts) List(opts v1.ListOptions) (result *monitoring.PodAlertList, err error) { - result = &monitoring.PodAlertList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podalerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested podAlerts. -func (c *podAlerts) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("podalerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a podAlert and creates it. Returns the server's representation of the podAlert, and an error, if there is any. -func (c *podAlerts) Create(podAlert *monitoring.PodAlert) (result *monitoring.PodAlert, err error) { - result = &monitoring.PodAlert{} - err = c.client.Post(). - Namespace(c.ns). - Resource("podalerts"). - Body(podAlert). - Do(). - Into(result) - return -} - -// Update takes the representation of a podAlert and updates it. Returns the server's representation of the podAlert, and an error, if there is any. -func (c *podAlerts) Update(podAlert *monitoring.PodAlert) (result *monitoring.PodAlert, err error) { - result = &monitoring.PodAlert{} - err = c.client.Put(). - Namespace(c.ns). - Resource("podalerts"). - Name(podAlert.Name). - Body(podAlert). - Do(). - Into(result) - return -} - -// Delete takes name of the podAlert and deletes it. Returns an error if one occurs. -func (c *podAlerts) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("podalerts"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *podAlerts) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("podalerts"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched podAlert. -func (c *podAlerts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *monitoring.PodAlert, err error) { - result = &monitoring.PodAlert{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("podalerts"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/client/informers/internalversion/factory.go b/client/informers/internalversion/factory.go deleted file mode 100644 index 37e5c7d06..000000000 --- a/client/informers/internalversion/factory.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package internalversion - -import ( - reflect "reflect" - sync "sync" - time "time" - - internalversion "github.com/appscode/searchlight/client/clientset/internalversion" - internalinterfaces "github.com/appscode/searchlight/client/informers/internalversion/internalinterfaces" - monitoring "github.com/appscode/searchlight/client/informers/internalversion/monitoring" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -type sharedInformerFactory struct { - client internalversion.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory -func NewSharedInformerFactory(client internalversion.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewFilteredSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -func NewFilteredSharedInformerFactory(client internalversion.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return &sharedInformerFactory{ - client: client, - namespace: namespace, - tweakListOptions: tweakListOptions, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - } -} - -// Start initializes all requested informers. -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - go informer.Run(stopCh) - f.startedInformers[informerType] = true - } - } -} - -// WaitForCacheSync waits for all started informers' cache were synced. -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - informer = newFunc(f.client, f.defaultResync) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - Monitoring() monitoring.Interface -} - -func (f *sharedInformerFactory) Monitoring() monitoring.Interface { - return monitoring.New(f, f.namespace, f.tweakListOptions) -} diff --git a/client/informers/internalversion/generic.go b/client/informers/internalversion/generic.go deleted file mode 100644 index 6c625de7e..000000000 --- a/client/informers/internalversion/generic.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package internalversion - -import ( - "fmt" - - monitoring "github.com/appscode/searchlight/apis/monitoring" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=monitoring.appscode.com, Version=internalVersion - case monitoring.SchemeGroupVersion.WithResource("clusteralerts"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Monitoring().InternalVersion().ClusterAlerts().Informer()}, nil - case monitoring.SchemeGroupVersion.WithResource("incidents"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Monitoring().InternalVersion().Incidents().Informer()}, nil - case monitoring.SchemeGroupVersion.WithResource("nodealerts"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Monitoring().InternalVersion().NodeAlerts().Informer()}, nil - case monitoring.SchemeGroupVersion.WithResource("podalerts"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Monitoring().InternalVersion().PodAlerts().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/client/informers/internalversion/internalinterfaces/factory_interfaces.go b/client/informers/internalversion/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 9a24e93e8..000000000 --- a/client/informers/internalversion/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package internalinterfaces - -import ( - time "time" - - internalversion "github.com/appscode/searchlight/client/clientset/internalversion" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" -) - -type NewInformerFunc func(internalversion.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/client/informers/internalversion/monitoring/interface.go b/client/informers/internalversion/monitoring/interface.go deleted file mode 100644 index c5f162a47..000000000 --- a/client/informers/internalversion/monitoring/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package monitoring - -import ( - internalinterfaces "github.com/appscode/searchlight/client/informers/internalversion/internalinterfaces" - internalversion "github.com/appscode/searchlight/client/informers/internalversion/monitoring/internalversion" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // InternalVersion provides access to shared informers for resources in InternalVersion. - InternalVersion() internalversion.Interface -} - -type group 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 &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// InternalVersion returns a new internalversion.Interface. -func (g *group) InternalVersion() internalversion.Interface { - return internalversion.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/client/informers/internalversion/monitoring/internalversion/clusteralert.go b/client/informers/internalversion/monitoring/internalversion/clusteralert.go deleted file mode 100644 index 9eff43ba0..000000000 --- a/client/informers/internalversion/monitoring/internalversion/clusteralert.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package internalversion - -import ( - time "time" - - monitoring "github.com/appscode/searchlight/apis/monitoring" - clientset_internalversion "github.com/appscode/searchlight/client/clientset/internalversion" - internalinterfaces "github.com/appscode/searchlight/client/informers/internalversion/internalinterfaces" - internalversion "github.com/appscode/searchlight/client/listers/monitoring/internalversion" - v1 "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" -) - -// ClusterAlertInformer provides access to a shared informer and lister for -// ClusterAlerts. -type ClusterAlertInformer interface { - Informer() cache.SharedIndexInformer - Lister() internalversion.ClusterAlertLister -} - -type clusterAlertInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewClusterAlertInformer constructs a new informer for ClusterAlert 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 NewClusterAlertInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredClusterAlertInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredClusterAlertInformer constructs a new informer for ClusterAlert 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 NewFilteredClusterAlertInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Monitoring().ClusterAlerts(namespace).List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Monitoring().ClusterAlerts(namespace).Watch(options) - }, - }, - &monitoring.ClusterAlert{}, - resyncPeriod, - indexers, - ) -} - -func (f *clusterAlertInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredClusterAlertInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *clusterAlertInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&monitoring.ClusterAlert{}, f.defaultInformer) -} - -func (f *clusterAlertInformer) Lister() internalversion.ClusterAlertLister { - return internalversion.NewClusterAlertLister(f.Informer().GetIndexer()) -} diff --git a/client/informers/internalversion/monitoring/internalversion/incident.go b/client/informers/internalversion/monitoring/internalversion/incident.go deleted file mode 100644 index 768f1394f..000000000 --- a/client/informers/internalversion/monitoring/internalversion/incident.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package internalversion - -import ( - time "time" - - monitoring "github.com/appscode/searchlight/apis/monitoring" - clientset_internalversion "github.com/appscode/searchlight/client/clientset/internalversion" - internalinterfaces "github.com/appscode/searchlight/client/informers/internalversion/internalinterfaces" - internalversion "github.com/appscode/searchlight/client/listers/monitoring/internalversion" - v1 "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" -) - -// IncidentInformer provides access to a shared informer and lister for -// Incidents. -type IncidentInformer interface { - Informer() cache.SharedIndexInformer - Lister() internalversion.IncidentLister -} - -type incidentInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewIncidentInformer constructs a new informer for Incident 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 NewIncidentInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredIncidentInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredIncidentInformer constructs a new informer for Incident 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 NewFilteredIncidentInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Monitoring().Incidents(namespace).List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Monitoring().Incidents(namespace).Watch(options) - }, - }, - &monitoring.Incident{}, - resyncPeriod, - indexers, - ) -} - -func (f *incidentInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredIncidentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *incidentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&monitoring.Incident{}, f.defaultInformer) -} - -func (f *incidentInformer) Lister() internalversion.IncidentLister { - return internalversion.NewIncidentLister(f.Informer().GetIndexer()) -} diff --git a/client/informers/internalversion/monitoring/internalversion/interface.go b/client/informers/internalversion/monitoring/internalversion/interface.go deleted file mode 100644 index 51fdb023a..000000000 --- a/client/informers/internalversion/monitoring/internalversion/interface.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package internalversion - -import ( - internalinterfaces "github.com/appscode/searchlight/client/informers/internalversion/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // ClusterAlerts returns a ClusterAlertInformer. - ClusterAlerts() ClusterAlertInformer - // Incidents returns a IncidentInformer. - Incidents() IncidentInformer - // NodeAlerts returns a NodeAlertInformer. - NodeAlerts() NodeAlertInformer - // PodAlerts returns a PodAlertInformer. - PodAlerts() PodAlertInformer -} - -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} -} - -// ClusterAlerts returns a ClusterAlertInformer. -func (v *version) ClusterAlerts() ClusterAlertInformer { - return &clusterAlertInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// Incidents returns a IncidentInformer. -func (v *version) Incidents() IncidentInformer { - return &incidentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// NodeAlerts returns a NodeAlertInformer. -func (v *version) NodeAlerts() NodeAlertInformer { - return &nodeAlertInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// PodAlerts returns a PodAlertInformer. -func (v *version) PodAlerts() PodAlertInformer { - return &podAlertInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/client/informers/internalversion/monitoring/internalversion/nodealert.go b/client/informers/internalversion/monitoring/internalversion/nodealert.go deleted file mode 100644 index 9c3a2f8db..000000000 --- a/client/informers/internalversion/monitoring/internalversion/nodealert.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package internalversion - -import ( - time "time" - - monitoring "github.com/appscode/searchlight/apis/monitoring" - clientset_internalversion "github.com/appscode/searchlight/client/clientset/internalversion" - internalinterfaces "github.com/appscode/searchlight/client/informers/internalversion/internalinterfaces" - internalversion "github.com/appscode/searchlight/client/listers/monitoring/internalversion" - v1 "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" -) - -// NodeAlertInformer provides access to a shared informer and lister for -// NodeAlerts. -type NodeAlertInformer interface { - Informer() cache.SharedIndexInformer - Lister() internalversion.NodeAlertLister -} - -type nodeAlertInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewNodeAlertInformer constructs a new informer for NodeAlert 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 NewNodeAlertInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredNodeAlertInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredNodeAlertInformer constructs a new informer for NodeAlert 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 NewFilteredNodeAlertInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Monitoring().NodeAlerts(namespace).List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Monitoring().NodeAlerts(namespace).Watch(options) - }, - }, - &monitoring.NodeAlert{}, - resyncPeriod, - indexers, - ) -} - -func (f *nodeAlertInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredNodeAlertInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *nodeAlertInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&monitoring.NodeAlert{}, f.defaultInformer) -} - -func (f *nodeAlertInformer) Lister() internalversion.NodeAlertLister { - return internalversion.NewNodeAlertLister(f.Informer().GetIndexer()) -} diff --git a/client/informers/internalversion/monitoring/internalversion/podalert.go b/client/informers/internalversion/monitoring/internalversion/podalert.go deleted file mode 100644 index 63250dd33..000000000 --- a/client/informers/internalversion/monitoring/internalversion/podalert.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package internalversion - -import ( - time "time" - - monitoring "github.com/appscode/searchlight/apis/monitoring" - clientset_internalversion "github.com/appscode/searchlight/client/clientset/internalversion" - internalinterfaces "github.com/appscode/searchlight/client/informers/internalversion/internalinterfaces" - internalversion "github.com/appscode/searchlight/client/listers/monitoring/internalversion" - v1 "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" -) - -// PodAlertInformer provides access to a shared informer and lister for -// PodAlerts. -type PodAlertInformer interface { - Informer() cache.SharedIndexInformer - Lister() internalversion.PodAlertLister -} - -type podAlertInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewPodAlertInformer constructs a new informer for PodAlert 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 NewPodAlertInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredPodAlertInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredPodAlertInformer constructs a new informer for PodAlert 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 NewFilteredPodAlertInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Monitoring().PodAlerts(namespace).List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Monitoring().PodAlerts(namespace).Watch(options) - }, - }, - &monitoring.PodAlert{}, - resyncPeriod, - indexers, - ) -} - -func (f *podAlertInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredPodAlertInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *podAlertInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&monitoring.PodAlert{}, f.defaultInformer) -} - -func (f *podAlertInformer) Lister() internalversion.PodAlertLister { - return internalversion.NewPodAlertLister(f.Informer().GetIndexer()) -} diff --git a/client/listers/monitoring/internalversion/clusteralert.go b/client/listers/monitoring/internalversion/clusteralert.go deleted file mode 100644 index 819c0cb4f..000000000 --- a/client/listers/monitoring/internalversion/clusteralert.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by lister-gen - -package internalversion - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ClusterAlertLister helps list ClusterAlerts. -type ClusterAlertLister interface { - // List lists all ClusterAlerts in the indexer. - List(selector labels.Selector) (ret []*monitoring.ClusterAlert, err error) - // ClusterAlerts returns an object that can list and get ClusterAlerts. - ClusterAlerts(namespace string) ClusterAlertNamespaceLister - ClusterAlertListerExpansion -} - -// clusterAlertLister implements the ClusterAlertLister interface. -type clusterAlertLister struct { - indexer cache.Indexer -} - -// NewClusterAlertLister returns a new ClusterAlertLister. -func NewClusterAlertLister(indexer cache.Indexer) ClusterAlertLister { - return &clusterAlertLister{indexer: indexer} -} - -// List lists all ClusterAlerts in the indexer. -func (s *clusterAlertLister) List(selector labels.Selector) (ret []*monitoring.ClusterAlert, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*monitoring.ClusterAlert)) - }) - return ret, err -} - -// ClusterAlerts returns an object that can list and get ClusterAlerts. -func (s *clusterAlertLister) ClusterAlerts(namespace string) ClusterAlertNamespaceLister { - return clusterAlertNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// ClusterAlertNamespaceLister helps list and get ClusterAlerts. -type ClusterAlertNamespaceLister interface { - // List lists all ClusterAlerts in the indexer for a given namespace. - List(selector labels.Selector) (ret []*monitoring.ClusterAlert, err error) - // Get retrieves the ClusterAlert from the indexer for a given namespace and name. - Get(name string) (*monitoring.ClusterAlert, error) - ClusterAlertNamespaceListerExpansion -} - -// clusterAlertNamespaceLister implements the ClusterAlertNamespaceLister -// interface. -type clusterAlertNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ClusterAlerts in the indexer for a given namespace. -func (s clusterAlertNamespaceLister) List(selector labels.Selector) (ret []*monitoring.ClusterAlert, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*monitoring.ClusterAlert)) - }) - return ret, err -} - -// Get retrieves the ClusterAlert from the indexer for a given namespace and name. -func (s clusterAlertNamespaceLister) Get(name string) (*monitoring.ClusterAlert, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(monitoring.Resource("clusteralert"), name) - } - return obj.(*monitoring.ClusterAlert), nil -} diff --git a/client/listers/monitoring/internalversion/expansion_generated.go b/client/listers/monitoring/internalversion/expansion_generated.go deleted file mode 100644 index 6ec159022..000000000 --- a/client/listers/monitoring/internalversion/expansion_generated.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by lister-gen - -package internalversion - -// ClusterAlertListerExpansion allows custom methods to be added to -// ClusterAlertLister. -type ClusterAlertListerExpansion interface{} - -// ClusterAlertNamespaceListerExpansion allows custom methods to be added to -// ClusterAlertNamespaceLister. -type ClusterAlertNamespaceListerExpansion interface{} - -// IncidentListerExpansion allows custom methods to be added to -// IncidentLister. -type IncidentListerExpansion interface{} - -// IncidentNamespaceListerExpansion allows custom methods to be added to -// IncidentNamespaceLister. -type IncidentNamespaceListerExpansion interface{} - -// NodeAlertListerExpansion allows custom methods to be added to -// NodeAlertLister. -type NodeAlertListerExpansion interface{} - -// NodeAlertNamespaceListerExpansion allows custom methods to be added to -// NodeAlertNamespaceLister. -type NodeAlertNamespaceListerExpansion interface{} - -// PodAlertListerExpansion allows custom methods to be added to -// PodAlertLister. -type PodAlertListerExpansion interface{} - -// PodAlertNamespaceListerExpansion allows custom methods to be added to -// PodAlertNamespaceLister. -type PodAlertNamespaceListerExpansion interface{} diff --git a/client/listers/monitoring/internalversion/incident.go b/client/listers/monitoring/internalversion/incident.go deleted file mode 100644 index 9ba62ba0b..000000000 --- a/client/listers/monitoring/internalversion/incident.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by lister-gen - -package internalversion - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// IncidentLister helps list Incidents. -type IncidentLister interface { - // List lists all Incidents in the indexer. - List(selector labels.Selector) (ret []*monitoring.Incident, err error) - // Incidents returns an object that can list and get Incidents. - Incidents(namespace string) IncidentNamespaceLister - IncidentListerExpansion -} - -// incidentLister implements the IncidentLister interface. -type incidentLister struct { - indexer cache.Indexer -} - -// NewIncidentLister returns a new IncidentLister. -func NewIncidentLister(indexer cache.Indexer) IncidentLister { - return &incidentLister{indexer: indexer} -} - -// List lists all Incidents in the indexer. -func (s *incidentLister) List(selector labels.Selector) (ret []*monitoring.Incident, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*monitoring.Incident)) - }) - return ret, err -} - -// Incidents returns an object that can list and get Incidents. -func (s *incidentLister) Incidents(namespace string) IncidentNamespaceLister { - return incidentNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// IncidentNamespaceLister helps list and get Incidents. -type IncidentNamespaceLister interface { - // List lists all Incidents in the indexer for a given namespace. - List(selector labels.Selector) (ret []*monitoring.Incident, err error) - // Get retrieves the Incident from the indexer for a given namespace and name. - Get(name string) (*monitoring.Incident, error) - IncidentNamespaceListerExpansion -} - -// incidentNamespaceLister implements the IncidentNamespaceLister -// interface. -type incidentNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Incidents in the indexer for a given namespace. -func (s incidentNamespaceLister) List(selector labels.Selector) (ret []*monitoring.Incident, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*monitoring.Incident)) - }) - return ret, err -} - -// Get retrieves the Incident from the indexer for a given namespace and name. -func (s incidentNamespaceLister) Get(name string) (*monitoring.Incident, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(monitoring.Resource("incident"), name) - } - return obj.(*monitoring.Incident), nil -} diff --git a/client/listers/monitoring/internalversion/nodealert.go b/client/listers/monitoring/internalversion/nodealert.go deleted file mode 100644 index 1e63384fb..000000000 --- a/client/listers/monitoring/internalversion/nodealert.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by lister-gen - -package internalversion - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// NodeAlertLister helps list NodeAlerts. -type NodeAlertLister interface { - // List lists all NodeAlerts in the indexer. - List(selector labels.Selector) (ret []*monitoring.NodeAlert, err error) - // NodeAlerts returns an object that can list and get NodeAlerts. - NodeAlerts(namespace string) NodeAlertNamespaceLister - NodeAlertListerExpansion -} - -// nodeAlertLister implements the NodeAlertLister interface. -type nodeAlertLister struct { - indexer cache.Indexer -} - -// NewNodeAlertLister returns a new NodeAlertLister. -func NewNodeAlertLister(indexer cache.Indexer) NodeAlertLister { - return &nodeAlertLister{indexer: indexer} -} - -// List lists all NodeAlerts in the indexer. -func (s *nodeAlertLister) List(selector labels.Selector) (ret []*monitoring.NodeAlert, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*monitoring.NodeAlert)) - }) - return ret, err -} - -// NodeAlerts returns an object that can list and get NodeAlerts. -func (s *nodeAlertLister) NodeAlerts(namespace string) NodeAlertNamespaceLister { - return nodeAlertNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// NodeAlertNamespaceLister helps list and get NodeAlerts. -type NodeAlertNamespaceLister interface { - // List lists all NodeAlerts in the indexer for a given namespace. - List(selector labels.Selector) (ret []*monitoring.NodeAlert, err error) - // Get retrieves the NodeAlert from the indexer for a given namespace and name. - Get(name string) (*monitoring.NodeAlert, error) - NodeAlertNamespaceListerExpansion -} - -// nodeAlertNamespaceLister implements the NodeAlertNamespaceLister -// interface. -type nodeAlertNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all NodeAlerts in the indexer for a given namespace. -func (s nodeAlertNamespaceLister) List(selector labels.Selector) (ret []*monitoring.NodeAlert, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*monitoring.NodeAlert)) - }) - return ret, err -} - -// Get retrieves the NodeAlert from the indexer for a given namespace and name. -func (s nodeAlertNamespaceLister) Get(name string) (*monitoring.NodeAlert, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(monitoring.Resource("nodealert"), name) - } - return obj.(*monitoring.NodeAlert), nil -} diff --git a/client/listers/monitoring/internalversion/podalert.go b/client/listers/monitoring/internalversion/podalert.go deleted file mode 100644 index 40e59e41d..000000000 --- a/client/listers/monitoring/internalversion/podalert.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2018 The Searchlight Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by lister-gen - -package internalversion - -import ( - monitoring "github.com/appscode/searchlight/apis/monitoring" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// PodAlertLister helps list PodAlerts. -type PodAlertLister interface { - // List lists all PodAlerts in the indexer. - List(selector labels.Selector) (ret []*monitoring.PodAlert, err error) - // PodAlerts returns an object that can list and get PodAlerts. - PodAlerts(namespace string) PodAlertNamespaceLister - PodAlertListerExpansion -} - -// podAlertLister implements the PodAlertLister interface. -type podAlertLister struct { - indexer cache.Indexer -} - -// NewPodAlertLister returns a new PodAlertLister. -func NewPodAlertLister(indexer cache.Indexer) PodAlertLister { - return &podAlertLister{indexer: indexer} -} - -// List lists all PodAlerts in the indexer. -func (s *podAlertLister) List(selector labels.Selector) (ret []*monitoring.PodAlert, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*monitoring.PodAlert)) - }) - return ret, err -} - -// PodAlerts returns an object that can list and get PodAlerts. -func (s *podAlertLister) PodAlerts(namespace string) PodAlertNamespaceLister { - return podAlertNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// PodAlertNamespaceLister helps list and get PodAlerts. -type PodAlertNamespaceLister interface { - // List lists all PodAlerts in the indexer for a given namespace. - List(selector labels.Selector) (ret []*monitoring.PodAlert, err error) - // Get retrieves the PodAlert from the indexer for a given namespace and name. - Get(name string) (*monitoring.PodAlert, error) - PodAlertNamespaceListerExpansion -} - -// podAlertNamespaceLister implements the PodAlertNamespaceLister -// interface. -type podAlertNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PodAlerts in the indexer for a given namespace. -func (s podAlertNamespaceLister) List(selector labels.Selector) (ret []*monitoring.PodAlert, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*monitoring.PodAlert)) - }) - return ret, err -} - -// Get retrieves the PodAlert from the indexer for a given namespace and name. -func (s podAlertNamespaceLister) Get(name string) (*monitoring.PodAlert, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(monitoring.Resource("podalert"), name) - } - return obj.(*monitoring.PodAlert), nil -} diff --git a/hack/codegen.sh b/hack/codegen.sh index b0375abf0..c21a77d82 100755 --- a/hack/codegen.sh +++ b/hack/codegen.sh @@ -13,13 +13,24 @@ pushd $REPO_ROOT ## Generate ugorji stuff rm "$REPO_ROOT"/apis/monitoring/v1alpha1/*.generated.go +# for EAS types docker run --rm -ti -u $(id -u):$(id -g) \ -v "$REPO_ROOT":"$DOCKER_REPO_ROOT" \ -w "$DOCKER_REPO_ROOT" \ - appscode/gengo:release-1.9 "$DOCKER_CODEGEN_PKG"/generate-internal-groups.sh all \ + appscode/gengo:release-1.9 "$DOCKER_CODEGEN_PKG"/generate-internal-groups.sh "deepcopy,defaulter,conversion" \ github.com/appscode/searchlight/client \ github.com/appscode/searchlight/apis \ github.com/appscode/searchlight/apis \ + incidents:v1alpha1 \ + --go-header-file "$DOCKER_REPO_ROOT/hack/gengo/boilerplate.go.txt" + +# for both CRD and EAS types +docker run --rm -ti -u $(id -u):$(id -g) \ + -v "$REPO_ROOT":"$DOCKER_REPO_ROOT" \ + -w "$DOCKER_REPO_ROOT" \ + appscode/gengo:release-1.9 "$DOCKER_CODEGEN_PKG"/generate-groups.sh all \ + github.com/appscode/searchlight/client \ + github.com/appscode/searchlight/apis \ "incidents:v1alpha1 monitoring:v1alpha1" \ --go-header-file "$DOCKER_REPO_ROOT/hack/gengo/boilerplate.go.txt" @@ -34,6 +45,3 @@ docker run --rm -ti -u $(id -u):$(id -g) \ --output-package "$PACKAGE_NAME/apis/incidents/v1alpha1" popd - - -