From f4f5f8283e2c6abdc84a0365b49b00498a6f66fe Mon Sep 17 00:00:00 2001 From: wanjunlei Date: Thu, 25 Feb 2021 14:57:17 +0800 Subject: [PATCH] change notification crd version to v2alpha1 Signed-off-by: wanjunlei --- ...ication.kubesphere.io_dingtalkconfigs.yaml | 2 +- ...ation.kubesphere.io_dingtalkreceivers.yaml | 2 +- ...tification.kubesphere.io_emailconfigs.yaml | 2 +- ...fication.kubesphere.io_emailreceivers.yaml | 2 +- ...on.kubesphere.io_notificationmanagers.yaml | 2 +- ...tification.kubesphere.io_slackconfigs.yaml | 2 +- ...fication.kubesphere.io_slackreceivers.yaml | 2 +- ...fication.kubesphere.io_webhookconfigs.yaml | 2 +- ...cation.kubesphere.io_webhookreceivers.yaml | 2 +- ...ification.kubesphere.io_wechatconfigs.yaml | 2 +- ...ication.kubesphere.io_wechatreceivers.yaml | 2 +- ...o => addtoscheme_notification_v2alpha1.go} | 4 +- .../{v2 => v2alpha1}/dingtalkconfig_types.go | 2 +- .../dingtalkreceiver_types.go | 2 +- pkg/apis/notification/{v2 => v2alpha1}/doc.go | 4 +- .../{v2 => v2alpha1}/emailconfig_types.go | 2 +- .../{v2 => v2alpha1}/emailreceiver_types.go | 2 +- .../notificationmanager_types.go | 2 +- .../notification/{v2 => v2alpha1}/register.go | 6 +- .../{v2 => v2alpha1}/slackconfig_types.go | 2 +- .../{v2 => v2alpha1}/slackreceiver_types.go | 2 +- .../notification/{v2 => v2alpha1}/types.go | 2 +- .../v2alpha1_suite_test.go} | 2 +- .../{v2 => v2alpha1}/webhookconfig_types.go | 2 +- .../{v2 => v2alpha1}/webhookreceiver_types.go | 2 +- .../{v2 => v2alpha1}/wechatconfig_types.go | 2 +- .../{v2 => v2alpha1}/wechatreceiver_types.go | 2 +- .../{v2 => v2alpha1}/zz_generated.deepcopy.go | 2 +- .../v1beta1/federateddingtalkconfig_types.go | 4 +- .../federateddingtalkreceiver_types.go | 4 +- .../v1beta1/federatedemailconfig_types.go | 4 +- .../v1beta1/federatedemailreceiver_types.go | 4 +- .../v1beta1/federatedslackconfig_types.go | 4 +- .../v1beta1/federatedslackreceiver_types.go | 4 +- .../v1beta1/federatedwebhookconfig_types.go | 4 +- .../v1beta1/federatedwebhookreceiver_types.go | 4 +- .../v1beta1/federatedwechatconfig_types.go | 4 +- .../v1beta1/federatedwechatreceiver_types.go | 4 +- pkg/apiserver/apiserver.go | 42 ++--- pkg/client/clientset/versioned/clientset.go | 18 +- .../versioned/fake/clientset_generated.go | 11 +- .../clientset/versioned/fake/register.go | 8 + .../clientset/versioned/scheme/register.go | 8 + .../{v2 => v2alpha1}/dingtalkconfig.go | 42 ++--- .../{v2 => v2alpha1}/dingtalkreceiver.go | 42 ++--- .../notification/{v2 => v2alpha1}/doc.go | 2 +- .../{v2 => v2alpha1}/emailconfig.go | 42 ++--- .../{v2 => v2alpha1}/emailreceiver.go | 42 ++--- .../notification/{v2 => v2alpha1}/fake/doc.go | 0 .../fake/fake_dingtalkconfig.go | 50 +++--- .../fake/fake_dingtalkreceiver.go | 50 +++--- .../{v2 => v2alpha1}/fake/fake_emailconfig.go | 50 +++--- .../fake/fake_emailreceiver.go | 50 +++--- .../fake/fake_notification_client.go | 26 +-- .../{v2 => v2alpha1}/fake/fake_slackconfig.go | 50 +++--- .../fake/fake_slackreceiver.go | 50 +++--- .../fake/fake_webhookconfig.go | 50 +++--- .../fake/fake_webhookreceiver.go | 50 +++--- .../fake/fake_wechatconfig.go | 50 +++--- .../fake/fake_wechatreceiver.go | 50 +++--- .../{v2 => v2alpha1}/generated_expansion.go | 2 +- .../{v2 => v2alpha1}/notification_client.go | 50 +++--- .../{v2 => v2alpha1}/slackconfig.go | 42 ++--- .../{v2 => v2alpha1}/slackreceiver.go | 42 ++--- .../{v2 => v2alpha1}/webhookconfig.go | 42 ++--- .../{v2 => v2alpha1}/webhookreceiver.go | 42 ++--- .../{v2 => v2alpha1}/wechatconfig.go | 42 ++--- .../{v2 => v2alpha1}/wechatreceiver.go | 42 ++--- .../informers/externalversions/generic.go | 46 ++--- .../notification/interface.go | 12 +- .../{v2 => v2alpha1}/dingtalkconfig.go | 20 +-- .../{v2 => v2alpha1}/dingtalkreceiver.go | 20 +-- .../{v2 => v2alpha1}/emailconfig.go | 20 +-- .../{v2 => v2alpha1}/emailreceiver.go | 20 +-- .../{v2 => v2alpha1}/interface.go | 2 +- .../{v2 => v2alpha1}/slackconfig.go | 20 +-- .../{v2 => v2alpha1}/slackreceiver.go | 20 +-- .../{v2 => v2alpha1}/webhookconfig.go | 20 +-- .../{v2 => v2alpha1}/webhookreceiver.go | 20 +-- .../{v2 => v2alpha1}/wechatconfig.go | 20 +-- .../{v2 => v2alpha1}/wechatreceiver.go | 20 +-- .../{v2 => v2alpha1}/dingtalkconfig.go | 18 +- .../{v2 => v2alpha1}/dingtalkreceiver.go | 18 +- .../{v2 => v2alpha1}/emailconfig.go | 18 +- .../{v2 => v2alpha1}/emailreceiver.go | 18 +- .../{v2 => v2alpha1}/expansion_generated.go | 2 +- .../{v2 => v2alpha1}/slackconfig.go | 18 +- .../{v2 => v2alpha1}/slackreceiver.go | 18 +- .../{v2 => v2alpha1}/webhookconfig.go | 18 +- .../{v2 => v2alpha1}/webhookreceiver.go | 18 +- .../{v2 => v2alpha1}/wechatconfig.go | 18 +- .../{v2 => v2alpha1}/wechatreceiver.go | 18 +- .../notification/notification_controller.go | 82 ++++----- .../notification_controller_suite_test.go | 4 +- .../notification_controller_test.go | 4 +- pkg/models/notification/notification.go | 168 +++++++++--------- .../v1alpha3/notification/notification.go | 40 ++--- .../notification/notification_test.go | 84 ++++----- .../resources/v1alpha3/resource/resource.go | 22 +-- 99 files changed, 1031 insertions(+), 1006 deletions(-) rename pkg/apis/{addtoscheme_notification_v2.go => addtoscheme_notification_v2alpha1.go} (82%) rename pkg/apis/notification/{v2 => v2alpha1}/dingtalkconfig_types.go (99%) rename pkg/apis/notification/{v2 => v2alpha1}/dingtalkreceiver_types.go (99%) rename pkg/apis/notification/{v2 => v2alpha1}/doc.go (94%) rename pkg/apis/notification/{v2 => v2alpha1}/emailconfig_types.go (99%) rename pkg/apis/notification/{v2 => v2alpha1}/emailreceiver_types.go (99%) rename pkg/apis/notification/{v2 => v2alpha1}/notificationmanager_types.go (99%) rename pkg/apis/notification/{v2 => v2alpha1}/register.go (94%) rename pkg/apis/notification/{v2 => v2alpha1}/slackconfig_types.go (98%) rename pkg/apis/notification/{v2 => v2alpha1}/slackreceiver_types.go (99%) rename pkg/apis/notification/{v2 => v2alpha1}/types.go (98%) rename pkg/apis/notification/{v2/v2_suite_test.go => v2alpha1/v2alpha1_suite_test.go} (98%) rename pkg/apis/notification/{v2 => v2alpha1}/webhookconfig_types.go (98%) rename pkg/apis/notification/{v2 => v2alpha1}/webhookreceiver_types.go (99%) rename pkg/apis/notification/{v2 => v2alpha1}/wechatconfig_types.go (99%) rename pkg/apis/notification/{v2 => v2alpha1}/wechatreceiver_types.go (99%) rename pkg/apis/notification/{v2 => v2alpha1}/zz_generated.deepcopy.go (99%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/dingtalkconfig.go (78%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/dingtalkreceiver.go (78%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/doc.go (97%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/emailconfig.go (79%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/emailreceiver.go (79%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/doc.go (100%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_dingtalkconfig.go (72%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_dingtalkreceiver.go (71%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_emailconfig.go (74%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_emailreceiver.go (73%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_notification_client.go (53%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_slackconfig.go (74%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_slackreceiver.go (73%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_webhookconfig.go (73%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_webhookreceiver.go (72%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_wechatconfig.go (73%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/fake/fake_wechatreceiver.go (72%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/generated_expansion.go (98%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/notification_client.go (55%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/slackconfig.go (79%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/slackreceiver.go (79%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/webhookconfig.go (79%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/webhookreceiver.go (79%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/wechatconfig.go (79%) rename pkg/client/clientset/versioned/typed/notification/{v2 => v2alpha1}/wechatreceiver.go (78%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/dingtalkconfig.go (82%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/dingtalkreceiver.go (81%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/emailconfig.go (82%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/emailreceiver.go (82%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/interface.go (99%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/slackconfig.go (82%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/slackreceiver.go (82%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/webhookconfig.go (82%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/webhookreceiver.go (81%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/wechatconfig.go (82%) rename pkg/client/informers/externalversions/notification/{v2 => v2alpha1}/wechatreceiver.go (82%) rename pkg/client/listers/notification/{v2 => v2alpha1}/dingtalkconfig.go (76%) rename pkg/client/listers/notification/{v2 => v2alpha1}/dingtalkreceiver.go (76%) rename pkg/client/listers/notification/{v2 => v2alpha1}/emailconfig.go (77%) rename pkg/client/listers/notification/{v2 => v2alpha1}/emailreceiver.go (76%) rename pkg/client/listers/notification/{v2 => v2alpha1}/expansion_generated.go (99%) rename pkg/client/listers/notification/{v2 => v2alpha1}/slackconfig.go (77%) rename pkg/client/listers/notification/{v2 => v2alpha1}/slackreceiver.go (76%) rename pkg/client/listers/notification/{v2 => v2alpha1}/webhookconfig.go (76%) rename pkg/client/listers/notification/{v2 => v2alpha1}/webhookreceiver.go (76%) rename pkg/client/listers/notification/{v2 => v2alpha1}/wechatconfig.go (76%) rename pkg/client/listers/notification/{v2 => v2alpha1}/wechatreceiver.go (76%) diff --git a/config/crds/notification.kubesphere.io_dingtalkconfigs.yaml b/config/crds/notification.kubesphere.io_dingtalkconfigs.yaml index f072525eb..fa54137a5 100644 --- a/config/crds/notification.kubesphere.io_dingtalkconfigs.yaml +++ b/config/crds/notification.kubesphere.io_dingtalkconfigs.yaml @@ -18,7 +18,7 @@ spec: singular: dingtalkconfig scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: DingTalkConfig is the Schema for the dingtalkconfigs API diff --git a/config/crds/notification.kubesphere.io_dingtalkreceivers.yaml b/config/crds/notification.kubesphere.io_dingtalkreceivers.yaml index e7a7a4d27..00a64b934 100644 --- a/config/crds/notification.kubesphere.io_dingtalkreceivers.yaml +++ b/config/crds/notification.kubesphere.io_dingtalkreceivers.yaml @@ -18,7 +18,7 @@ spec: singular: dingtalkreceiver scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: DingTalkReceiver is the Schema for the dingtalkreceivers API diff --git a/config/crds/notification.kubesphere.io_emailconfigs.yaml b/config/crds/notification.kubesphere.io_emailconfigs.yaml index 1cf3d019d..104602f31 100644 --- a/config/crds/notification.kubesphere.io_emailconfigs.yaml +++ b/config/crds/notification.kubesphere.io_emailconfigs.yaml @@ -18,7 +18,7 @@ spec: singular: emailconfig scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: EmailConfig is the Schema for the emailconfigs API diff --git a/config/crds/notification.kubesphere.io_emailreceivers.yaml b/config/crds/notification.kubesphere.io_emailreceivers.yaml index cc2c923b7..10357914d 100644 --- a/config/crds/notification.kubesphere.io_emailreceivers.yaml +++ b/config/crds/notification.kubesphere.io_emailreceivers.yaml @@ -18,7 +18,7 @@ spec: singular: emailreceiver scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: EmailReceiver is the Schema for the emailreceivers API diff --git a/config/crds/notification.kubesphere.io_notificationmanagers.yaml b/config/crds/notification.kubesphere.io_notificationmanagers.yaml index 395a0e5d8..a7de41b66 100644 --- a/config/crds/notification.kubesphere.io_notificationmanagers.yaml +++ b/config/crds/notification.kubesphere.io_notificationmanagers.yaml @@ -18,7 +18,7 @@ spec: singular: notificationmanager scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: NotificationManager is the Schema for the notificationmanagers API diff --git a/config/crds/notification.kubesphere.io_slackconfigs.yaml b/config/crds/notification.kubesphere.io_slackconfigs.yaml index 58770ef38..3a4dadfed 100644 --- a/config/crds/notification.kubesphere.io_slackconfigs.yaml +++ b/config/crds/notification.kubesphere.io_slackconfigs.yaml @@ -18,7 +18,7 @@ spec: singular: slackconfig scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: SlackConfig is the Schema for the slackconfigs API diff --git a/config/crds/notification.kubesphere.io_slackreceivers.yaml b/config/crds/notification.kubesphere.io_slackreceivers.yaml index ea61fbeb2..c4d9f345f 100644 --- a/config/crds/notification.kubesphere.io_slackreceivers.yaml +++ b/config/crds/notification.kubesphere.io_slackreceivers.yaml @@ -18,7 +18,7 @@ spec: singular: slackreceiver scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: SlackReceiver is the Schema for the slackreceivers API diff --git a/config/crds/notification.kubesphere.io_webhookconfigs.yaml b/config/crds/notification.kubesphere.io_webhookconfigs.yaml index f2ec846f8..5658720c5 100644 --- a/config/crds/notification.kubesphere.io_webhookconfigs.yaml +++ b/config/crds/notification.kubesphere.io_webhookconfigs.yaml @@ -18,7 +18,7 @@ spec: singular: webhookconfig scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: WebhookConfig is the Schema for the webhookconfigs API diff --git a/config/crds/notification.kubesphere.io_webhookreceivers.yaml b/config/crds/notification.kubesphere.io_webhookreceivers.yaml index 1952eec6a..33f966ce8 100644 --- a/config/crds/notification.kubesphere.io_webhookreceivers.yaml +++ b/config/crds/notification.kubesphere.io_webhookreceivers.yaml @@ -18,7 +18,7 @@ spec: singular: webhookreceiver scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: WebhookReceiver is the Schema for the webhookreceivers API diff --git a/config/crds/notification.kubesphere.io_wechatconfigs.yaml b/config/crds/notification.kubesphere.io_wechatconfigs.yaml index 3d73baadd..5983f08b8 100644 --- a/config/crds/notification.kubesphere.io_wechatconfigs.yaml +++ b/config/crds/notification.kubesphere.io_wechatconfigs.yaml @@ -18,7 +18,7 @@ spec: singular: wechatconfig scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: WechatConfig is the Schema for the wechatconfigs API diff --git a/config/crds/notification.kubesphere.io_wechatreceivers.yaml b/config/crds/notification.kubesphere.io_wechatreceivers.yaml index 7f3ab488a..b36f0aa65 100644 --- a/config/crds/notification.kubesphere.io_wechatreceivers.yaml +++ b/config/crds/notification.kubesphere.io_wechatreceivers.yaml @@ -18,7 +18,7 @@ spec: singular: wechatreceiver scope: Cluster versions: - - name: v2 + - name: v2alpha1 schema: openAPIV3Schema: description: WechatReceiver is the Schema for the wechatreceivers API diff --git a/pkg/apis/addtoscheme_notification_v2.go b/pkg/apis/addtoscheme_notification_v2alpha1.go similarity index 82% rename from pkg/apis/addtoscheme_notification_v2.go rename to pkg/apis/addtoscheme_notification_v2alpha1.go index 541238481..00b75715c 100644 --- a/pkg/apis/addtoscheme_notification_v2.go +++ b/pkg/apis/addtoscheme_notification_v2alpha1.go @@ -17,9 +17,9 @@ limitations under the License. package apis import ( - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) func init() { - AddToSchemes = append(AddToSchemes, v2.SchemeBuilder.AddToScheme) + AddToSchemes = append(AddToSchemes, v2alpha1.SchemeBuilder.AddToScheme) } diff --git a/pkg/apis/notification/v2/dingtalkconfig_types.go b/pkg/apis/notification/v2alpha1/dingtalkconfig_types.go similarity index 99% rename from pkg/apis/notification/v2/dingtalkconfig_types.go rename to pkg/apis/notification/v2alpha1/dingtalkconfig_types.go index 615468b54..bff9f986e 100644 --- a/pkg/apis/notification/v2/dingtalkconfig_types.go +++ b/pkg/apis/notification/v2alpha1/dingtalkconfig_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/dingtalkreceiver_types.go b/pkg/apis/notification/v2alpha1/dingtalkreceiver_types.go similarity index 99% rename from pkg/apis/notification/v2/dingtalkreceiver_types.go rename to pkg/apis/notification/v2alpha1/dingtalkreceiver_types.go index 9e2696ccb..c0df00a02 100644 --- a/pkg/apis/notification/v2/dingtalkreceiver_types.go +++ b/pkg/apis/notification/v2alpha1/dingtalkreceiver_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/doc.go b/pkg/apis/notification/v2alpha1/doc.go similarity index 94% rename from pkg/apis/notification/v2/doc.go rename to pkg/apis/notification/v2alpha1/doc.go index 383ff6b1c..73b0fbc8c 100644 --- a/pkg/apis/notification/v2/doc.go +++ b/pkg/apis/notification/v2alpha1/doc.go @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1alpha1 contains API Schema definitions for the notification v2 API group +// Package v1alpha1 contains API Schema definitions for the notification v2alpha1 API group // +groupName=notification.kubesphere.io // +genclient // +genclient:nonNamespaced -package v2 +package v2alpha1 diff --git a/pkg/apis/notification/v2/emailconfig_types.go b/pkg/apis/notification/v2alpha1/emailconfig_types.go similarity index 99% rename from pkg/apis/notification/v2/emailconfig_types.go rename to pkg/apis/notification/v2alpha1/emailconfig_types.go index fba4529f9..69f50aeed 100644 --- a/pkg/apis/notification/v2/emailconfig_types.go +++ b/pkg/apis/notification/v2alpha1/emailconfig_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/emailreceiver_types.go b/pkg/apis/notification/v2alpha1/emailreceiver_types.go similarity index 99% rename from pkg/apis/notification/v2/emailreceiver_types.go rename to pkg/apis/notification/v2alpha1/emailreceiver_types.go index 9bf31ac5b..d6b23e5a0 100644 --- a/pkg/apis/notification/v2/emailreceiver_types.go +++ b/pkg/apis/notification/v2alpha1/emailreceiver_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/notificationmanager_types.go b/pkg/apis/notification/v2alpha1/notificationmanager_types.go similarity index 99% rename from pkg/apis/notification/v2/notificationmanager_types.go rename to pkg/apis/notification/v2alpha1/notificationmanager_types.go index 5af543fc6..ac8681d82 100644 --- a/pkg/apis/notification/v2/notificationmanager_types.go +++ b/pkg/apis/notification/v2alpha1/notificationmanager_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( "k8s.io/api/core/v1" diff --git a/pkg/apis/notification/v2/register.go b/pkg/apis/notification/v2alpha1/register.go similarity index 94% rename from pkg/apis/notification/v2/register.go rename to pkg/apis/notification/v2alpha1/register.go index 8103b55f0..b36e0bd20 100644 --- a/pkg/apis/notification/v2/register.go +++ b/pkg/apis/notification/v2alpha1/register.go @@ -16,10 +16,10 @@ limitations under the License. // NOTE: Boilerplate only. Ignore this file. -// Package v1alpha1 contains API Schema definitions for the notification v2 API group +// Package v1alpha1 contains API Schema definitions for the notification v2alpha1 API group // +k8s:deepcopy-gen=package,register // +groupName=notification.kubesphere.io -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/runtime/schema" @@ -28,7 +28,7 @@ import ( var ( // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: "notification.kubesphere.io", Version: "v2"} + SchemeGroupVersion = schema.GroupVersion{Group: "notification.kubesphere.io", Version: "v2alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} diff --git a/pkg/apis/notification/v2/slackconfig_types.go b/pkg/apis/notification/v2alpha1/slackconfig_types.go similarity index 98% rename from pkg/apis/notification/v2/slackconfig_types.go rename to pkg/apis/notification/v2alpha1/slackconfig_types.go index eb1b75619..42d86da7f 100644 --- a/pkg/apis/notification/v2/slackconfig_types.go +++ b/pkg/apis/notification/v2alpha1/slackconfig_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/slackreceiver_types.go b/pkg/apis/notification/v2alpha1/slackreceiver_types.go similarity index 99% rename from pkg/apis/notification/v2/slackreceiver_types.go rename to pkg/apis/notification/v2alpha1/slackreceiver_types.go index bbe78d73f..1ccc7df20 100644 --- a/pkg/apis/notification/v2/slackreceiver_types.go +++ b/pkg/apis/notification/v2alpha1/slackreceiver_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/types.go b/pkg/apis/notification/v2alpha1/types.go similarity index 98% rename from pkg/apis/notification/v2/types.go rename to pkg/apis/notification/v2alpha1/types.go index 57c3bbd2a..52b192fd1 100644 --- a/pkg/apis/notification/v2/types.go +++ b/pkg/apis/notification/v2alpha1/types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 const ( ResourcesPluralDingTalkConfig = "dingtalkconfigs" diff --git a/pkg/apis/notification/v2/v2_suite_test.go b/pkg/apis/notification/v2alpha1/v2alpha1_suite_test.go similarity index 98% rename from pkg/apis/notification/v2/v2_suite_test.go rename to pkg/apis/notification/v2alpha1/v2alpha1_suite_test.go index 9e49e5c9d..5309e2eb5 100644 --- a/pkg/apis/notification/v2/v2_suite_test.go +++ b/pkg/apis/notification/v2alpha1/v2alpha1_suite_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( "log" diff --git a/pkg/apis/notification/v2/webhookconfig_types.go b/pkg/apis/notification/v2alpha1/webhookconfig_types.go similarity index 98% rename from pkg/apis/notification/v2/webhookconfig_types.go rename to pkg/apis/notification/v2alpha1/webhookconfig_types.go index d79f519da..4a0771a26 100644 --- a/pkg/apis/notification/v2/webhookconfig_types.go +++ b/pkg/apis/notification/v2alpha1/webhookconfig_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/webhookreceiver_types.go b/pkg/apis/notification/v2alpha1/webhookreceiver_types.go similarity index 99% rename from pkg/apis/notification/v2/webhookreceiver_types.go rename to pkg/apis/notification/v2alpha1/webhookreceiver_types.go index 19e27b423..6b6eeaf04 100644 --- a/pkg/apis/notification/v2/webhookreceiver_types.go +++ b/pkg/apis/notification/v2alpha1/webhookreceiver_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/wechatconfig_types.go b/pkg/apis/notification/v2alpha1/wechatconfig_types.go similarity index 99% rename from pkg/apis/notification/v2/wechatconfig_types.go rename to pkg/apis/notification/v2alpha1/wechatconfig_types.go index 60bb31ce8..9bc974392 100644 --- a/pkg/apis/notification/v2/wechatconfig_types.go +++ b/pkg/apis/notification/v2alpha1/wechatconfig_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/wechatreceiver_types.go b/pkg/apis/notification/v2alpha1/wechatreceiver_types.go similarity index 99% rename from pkg/apis/notification/v2/wechatreceiver_types.go rename to pkg/apis/notification/v2alpha1/wechatreceiver_types.go index 916c0b912..7959b1d2e 100644 --- a/pkg/apis/notification/v2/wechatreceiver_types.go +++ b/pkg/apis/notification/v2alpha1/wechatreceiver_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2 +package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/notification/v2/zz_generated.deepcopy.go b/pkg/apis/notification/v2alpha1/zz_generated.deepcopy.go similarity index 99% rename from pkg/apis/notification/v2/zz_generated.deepcopy.go rename to pkg/apis/notification/v2alpha1/zz_generated.deepcopy.go index 021089293..530e0f18e 100644 --- a/pkg/apis/notification/v2/zz_generated.deepcopy.go +++ b/pkg/apis/notification/v2alpha1/zz_generated.deepcopy.go @@ -18,7 +18,7 @@ limitations under the License. // Code generated by controller-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( corev1 "k8s.io/api/core/v1" diff --git a/pkg/apis/types/v1beta1/federateddingtalkconfig_types.go b/pkg/apis/types/v1beta1/federateddingtalkconfig_types.go index 3dbeeefb9..fd4436a8a 100644 --- a/pkg/apis/types/v1beta1/federateddingtalkconfig_types.go +++ b/pkg/apis/types/v1beta1/federateddingtalkconfig_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -50,7 +50,7 @@ type FederatedDingTalkConfigSpec struct { type DingTalkConfigTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.DingTalkConfigSpec `json:"spec,omitempty"` + Spec v2alpha1.DingTalkConfigSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/types/v1beta1/federateddingtalkreceiver_types.go b/pkg/apis/types/v1beta1/federateddingtalkreceiver_types.go index 69f4c5272..0a6fa0172 100644 --- a/pkg/apis/types/v1beta1/federateddingtalkreceiver_types.go +++ b/pkg/apis/types/v1beta1/federateddingtalkreceiver_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -49,7 +49,7 @@ type FederatedDingTalkReceiverSpec struct { type DingTalkReceiverTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.DingTalkReceiverSpec `json:"spec,omitempty"` + Spec v2alpha1.DingTalkReceiverSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/types/v1beta1/federatedemailconfig_types.go b/pkg/apis/types/v1beta1/federatedemailconfig_types.go index 2dcb93f4c..4fa1e8a26 100644 --- a/pkg/apis/types/v1beta1/federatedemailconfig_types.go +++ b/pkg/apis/types/v1beta1/federatedemailconfig_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -49,7 +49,7 @@ type FederatedEmailConfigSpec struct { type EmailConfigTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.EmailConfigSpec `json:"spec,omitempty"` + Spec v2alpha1.EmailConfigSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/types/v1beta1/federatedemailreceiver_types.go b/pkg/apis/types/v1beta1/federatedemailreceiver_types.go index 729043642..dc1cb06a1 100644 --- a/pkg/apis/types/v1beta1/federatedemailreceiver_types.go +++ b/pkg/apis/types/v1beta1/federatedemailreceiver_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -49,7 +49,7 @@ type FederatedEmailReceiverSpec struct { type EmailReceiverTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.EmailReceiverSpec `json:"spec,omitempty"` + Spec v2alpha1.EmailReceiverSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/types/v1beta1/federatedslackconfig_types.go b/pkg/apis/types/v1beta1/federatedslackconfig_types.go index e368dba4d..4871bcaac 100644 --- a/pkg/apis/types/v1beta1/federatedslackconfig_types.go +++ b/pkg/apis/types/v1beta1/federatedslackconfig_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -49,7 +49,7 @@ type FederatedSlackConfigSpec struct { type SlackConfigTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.SlackConfigSpec `json:"spec,omitempty"` + Spec v2alpha1.SlackConfigSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/types/v1beta1/federatedslackreceiver_types.go b/pkg/apis/types/v1beta1/federatedslackreceiver_types.go index 840d782ba..7ef753fb6 100644 --- a/pkg/apis/types/v1beta1/federatedslackreceiver_types.go +++ b/pkg/apis/types/v1beta1/federatedslackreceiver_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -49,7 +49,7 @@ type FederatedSlackReceiverSpec struct { type SlackReceiverTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.SlackReceiverSpec `json:"spec,omitempty"` + Spec v2alpha1.SlackReceiverSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/types/v1beta1/federatedwebhookconfig_types.go b/pkg/apis/types/v1beta1/federatedwebhookconfig_types.go index 6bfe396ae..d2408a195 100644 --- a/pkg/apis/types/v1beta1/federatedwebhookconfig_types.go +++ b/pkg/apis/types/v1beta1/federatedwebhookconfig_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -49,7 +49,7 @@ type FederatedWebhookConfigSpec struct { type WebhookConfigTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.WebhookConfigSpec `json:"spec,omitempty"` + Spec v2alpha1.WebhookConfigSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/types/v1beta1/federatedwebhookreceiver_types.go b/pkg/apis/types/v1beta1/federatedwebhookreceiver_types.go index 4bbbb4755..8e07f76f6 100644 --- a/pkg/apis/types/v1beta1/federatedwebhookreceiver_types.go +++ b/pkg/apis/types/v1beta1/federatedwebhookreceiver_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -49,7 +49,7 @@ type FederatedWebhookReceiverSpec struct { type WebhookReceiverTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.WebhookReceiverSpec `json:"spec,omitempty"` + Spec v2alpha1.WebhookReceiverSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/types/v1beta1/federatedwechatconfig_types.go b/pkg/apis/types/v1beta1/federatedwechatconfig_types.go index eaf906124..382c563c9 100644 --- a/pkg/apis/types/v1beta1/federatedwechatconfig_types.go +++ b/pkg/apis/types/v1beta1/federatedwechatconfig_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -49,7 +49,7 @@ type FederatedWechatConfigSpec struct { type WechatConfigTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.WechatConfigSpec `json:"spec,omitempty"` + Spec v2alpha1.WechatConfigSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/types/v1beta1/federatedwechatreceiver_types.go b/pkg/apis/types/v1beta1/federatedwechatreceiver_types.go index 957909175..32cfe63a8 100644 --- a/pkg/apis/types/v1beta1/federatedwechatreceiver_types.go +++ b/pkg/apis/types/v1beta1/federatedwechatreceiver_types.go @@ -18,7 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) const ( @@ -49,7 +49,7 @@ type FederatedWechatReceiverSpec struct { type WechatReceiverTemplate struct { // +kubebuilder:pruning:PreserveUnknownFields metav1.ObjectMeta `json:"metadata,omitempty"` - Spec v2.WechatReceiverSpec `json:"spec,omitempty"` + Spec v2alpha1.WechatReceiverSpec `json:"spec,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index 2bf94803f..cdef0d6b0 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -37,7 +37,7 @@ import ( "k8s.io/klog" clusterv1alpha1 "kubesphere.io/kubesphere/pkg/apis/cluster/v1alpha1" iamv1alpha2 "kubesphere.io/kubesphere/pkg/apis/iam/v1alpha2" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationcrd "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" tenantv1alpha1 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1" typesv1beta1 "kubesphere.io/kubesphere/pkg/apis/types/v1beta1" audit "kubesphere.io/kubesphere/pkg/apiserver/auditing" @@ -314,16 +314,16 @@ func (s *APIServer) buildHandlerChain(stopCh <-chan struct{}) { tenantv1alpha2.Resource(clusterv1alpha1.ResourcesPluralCluster), clusterv1alpha1.Resource(clusterv1alpha1.ResourcesPluralCluster), resourcev1alpha3.Resource(clusterv1alpha1.ResourcesPluralCluster), - v2.Resource(v2.ResourcesPluralDingTalkConfig), - v2.Resource(v2.ResourcesPluralDingTalkReceiver), - v2.Resource(v2.ResourcesPluralEmailReceiver), - v2.Resource(v2.ResourcesPluralEmailConfig), - v2.Resource(v2.ResourcesPluralSlackConfig), - v2.Resource(v2.ResourcesPluralSlackReceiver), - v2.Resource(v2.ResourcesPluralWebhookConfig), - v2.Resource(v2.ResourcesPluralWebhookReceiver), - v2.Resource(v2.ResourcesPluralWechatConfig), - v2.Resource(v2.ResourcesPluralWechatReceiver), + notificationcrd.Resource(notificationcrd.ResourcesPluralDingTalkConfig), + notificationcrd.Resource(notificationcrd.ResourcesPluralDingTalkReceiver), + notificationcrd.Resource(notificationcrd.ResourcesPluralEmailReceiver), + notificationcrd.Resource(notificationcrd.ResourcesPluralEmailConfig), + notificationcrd.Resource(notificationcrd.ResourcesPluralSlackConfig), + notificationcrd.Resource(notificationcrd.ResourcesPluralSlackReceiver), + notificationcrd.Resource(notificationcrd.ResourcesPluralWebhookConfig), + notificationcrd.Resource(notificationcrd.ResourcesPluralWebhookReceiver), + notificationcrd.Resource(notificationcrd.ResourcesPluralWechatConfig), + notificationcrd.Resource(notificationcrd.ResourcesPluralWechatReceiver), }, } @@ -457,16 +457,16 @@ func (s *APIServer) waitForResourceSync(stopCh <-chan struct{}) error { {Group: "cluster.kubesphere.io", Version: "v1alpha1", Resource: "clusters"}, {Group: "devops.kubesphere.io", Version: "v1alpha3", Resource: "devopsprojects"}, {Group: "network.kubesphere.io", Version: "v1alpha1", Resource: "ippools"}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralDingTalkConfig}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralDingTalkReceiver}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralEmailConfig}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralEmailReceiver}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralSlackConfig}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralSlackReceiver}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralWebhookConfig}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralWebhookReceiver}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralWechatConfig}, - {Group: "notification.kubesphere.io", Version: "v2", Resource: v2.ResourcesPluralWechatReceiver}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralDingTalkConfig}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralDingTalkReceiver}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralEmailConfig}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralEmailReceiver}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralSlackConfig}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralSlackReceiver}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralWebhookConfig}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralWebhookReceiver}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralWechatConfig}, + {Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: notificationcrd.ResourcesPluralWechatReceiver}, } devopsGVRs := []schema.GroupVersionResource{ diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 34da827f2..d898df682 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -31,8 +31,8 @@ import ( devopsv1alpha3 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/devops/v1alpha3" iamv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/iam/v1alpha2" networkv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/network/v1alpha1" - notificationv2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2" quotav1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/quota/v1alpha2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2alpha1" servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2" storagev1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/storage/v1alpha1" tenantv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/tenant/v1alpha1" @@ -49,8 +49,8 @@ type Interface interface { DevopsV1alpha3() devopsv1alpha3.DevopsV1alpha3Interface IamV1alpha2() iamv1alpha2.IamV1alpha2Interface NetworkV1alpha1() networkv1alpha1.NetworkV1alpha1Interface - NotificationV2() notificationv2.NotificationV2Interface QuotaV1alpha2() quotav1alpha2.QuotaV1alpha2Interface + NotificationV2alpha1() notificationv2alpha1.NotificationV2alpha1Interface ServicemeshV1alpha2() servicemeshv1alpha2.ServicemeshV1alpha2Interface StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface TenantV1alpha1() tenantv1alpha1.TenantV1alpha1Interface @@ -69,7 +69,7 @@ type Clientset struct { devopsV1alpha3 *devopsv1alpha3.DevopsV1alpha3Client iamV1alpha2 *iamv1alpha2.IamV1alpha2Client networkV1alpha1 *networkv1alpha1.NetworkV1alpha1Client - notificationV2 *notificationv2.NotificationV2Client + notificationV2alpha1 *notificationv2alpha1.NotificationV2alpha1Client quotaV1alpha2 *quotav1alpha2.QuotaV1alpha2Client servicemeshV1alpha2 *servicemeshv1alpha2.ServicemeshV1alpha2Client storageV1alpha1 *storagev1alpha1.StorageV1alpha1Client @@ -113,9 +113,9 @@ func (c *Clientset) NetworkV1alpha1() networkv1alpha1.NetworkV1alpha1Interface { return c.networkV1alpha1 } -// NotificationV2 retrieves the NotificationV2Client -func (c *Clientset) NotificationV2() notificationv2.NotificationV2Interface { - return c.notificationV2 +// NotificationV2alpha1 retrieves the NotificationV2alpha1Client +func (c *Clientset) NotificationV2alpha1() notificationv2alpha1.NotificationV2alpha1Interface { + return c.notificationV2alpha1 } // QuotaV1alpha2 retrieves the QuotaV1alpha2Client @@ -197,7 +197,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } - cs.notificationV2, err = notificationv2.NewForConfig(&configShallowCopy) + cs.notificationV2alpha1, err = notificationv2alpha1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -244,7 +244,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { cs.devopsV1alpha3 = devopsv1alpha3.NewForConfigOrDie(c) cs.iamV1alpha2 = iamv1alpha2.NewForConfigOrDie(c) cs.networkV1alpha1 = networkv1alpha1.NewForConfigOrDie(c) - cs.notificationV2 = notificationv2.NewForConfigOrDie(c) + cs.notificationV2alpha1 = notificationv2alpha1.NewForConfigOrDie(c) cs.quotaV1alpha2 = quotav1alpha2.NewForConfigOrDie(c) cs.servicemeshV1alpha2 = servicemeshv1alpha2.NewForConfigOrDie(c) cs.storageV1alpha1 = storagev1alpha1.NewForConfigOrDie(c) @@ -266,7 +266,7 @@ func New(c rest.Interface) *Clientset { cs.devopsV1alpha3 = devopsv1alpha3.New(c) cs.iamV1alpha2 = iamv1alpha2.New(c) cs.networkV1alpha1 = networkv1alpha1.New(c) - cs.notificationV2 = notificationv2.New(c) + cs.notificationV2alpha1 = notificationv2alpha1.New(c) cs.quotaV1alpha2 = quotav1alpha2.New(c) cs.servicemeshV1alpha2 = servicemeshv1alpha2.New(c) cs.storageV1alpha1 = storagev1alpha1.New(c) diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index c63fe54b1..c7aeb6234 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -39,10 +39,15 @@ import ( fakeiamv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake" networkv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/network/v1alpha1" fakenetworkv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/network/v1alpha1/fake" +<<<<<<< HEAD notificationv2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2" fakenotificationv2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2/fake" quotav1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/quota/v1alpha2" fakequotav1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/quota/v1alpha2/fake" +======= + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2alpha1" + fakenotificationv2alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake" +>>>>>>> change notification crd version to v2alpha1 servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2" fakeservicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake" storagev1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/storage/v1alpha1" @@ -137,9 +142,9 @@ func (c *Clientset) NetworkV1alpha1() networkv1alpha1.NetworkV1alpha1Interface { return &fakenetworkv1alpha1.FakeNetworkV1alpha1{Fake: &c.Fake} } -// NotificationV2 retrieves the NotificationV2Client -func (c *Clientset) NotificationV2() notificationv2.NotificationV2Interface { - return &fakenotificationv2.FakeNotificationV2{Fake: &c.Fake} +// NotificationV2alpha1 retrieves the NotificationV2alpha1Client +func (c *Clientset) NotificationV2alpha1() notificationv2alpha1.NotificationV2alpha1Interface { + return &fakenotificationv2alpha1.FakeNotificationV2alpha1{Fake: &c.Fake} } // QuotaV1alpha2 retrieves the QuotaV1alpha2Client diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index c7526aa95..cf2870887 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -31,8 +31,12 @@ import ( devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3" iamv1alpha2 "kubesphere.io/kubesphere/pkg/apis/iam/v1alpha2" networkv1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1" +<<<<<<< HEAD notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" quotav1alpha2 "kubesphere.io/kubesphere/pkg/apis/quota/v1alpha2" +======= + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" +>>>>>>> change notification crd version to v2alpha1 servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2" storagev1alpha1 "kubesphere.io/kubesphere/pkg/apis/storage/v1alpha1" tenantv1alpha1 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1" @@ -51,8 +55,12 @@ var localSchemeBuilder = runtime.SchemeBuilder{ devopsv1alpha3.AddToScheme, iamv1alpha2.AddToScheme, networkv1alpha1.AddToScheme, +<<<<<<< HEAD notificationv2.AddToScheme, quotav1alpha2.AddToScheme, +======= + notificationv2alpha1.AddToScheme, +>>>>>>> change notification crd version to v2alpha1 servicemeshv1alpha2.AddToScheme, storagev1alpha1.AddToScheme, tenantv1alpha1.AddToScheme, diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 12713803d..cd42e779c 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -31,8 +31,12 @@ import ( devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3" iamv1alpha2 "kubesphere.io/kubesphere/pkg/apis/iam/v1alpha2" networkv1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1" +<<<<<<< HEAD notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" quotav1alpha2 "kubesphere.io/kubesphere/pkg/apis/quota/v1alpha2" +======= + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" +>>>>>>> change notification crd version to v2alpha1 servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2" storagev1alpha1 "kubesphere.io/kubesphere/pkg/apis/storage/v1alpha1" tenantv1alpha1 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1" @@ -51,8 +55,12 @@ var localSchemeBuilder = runtime.SchemeBuilder{ devopsv1alpha3.AddToScheme, iamv1alpha2.AddToScheme, networkv1alpha1.AddToScheme, +<<<<<<< HEAD notificationv2.AddToScheme, quotav1alpha2.AddToScheme, +======= + notificationv2alpha1.AddToScheme, +>>>>>>> change notification crd version to v2alpha1 servicemeshv1alpha2.AddToScheme, storagev1alpha1.AddToScheme, tenantv1alpha1.AddToScheme, diff --git a/pkg/client/clientset/versioned/typed/notification/v2/dingtalkconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/dingtalkconfig.go similarity index 78% rename from pkg/client/clientset/versioned/typed/notification/v2/dingtalkconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/dingtalkconfig.go index f02141ed5..35e116922 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/dingtalkconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/dingtalkconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type DingTalkConfigsGetter interface { // DingTalkConfigInterface has methods to work with DingTalkConfig resources. type DingTalkConfigInterface interface { - Create(ctx context.Context, dingTalkConfig *v2.DingTalkConfig, opts v1.CreateOptions) (*v2.DingTalkConfig, error) - Update(ctx context.Context, dingTalkConfig *v2.DingTalkConfig, opts v1.UpdateOptions) (*v2.DingTalkConfig, error) - UpdateStatus(ctx context.Context, dingTalkConfig *v2.DingTalkConfig, opts v1.UpdateOptions) (*v2.DingTalkConfig, error) + Create(ctx context.Context, dingTalkConfig *v2alpha1.DingTalkConfig, opts v1.CreateOptions) (*v2alpha1.DingTalkConfig, error) + Update(ctx context.Context, dingTalkConfig *v2alpha1.DingTalkConfig, opts v1.UpdateOptions) (*v2alpha1.DingTalkConfig, error) + UpdateStatus(ctx context.Context, dingTalkConfig *v2alpha1.DingTalkConfig, opts v1.UpdateOptions) (*v2alpha1.DingTalkConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.DingTalkConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.DingTalkConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.DingTalkConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.DingTalkConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.DingTalkConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.DingTalkConfig, err error) DingTalkConfigExpansion } @@ -56,15 +56,15 @@ type dingTalkConfigs struct { } // newDingTalkConfigs returns a DingTalkConfigs -func newDingTalkConfigs(c *NotificationV2Client) *dingTalkConfigs { +func newDingTalkConfigs(c *NotificationV2alpha1Client) *dingTalkConfigs { return &dingTalkConfigs{ client: c.RESTClient(), } } // Get takes name of the dingTalkConfig, and returns the corresponding dingTalkConfig object, and an error if there is any. -func (c *dingTalkConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.DingTalkConfig, err error) { - result = &v2.DingTalkConfig{} +func (c *dingTalkConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.DingTalkConfig, err error) { + result = &v2alpha1.DingTalkConfig{} err = c.client.Get(). Resource("dingtalkconfigs"). Name(name). @@ -75,12 +75,12 @@ func (c *dingTalkConfigs) Get(ctx context.Context, name string, options v1.GetOp } // List takes label and field selectors, and returns the list of DingTalkConfigs that match those selectors. -func (c *dingTalkConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.DingTalkConfigList, err error) { +func (c *dingTalkConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.DingTalkConfigList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.DingTalkConfigList{} + result = &v2alpha1.DingTalkConfigList{} err = c.client.Get(). Resource("dingtalkconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *dingTalkConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch } // Create takes the representation of a dingTalkConfig and creates it. Returns the server's representation of the dingTalkConfig, and an error, if there is any. -func (c *dingTalkConfigs) Create(ctx context.Context, dingTalkConfig *v2.DingTalkConfig, opts v1.CreateOptions) (result *v2.DingTalkConfig, err error) { - result = &v2.DingTalkConfig{} +func (c *dingTalkConfigs) Create(ctx context.Context, dingTalkConfig *v2alpha1.DingTalkConfig, opts v1.CreateOptions) (result *v2alpha1.DingTalkConfig, err error) { + result = &v2alpha1.DingTalkConfig{} err = c.client.Post(). Resource("dingtalkconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *dingTalkConfigs) Create(ctx context.Context, dingTalkConfig *v2.DingTal } // Update takes the representation of a dingTalkConfig and updates it. Returns the server's representation of the dingTalkConfig, and an error, if there is any. -func (c *dingTalkConfigs) Update(ctx context.Context, dingTalkConfig *v2.DingTalkConfig, opts v1.UpdateOptions) (result *v2.DingTalkConfig, err error) { - result = &v2.DingTalkConfig{} +func (c *dingTalkConfigs) Update(ctx context.Context, dingTalkConfig *v2alpha1.DingTalkConfig, opts v1.UpdateOptions) (result *v2alpha1.DingTalkConfig, err error) { + result = &v2alpha1.DingTalkConfig{} err = c.client.Put(). Resource("dingtalkconfigs"). Name(dingTalkConfig.Name). @@ -131,8 +131,8 @@ func (c *dingTalkConfigs) Update(ctx context.Context, dingTalkConfig *v2.DingTal // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *dingTalkConfigs) UpdateStatus(ctx context.Context, dingTalkConfig *v2.DingTalkConfig, opts v1.UpdateOptions) (result *v2.DingTalkConfig, err error) { - result = &v2.DingTalkConfig{} +func (c *dingTalkConfigs) UpdateStatus(ctx context.Context, dingTalkConfig *v2alpha1.DingTalkConfig, opts v1.UpdateOptions) (result *v2alpha1.DingTalkConfig, err error) { + result = &v2alpha1.DingTalkConfig{} err = c.client.Put(). Resource("dingtalkconfigs"). Name(dingTalkConfig.Name). @@ -170,8 +170,8 @@ func (c *dingTalkConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOp } // Patch applies the patch and returns the patched dingTalkConfig. -func (c *dingTalkConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.DingTalkConfig, err error) { - result = &v2.DingTalkConfig{} +func (c *dingTalkConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.DingTalkConfig, err error) { + result = &v2alpha1.DingTalkConfig{} err = c.client.Patch(pt). Resource("dingtalkconfigs"). Name(name). diff --git a/pkg/client/clientset/versioned/typed/notification/v2/dingtalkreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/dingtalkreceiver.go similarity index 78% rename from pkg/client/clientset/versioned/typed/notification/v2/dingtalkreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/dingtalkreceiver.go index ba801ae4f..2eae8ca23 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/dingtalkreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/dingtalkreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type DingTalkReceiversGetter interface { // DingTalkReceiverInterface has methods to work with DingTalkReceiver resources. type DingTalkReceiverInterface interface { - Create(ctx context.Context, dingTalkReceiver *v2.DingTalkReceiver, opts v1.CreateOptions) (*v2.DingTalkReceiver, error) - Update(ctx context.Context, dingTalkReceiver *v2.DingTalkReceiver, opts v1.UpdateOptions) (*v2.DingTalkReceiver, error) - UpdateStatus(ctx context.Context, dingTalkReceiver *v2.DingTalkReceiver, opts v1.UpdateOptions) (*v2.DingTalkReceiver, error) + Create(ctx context.Context, dingTalkReceiver *v2alpha1.DingTalkReceiver, opts v1.CreateOptions) (*v2alpha1.DingTalkReceiver, error) + Update(ctx context.Context, dingTalkReceiver *v2alpha1.DingTalkReceiver, opts v1.UpdateOptions) (*v2alpha1.DingTalkReceiver, error) + UpdateStatus(ctx context.Context, dingTalkReceiver *v2alpha1.DingTalkReceiver, opts v1.UpdateOptions) (*v2alpha1.DingTalkReceiver, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.DingTalkReceiver, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.DingTalkReceiverList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.DingTalkReceiver, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.DingTalkReceiverList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.DingTalkReceiver, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.DingTalkReceiver, err error) DingTalkReceiverExpansion } @@ -56,15 +56,15 @@ type dingTalkReceivers struct { } // newDingTalkReceivers returns a DingTalkReceivers -func newDingTalkReceivers(c *NotificationV2Client) *dingTalkReceivers { +func newDingTalkReceivers(c *NotificationV2alpha1Client) *dingTalkReceivers { return &dingTalkReceivers{ client: c.RESTClient(), } } // Get takes name of the dingTalkReceiver, and returns the corresponding dingTalkReceiver object, and an error if there is any. -func (c *dingTalkReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.DingTalkReceiver, err error) { - result = &v2.DingTalkReceiver{} +func (c *dingTalkReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.DingTalkReceiver, err error) { + result = &v2alpha1.DingTalkReceiver{} err = c.client.Get(). Resource("dingtalkreceivers"). Name(name). @@ -75,12 +75,12 @@ func (c *dingTalkReceivers) Get(ctx context.Context, name string, options v1.Get } // List takes label and field selectors, and returns the list of DingTalkReceivers that match those selectors. -func (c *dingTalkReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.DingTalkReceiverList, err error) { +func (c *dingTalkReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.DingTalkReceiverList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.DingTalkReceiverList{} + result = &v2alpha1.DingTalkReceiverList{} err = c.client.Get(). Resource("dingtalkreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *dingTalkReceivers) Watch(ctx context.Context, opts v1.ListOptions) (wat } // Create takes the representation of a dingTalkReceiver and creates it. Returns the server's representation of the dingTalkReceiver, and an error, if there is any. -func (c *dingTalkReceivers) Create(ctx context.Context, dingTalkReceiver *v2.DingTalkReceiver, opts v1.CreateOptions) (result *v2.DingTalkReceiver, err error) { - result = &v2.DingTalkReceiver{} +func (c *dingTalkReceivers) Create(ctx context.Context, dingTalkReceiver *v2alpha1.DingTalkReceiver, opts v1.CreateOptions) (result *v2alpha1.DingTalkReceiver, err error) { + result = &v2alpha1.DingTalkReceiver{} err = c.client.Post(). Resource("dingtalkreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *dingTalkReceivers) Create(ctx context.Context, dingTalkReceiver *v2.Din } // Update takes the representation of a dingTalkReceiver and updates it. Returns the server's representation of the dingTalkReceiver, and an error, if there is any. -func (c *dingTalkReceivers) Update(ctx context.Context, dingTalkReceiver *v2.DingTalkReceiver, opts v1.UpdateOptions) (result *v2.DingTalkReceiver, err error) { - result = &v2.DingTalkReceiver{} +func (c *dingTalkReceivers) Update(ctx context.Context, dingTalkReceiver *v2alpha1.DingTalkReceiver, opts v1.UpdateOptions) (result *v2alpha1.DingTalkReceiver, err error) { + result = &v2alpha1.DingTalkReceiver{} err = c.client.Put(). Resource("dingtalkreceivers"). Name(dingTalkReceiver.Name). @@ -131,8 +131,8 @@ func (c *dingTalkReceivers) Update(ctx context.Context, dingTalkReceiver *v2.Din // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *dingTalkReceivers) UpdateStatus(ctx context.Context, dingTalkReceiver *v2.DingTalkReceiver, opts v1.UpdateOptions) (result *v2.DingTalkReceiver, err error) { - result = &v2.DingTalkReceiver{} +func (c *dingTalkReceivers) UpdateStatus(ctx context.Context, dingTalkReceiver *v2alpha1.DingTalkReceiver, opts v1.UpdateOptions) (result *v2alpha1.DingTalkReceiver, err error) { + result = &v2alpha1.DingTalkReceiver{} err = c.client.Put(). Resource("dingtalkreceivers"). Name(dingTalkReceiver.Name). @@ -170,8 +170,8 @@ func (c *dingTalkReceivers) DeleteCollection(ctx context.Context, opts v1.Delete } // Patch applies the patch and returns the patched dingTalkReceiver. -func (c *dingTalkReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.DingTalkReceiver, err error) { - result = &v2.DingTalkReceiver{} +func (c *dingTalkReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.DingTalkReceiver, err error) { + result = &v2alpha1.DingTalkReceiver{} err = c.client.Patch(pt). Resource("dingtalkreceivers"). Name(name). diff --git a/pkg/client/clientset/versioned/typed/notification/v2/doc.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/doc.go similarity index 97% rename from pkg/client/clientset/versioned/typed/notification/v2/doc.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/doc.go index 35a9a79f7..c24ff03b2 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/doc.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v2 +package v2alpha1 diff --git a/pkg/client/clientset/versioned/typed/notification/v2/emailconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/emailconfig.go similarity index 79% rename from pkg/client/clientset/versioned/typed/notification/v2/emailconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/emailconfig.go index 13bc00da6..d1fed1056 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/emailconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/emailconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type EmailConfigsGetter interface { // EmailConfigInterface has methods to work with EmailConfig resources. type EmailConfigInterface interface { - Create(ctx context.Context, emailConfig *v2.EmailConfig, opts v1.CreateOptions) (*v2.EmailConfig, error) - Update(ctx context.Context, emailConfig *v2.EmailConfig, opts v1.UpdateOptions) (*v2.EmailConfig, error) - UpdateStatus(ctx context.Context, emailConfig *v2.EmailConfig, opts v1.UpdateOptions) (*v2.EmailConfig, error) + Create(ctx context.Context, emailConfig *v2alpha1.EmailConfig, opts v1.CreateOptions) (*v2alpha1.EmailConfig, error) + Update(ctx context.Context, emailConfig *v2alpha1.EmailConfig, opts v1.UpdateOptions) (*v2alpha1.EmailConfig, error) + UpdateStatus(ctx context.Context, emailConfig *v2alpha1.EmailConfig, opts v1.UpdateOptions) (*v2alpha1.EmailConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.EmailConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.EmailConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.EmailConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.EmailConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.EmailConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.EmailConfig, err error) EmailConfigExpansion } @@ -56,15 +56,15 @@ type emailConfigs struct { } // newEmailConfigs returns a EmailConfigs -func newEmailConfigs(c *NotificationV2Client) *emailConfigs { +func newEmailConfigs(c *NotificationV2alpha1Client) *emailConfigs { return &emailConfigs{ client: c.RESTClient(), } } // Get takes name of the emailConfig, and returns the corresponding emailConfig object, and an error if there is any. -func (c *emailConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.EmailConfig, err error) { - result = &v2.EmailConfig{} +func (c *emailConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.EmailConfig, err error) { + result = &v2alpha1.EmailConfig{} err = c.client.Get(). Resource("emailconfigs"). Name(name). @@ -75,12 +75,12 @@ func (c *emailConfigs) Get(ctx context.Context, name string, options v1.GetOptio } // List takes label and field selectors, and returns the list of EmailConfigs that match those selectors. -func (c *emailConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.EmailConfigList, err error) { +func (c *emailConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.EmailConfigList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.EmailConfigList{} + result = &v2alpha1.EmailConfigList{} err = c.client.Get(). Resource("emailconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *emailConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.In } // Create takes the representation of a emailConfig and creates it. Returns the server's representation of the emailConfig, and an error, if there is any. -func (c *emailConfigs) Create(ctx context.Context, emailConfig *v2.EmailConfig, opts v1.CreateOptions) (result *v2.EmailConfig, err error) { - result = &v2.EmailConfig{} +func (c *emailConfigs) Create(ctx context.Context, emailConfig *v2alpha1.EmailConfig, opts v1.CreateOptions) (result *v2alpha1.EmailConfig, err error) { + result = &v2alpha1.EmailConfig{} err = c.client.Post(). Resource("emailconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *emailConfigs) Create(ctx context.Context, emailConfig *v2.EmailConfig, } // Update takes the representation of a emailConfig and updates it. Returns the server's representation of the emailConfig, and an error, if there is any. -func (c *emailConfigs) Update(ctx context.Context, emailConfig *v2.EmailConfig, opts v1.UpdateOptions) (result *v2.EmailConfig, err error) { - result = &v2.EmailConfig{} +func (c *emailConfigs) Update(ctx context.Context, emailConfig *v2alpha1.EmailConfig, opts v1.UpdateOptions) (result *v2alpha1.EmailConfig, err error) { + result = &v2alpha1.EmailConfig{} err = c.client.Put(). Resource("emailconfigs"). Name(emailConfig.Name). @@ -131,8 +131,8 @@ func (c *emailConfigs) Update(ctx context.Context, emailConfig *v2.EmailConfig, // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *emailConfigs) UpdateStatus(ctx context.Context, emailConfig *v2.EmailConfig, opts v1.UpdateOptions) (result *v2.EmailConfig, err error) { - result = &v2.EmailConfig{} +func (c *emailConfigs) UpdateStatus(ctx context.Context, emailConfig *v2alpha1.EmailConfig, opts v1.UpdateOptions) (result *v2alpha1.EmailConfig, err error) { + result = &v2alpha1.EmailConfig{} err = c.client.Put(). Resource("emailconfigs"). Name(emailConfig.Name). @@ -170,8 +170,8 @@ func (c *emailConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptio } // Patch applies the patch and returns the patched emailConfig. -func (c *emailConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.EmailConfig, err error) { - result = &v2.EmailConfig{} +func (c *emailConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.EmailConfig, err error) { + result = &v2alpha1.EmailConfig{} err = c.client.Patch(pt). Resource("emailconfigs"). Name(name). diff --git a/pkg/client/clientset/versioned/typed/notification/v2/emailreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/emailreceiver.go similarity index 79% rename from pkg/client/clientset/versioned/typed/notification/v2/emailreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/emailreceiver.go index 65964d6cd..2ea00f10c 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/emailreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/emailreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type EmailReceiversGetter interface { // EmailReceiverInterface has methods to work with EmailReceiver resources. type EmailReceiverInterface interface { - Create(ctx context.Context, emailReceiver *v2.EmailReceiver, opts v1.CreateOptions) (*v2.EmailReceiver, error) - Update(ctx context.Context, emailReceiver *v2.EmailReceiver, opts v1.UpdateOptions) (*v2.EmailReceiver, error) - UpdateStatus(ctx context.Context, emailReceiver *v2.EmailReceiver, opts v1.UpdateOptions) (*v2.EmailReceiver, error) + Create(ctx context.Context, emailReceiver *v2alpha1.EmailReceiver, opts v1.CreateOptions) (*v2alpha1.EmailReceiver, error) + Update(ctx context.Context, emailReceiver *v2alpha1.EmailReceiver, opts v1.UpdateOptions) (*v2alpha1.EmailReceiver, error) + UpdateStatus(ctx context.Context, emailReceiver *v2alpha1.EmailReceiver, opts v1.UpdateOptions) (*v2alpha1.EmailReceiver, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.EmailReceiver, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.EmailReceiverList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.EmailReceiver, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.EmailReceiverList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.EmailReceiver, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.EmailReceiver, err error) EmailReceiverExpansion } @@ -56,15 +56,15 @@ type emailReceivers struct { } // newEmailReceivers returns a EmailReceivers -func newEmailReceivers(c *NotificationV2Client) *emailReceivers { +func newEmailReceivers(c *NotificationV2alpha1Client) *emailReceivers { return &emailReceivers{ client: c.RESTClient(), } } // Get takes name of the emailReceiver, and returns the corresponding emailReceiver object, and an error if there is any. -func (c *emailReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.EmailReceiver, err error) { - result = &v2.EmailReceiver{} +func (c *emailReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.EmailReceiver, err error) { + result = &v2alpha1.EmailReceiver{} err = c.client.Get(). Resource("emailreceivers"). Name(name). @@ -75,12 +75,12 @@ func (c *emailReceivers) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of EmailReceivers that match those selectors. -func (c *emailReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.EmailReceiverList, err error) { +func (c *emailReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.EmailReceiverList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.EmailReceiverList{} + result = &v2alpha1.EmailReceiverList{} err = c.client.Get(). Resource("emailreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *emailReceivers) Watch(ctx context.Context, opts v1.ListOptions) (watch. } // Create takes the representation of a emailReceiver and creates it. Returns the server's representation of the emailReceiver, and an error, if there is any. -func (c *emailReceivers) Create(ctx context.Context, emailReceiver *v2.EmailReceiver, opts v1.CreateOptions) (result *v2.EmailReceiver, err error) { - result = &v2.EmailReceiver{} +func (c *emailReceivers) Create(ctx context.Context, emailReceiver *v2alpha1.EmailReceiver, opts v1.CreateOptions) (result *v2alpha1.EmailReceiver, err error) { + result = &v2alpha1.EmailReceiver{} err = c.client.Post(). Resource("emailreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *emailReceivers) Create(ctx context.Context, emailReceiver *v2.EmailRece } // Update takes the representation of a emailReceiver and updates it. Returns the server's representation of the emailReceiver, and an error, if there is any. -func (c *emailReceivers) Update(ctx context.Context, emailReceiver *v2.EmailReceiver, opts v1.UpdateOptions) (result *v2.EmailReceiver, err error) { - result = &v2.EmailReceiver{} +func (c *emailReceivers) Update(ctx context.Context, emailReceiver *v2alpha1.EmailReceiver, opts v1.UpdateOptions) (result *v2alpha1.EmailReceiver, err error) { + result = &v2alpha1.EmailReceiver{} err = c.client.Put(). Resource("emailreceivers"). Name(emailReceiver.Name). @@ -131,8 +131,8 @@ func (c *emailReceivers) Update(ctx context.Context, emailReceiver *v2.EmailRece // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *emailReceivers) UpdateStatus(ctx context.Context, emailReceiver *v2.EmailReceiver, opts v1.UpdateOptions) (result *v2.EmailReceiver, err error) { - result = &v2.EmailReceiver{} +func (c *emailReceivers) UpdateStatus(ctx context.Context, emailReceiver *v2alpha1.EmailReceiver, opts v1.UpdateOptions) (result *v2alpha1.EmailReceiver, err error) { + result = &v2alpha1.EmailReceiver{} err = c.client.Put(). Resource("emailreceivers"). Name(emailReceiver.Name). @@ -170,8 +170,8 @@ func (c *emailReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOpt } // Patch applies the patch and returns the patched emailReceiver. -func (c *emailReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.EmailReceiver, err error) { - result = &v2.EmailReceiver{} +func (c *emailReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.EmailReceiver, err error) { + result = &v2alpha1.EmailReceiver{} err = c.client.Patch(pt). Resource("emailreceivers"). Name(name). diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/doc.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/doc.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_dingtalkconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_dingtalkconfig.go similarity index 72% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_dingtalkconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_dingtalkconfig.go index b3d6c754a..389c64f1b 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_dingtalkconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_dingtalkconfig.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeDingTalkConfigs implements DingTalkConfigInterface type FakeDingTalkConfigs struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var dingtalkconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "dingtalkconfigs"} +var dingtalkconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "dingtalkconfigs"} -var dingtalkconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "DingTalkConfig"} +var dingtalkconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "DingTalkConfig"} // Get takes name of the dingTalkConfig, and returns the corresponding dingTalkConfig object, and an error if there is any. -func (c *FakeDingTalkConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.DingTalkConfig, err error) { +func (c *FakeDingTalkConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.DingTalkConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(dingtalkconfigsResource, name), &v2.DingTalkConfig{}) + Invokes(testing.NewRootGetAction(dingtalkconfigsResource, name), &v2alpha1.DingTalkConfig{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkConfig), err + return obj.(*v2alpha1.DingTalkConfig), err } // List takes label and field selectors, and returns the list of DingTalkConfigs that match those selectors. -func (c *FakeDingTalkConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.DingTalkConfigList, err error) { +func (c *FakeDingTalkConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.DingTalkConfigList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(dingtalkconfigsResource, dingtalkconfigsKind, opts), &v2.DingTalkConfigList{}) + Invokes(testing.NewRootListAction(dingtalkconfigsResource, dingtalkconfigsKind, opts), &v2alpha1.DingTalkConfigList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeDingTalkConfigs) List(ctx context.Context, opts v1.ListOptions) (re if label == nil { label = labels.Everything() } - list := &v2.DingTalkConfigList{ListMeta: obj.(*v2.DingTalkConfigList).ListMeta} - for _, item := range obj.(*v2.DingTalkConfigList).Items { + list := &v2alpha1.DingTalkConfigList{ListMeta: obj.(*v2alpha1.DingTalkConfigList).ListMeta} + for _, item := range obj.(*v2alpha1.DingTalkConfigList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeDingTalkConfigs) Watch(ctx context.Context, opts v1.ListOptions) (w } // Create takes the representation of a dingTalkConfig and creates it. Returns the server's representation of the dingTalkConfig, and an error, if there is any. -func (c *FakeDingTalkConfigs) Create(ctx context.Context, dingTalkConfig *v2.DingTalkConfig, opts v1.CreateOptions) (result *v2.DingTalkConfig, err error) { +func (c *FakeDingTalkConfigs) Create(ctx context.Context, dingTalkConfig *v2alpha1.DingTalkConfig, opts v1.CreateOptions) (result *v2alpha1.DingTalkConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(dingtalkconfigsResource, dingTalkConfig), &v2.DingTalkConfig{}) + Invokes(testing.NewRootCreateAction(dingtalkconfigsResource, dingTalkConfig), &v2alpha1.DingTalkConfig{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkConfig), err + return obj.(*v2alpha1.DingTalkConfig), err } // Update takes the representation of a dingTalkConfig and updates it. Returns the server's representation of the dingTalkConfig, and an error, if there is any. -func (c *FakeDingTalkConfigs) Update(ctx context.Context, dingTalkConfig *v2.DingTalkConfig, opts v1.UpdateOptions) (result *v2.DingTalkConfig, err error) { +func (c *FakeDingTalkConfigs) Update(ctx context.Context, dingTalkConfig *v2alpha1.DingTalkConfig, opts v1.UpdateOptions) (result *v2alpha1.DingTalkConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(dingtalkconfigsResource, dingTalkConfig), &v2.DingTalkConfig{}) + Invokes(testing.NewRootUpdateAction(dingtalkconfigsResource, dingTalkConfig), &v2alpha1.DingTalkConfig{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkConfig), err + return obj.(*v2alpha1.DingTalkConfig), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDingTalkConfigs) UpdateStatus(ctx context.Context, dingTalkConfig *v2.DingTalkConfig, opts v1.UpdateOptions) (*v2.DingTalkConfig, error) { +func (c *FakeDingTalkConfigs) UpdateStatus(ctx context.Context, dingTalkConfig *v2alpha1.DingTalkConfig, opts v1.UpdateOptions) (*v2alpha1.DingTalkConfig, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(dingtalkconfigsResource, "status", dingTalkConfig), &v2.DingTalkConfig{}) + Invokes(testing.NewRootUpdateSubresourceAction(dingtalkconfigsResource, "status", dingTalkConfig), &v2alpha1.DingTalkConfig{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkConfig), err + return obj.(*v2alpha1.DingTalkConfig), err } // Delete takes name of the dingTalkConfig and deletes it. Returns an error if one occurs. func (c *FakeDingTalkConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(dingtalkconfigsResource, name), &v2.DingTalkConfig{}) + Invokes(testing.NewRootDeleteAction(dingtalkconfigsResource, name), &v2alpha1.DingTalkConfig{}) return err } @@ -118,16 +118,16 @@ func (c *FakeDingTalkConfigs) Delete(ctx context.Context, name string, opts v1.D func (c *FakeDingTalkConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(dingtalkconfigsResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.DingTalkConfigList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.DingTalkConfigList{}) return err } // Patch applies the patch and returns the patched dingTalkConfig. -func (c *FakeDingTalkConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.DingTalkConfig, err error) { +func (c *FakeDingTalkConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.DingTalkConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(dingtalkconfigsResource, name, pt, data, subresources...), &v2.DingTalkConfig{}) + Invokes(testing.NewRootPatchSubresourceAction(dingtalkconfigsResource, name, pt, data, subresources...), &v2alpha1.DingTalkConfig{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkConfig), err + return obj.(*v2alpha1.DingTalkConfig), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_dingtalkreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_dingtalkreceiver.go similarity index 71% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_dingtalkreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_dingtalkreceiver.go index 0a918bce5..f0d7c3a2d 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_dingtalkreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_dingtalkreceiver.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeDingTalkReceivers implements DingTalkReceiverInterface type FakeDingTalkReceivers struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var dingtalkreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "dingtalkreceivers"} +var dingtalkreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "dingtalkreceivers"} -var dingtalkreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "DingTalkReceiver"} +var dingtalkreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "DingTalkReceiver"} // Get takes name of the dingTalkReceiver, and returns the corresponding dingTalkReceiver object, and an error if there is any. -func (c *FakeDingTalkReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.DingTalkReceiver, err error) { +func (c *FakeDingTalkReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.DingTalkReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(dingtalkreceiversResource, name), &v2.DingTalkReceiver{}) + Invokes(testing.NewRootGetAction(dingtalkreceiversResource, name), &v2alpha1.DingTalkReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkReceiver), err + return obj.(*v2alpha1.DingTalkReceiver), err } // List takes label and field selectors, and returns the list of DingTalkReceivers that match those selectors. -func (c *FakeDingTalkReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.DingTalkReceiverList, err error) { +func (c *FakeDingTalkReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.DingTalkReceiverList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(dingtalkreceiversResource, dingtalkreceiversKind, opts), &v2.DingTalkReceiverList{}) + Invokes(testing.NewRootListAction(dingtalkreceiversResource, dingtalkreceiversKind, opts), &v2alpha1.DingTalkReceiverList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeDingTalkReceivers) List(ctx context.Context, opts v1.ListOptions) ( if label == nil { label = labels.Everything() } - list := &v2.DingTalkReceiverList{ListMeta: obj.(*v2.DingTalkReceiverList).ListMeta} - for _, item := range obj.(*v2.DingTalkReceiverList).Items { + list := &v2alpha1.DingTalkReceiverList{ListMeta: obj.(*v2alpha1.DingTalkReceiverList).ListMeta} + for _, item := range obj.(*v2alpha1.DingTalkReceiverList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeDingTalkReceivers) Watch(ctx context.Context, opts v1.ListOptions) } // Create takes the representation of a dingTalkReceiver and creates it. Returns the server's representation of the dingTalkReceiver, and an error, if there is any. -func (c *FakeDingTalkReceivers) Create(ctx context.Context, dingTalkReceiver *v2.DingTalkReceiver, opts v1.CreateOptions) (result *v2.DingTalkReceiver, err error) { +func (c *FakeDingTalkReceivers) Create(ctx context.Context, dingTalkReceiver *v2alpha1.DingTalkReceiver, opts v1.CreateOptions) (result *v2alpha1.DingTalkReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(dingtalkreceiversResource, dingTalkReceiver), &v2.DingTalkReceiver{}) + Invokes(testing.NewRootCreateAction(dingtalkreceiversResource, dingTalkReceiver), &v2alpha1.DingTalkReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkReceiver), err + return obj.(*v2alpha1.DingTalkReceiver), err } // Update takes the representation of a dingTalkReceiver and updates it. Returns the server's representation of the dingTalkReceiver, and an error, if there is any. -func (c *FakeDingTalkReceivers) Update(ctx context.Context, dingTalkReceiver *v2.DingTalkReceiver, opts v1.UpdateOptions) (result *v2.DingTalkReceiver, err error) { +func (c *FakeDingTalkReceivers) Update(ctx context.Context, dingTalkReceiver *v2alpha1.DingTalkReceiver, opts v1.UpdateOptions) (result *v2alpha1.DingTalkReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(dingtalkreceiversResource, dingTalkReceiver), &v2.DingTalkReceiver{}) + Invokes(testing.NewRootUpdateAction(dingtalkreceiversResource, dingTalkReceiver), &v2alpha1.DingTalkReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkReceiver), err + return obj.(*v2alpha1.DingTalkReceiver), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDingTalkReceivers) UpdateStatus(ctx context.Context, dingTalkReceiver *v2.DingTalkReceiver, opts v1.UpdateOptions) (*v2.DingTalkReceiver, error) { +func (c *FakeDingTalkReceivers) UpdateStatus(ctx context.Context, dingTalkReceiver *v2alpha1.DingTalkReceiver, opts v1.UpdateOptions) (*v2alpha1.DingTalkReceiver, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(dingtalkreceiversResource, "status", dingTalkReceiver), &v2.DingTalkReceiver{}) + Invokes(testing.NewRootUpdateSubresourceAction(dingtalkreceiversResource, "status", dingTalkReceiver), &v2alpha1.DingTalkReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkReceiver), err + return obj.(*v2alpha1.DingTalkReceiver), err } // Delete takes name of the dingTalkReceiver and deletes it. Returns an error if one occurs. func (c *FakeDingTalkReceivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(dingtalkreceiversResource, name), &v2.DingTalkReceiver{}) + Invokes(testing.NewRootDeleteAction(dingtalkreceiversResource, name), &v2alpha1.DingTalkReceiver{}) return err } @@ -118,16 +118,16 @@ func (c *FakeDingTalkReceivers) Delete(ctx context.Context, name string, opts v1 func (c *FakeDingTalkReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(dingtalkreceiversResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.DingTalkReceiverList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.DingTalkReceiverList{}) return err } // Patch applies the patch and returns the patched dingTalkReceiver. -func (c *FakeDingTalkReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.DingTalkReceiver, err error) { +func (c *FakeDingTalkReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.DingTalkReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(dingtalkreceiversResource, name, pt, data, subresources...), &v2.DingTalkReceiver{}) + Invokes(testing.NewRootPatchSubresourceAction(dingtalkreceiversResource, name, pt, data, subresources...), &v2alpha1.DingTalkReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.DingTalkReceiver), err + return obj.(*v2alpha1.DingTalkReceiver), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_emailconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_emailconfig.go similarity index 74% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_emailconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_emailconfig.go index 54c7c513c..c0fd91fb3 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_emailconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_emailconfig.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeEmailConfigs implements EmailConfigInterface type FakeEmailConfigs struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var emailconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "emailconfigs"} +var emailconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "emailconfigs"} -var emailconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "EmailConfig"} +var emailconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "EmailConfig"} // Get takes name of the emailConfig, and returns the corresponding emailConfig object, and an error if there is any. -func (c *FakeEmailConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.EmailConfig, err error) { +func (c *FakeEmailConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.EmailConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(emailconfigsResource, name), &v2.EmailConfig{}) + Invokes(testing.NewRootGetAction(emailconfigsResource, name), &v2alpha1.EmailConfig{}) if obj == nil { return nil, err } - return obj.(*v2.EmailConfig), err + return obj.(*v2alpha1.EmailConfig), err } // List takes label and field selectors, and returns the list of EmailConfigs that match those selectors. -func (c *FakeEmailConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.EmailConfigList, err error) { +func (c *FakeEmailConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.EmailConfigList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(emailconfigsResource, emailconfigsKind, opts), &v2.EmailConfigList{}) + Invokes(testing.NewRootListAction(emailconfigsResource, emailconfigsKind, opts), &v2alpha1.EmailConfigList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeEmailConfigs) List(ctx context.Context, opts v1.ListOptions) (resul if label == nil { label = labels.Everything() } - list := &v2.EmailConfigList{ListMeta: obj.(*v2.EmailConfigList).ListMeta} - for _, item := range obj.(*v2.EmailConfigList).Items { + list := &v2alpha1.EmailConfigList{ListMeta: obj.(*v2alpha1.EmailConfigList).ListMeta} + for _, item := range obj.(*v2alpha1.EmailConfigList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeEmailConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watc } // Create takes the representation of a emailConfig and creates it. Returns the server's representation of the emailConfig, and an error, if there is any. -func (c *FakeEmailConfigs) Create(ctx context.Context, emailConfig *v2.EmailConfig, opts v1.CreateOptions) (result *v2.EmailConfig, err error) { +func (c *FakeEmailConfigs) Create(ctx context.Context, emailConfig *v2alpha1.EmailConfig, opts v1.CreateOptions) (result *v2alpha1.EmailConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(emailconfigsResource, emailConfig), &v2.EmailConfig{}) + Invokes(testing.NewRootCreateAction(emailconfigsResource, emailConfig), &v2alpha1.EmailConfig{}) if obj == nil { return nil, err } - return obj.(*v2.EmailConfig), err + return obj.(*v2alpha1.EmailConfig), err } // Update takes the representation of a emailConfig and updates it. Returns the server's representation of the emailConfig, and an error, if there is any. -func (c *FakeEmailConfigs) Update(ctx context.Context, emailConfig *v2.EmailConfig, opts v1.UpdateOptions) (result *v2.EmailConfig, err error) { +func (c *FakeEmailConfigs) Update(ctx context.Context, emailConfig *v2alpha1.EmailConfig, opts v1.UpdateOptions) (result *v2alpha1.EmailConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(emailconfigsResource, emailConfig), &v2.EmailConfig{}) + Invokes(testing.NewRootUpdateAction(emailconfigsResource, emailConfig), &v2alpha1.EmailConfig{}) if obj == nil { return nil, err } - return obj.(*v2.EmailConfig), err + return obj.(*v2alpha1.EmailConfig), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeEmailConfigs) UpdateStatus(ctx context.Context, emailConfig *v2.EmailConfig, opts v1.UpdateOptions) (*v2.EmailConfig, error) { +func (c *FakeEmailConfigs) UpdateStatus(ctx context.Context, emailConfig *v2alpha1.EmailConfig, opts v1.UpdateOptions) (*v2alpha1.EmailConfig, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(emailconfigsResource, "status", emailConfig), &v2.EmailConfig{}) + Invokes(testing.NewRootUpdateSubresourceAction(emailconfigsResource, "status", emailConfig), &v2alpha1.EmailConfig{}) if obj == nil { return nil, err } - return obj.(*v2.EmailConfig), err + return obj.(*v2alpha1.EmailConfig), err } // Delete takes name of the emailConfig and deletes it. Returns an error if one occurs. func (c *FakeEmailConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(emailconfigsResource, name), &v2.EmailConfig{}) + Invokes(testing.NewRootDeleteAction(emailconfigsResource, name), &v2alpha1.EmailConfig{}) return err } @@ -118,16 +118,16 @@ func (c *FakeEmailConfigs) Delete(ctx context.Context, name string, opts v1.Dele func (c *FakeEmailConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(emailconfigsResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.EmailConfigList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.EmailConfigList{}) return err } // Patch applies the patch and returns the patched emailConfig. -func (c *FakeEmailConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.EmailConfig, err error) { +func (c *FakeEmailConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.EmailConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(emailconfigsResource, name, pt, data, subresources...), &v2.EmailConfig{}) + Invokes(testing.NewRootPatchSubresourceAction(emailconfigsResource, name, pt, data, subresources...), &v2alpha1.EmailConfig{}) if obj == nil { return nil, err } - return obj.(*v2.EmailConfig), err + return obj.(*v2alpha1.EmailConfig), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_emailreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_emailreceiver.go similarity index 73% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_emailreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_emailreceiver.go index a4fd51cc9..e86ff71a1 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_emailreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_emailreceiver.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeEmailReceivers implements EmailReceiverInterface type FakeEmailReceivers struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var emailreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "emailreceivers"} +var emailreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "emailreceivers"} -var emailreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "EmailReceiver"} +var emailreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "EmailReceiver"} // Get takes name of the emailReceiver, and returns the corresponding emailReceiver object, and an error if there is any. -func (c *FakeEmailReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.EmailReceiver, err error) { +func (c *FakeEmailReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.EmailReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(emailreceiversResource, name), &v2.EmailReceiver{}) + Invokes(testing.NewRootGetAction(emailreceiversResource, name), &v2alpha1.EmailReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.EmailReceiver), err + return obj.(*v2alpha1.EmailReceiver), err } // List takes label and field selectors, and returns the list of EmailReceivers that match those selectors. -func (c *FakeEmailReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.EmailReceiverList, err error) { +func (c *FakeEmailReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.EmailReceiverList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(emailreceiversResource, emailreceiversKind, opts), &v2.EmailReceiverList{}) + Invokes(testing.NewRootListAction(emailreceiversResource, emailreceiversKind, opts), &v2alpha1.EmailReceiverList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeEmailReceivers) List(ctx context.Context, opts v1.ListOptions) (res if label == nil { label = labels.Everything() } - list := &v2.EmailReceiverList{ListMeta: obj.(*v2.EmailReceiverList).ListMeta} - for _, item := range obj.(*v2.EmailReceiverList).Items { + list := &v2alpha1.EmailReceiverList{ListMeta: obj.(*v2alpha1.EmailReceiverList).ListMeta} + for _, item := range obj.(*v2alpha1.EmailReceiverList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeEmailReceivers) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a emailReceiver and creates it. Returns the server's representation of the emailReceiver, and an error, if there is any. -func (c *FakeEmailReceivers) Create(ctx context.Context, emailReceiver *v2.EmailReceiver, opts v1.CreateOptions) (result *v2.EmailReceiver, err error) { +func (c *FakeEmailReceivers) Create(ctx context.Context, emailReceiver *v2alpha1.EmailReceiver, opts v1.CreateOptions) (result *v2alpha1.EmailReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(emailreceiversResource, emailReceiver), &v2.EmailReceiver{}) + Invokes(testing.NewRootCreateAction(emailreceiversResource, emailReceiver), &v2alpha1.EmailReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.EmailReceiver), err + return obj.(*v2alpha1.EmailReceiver), err } // Update takes the representation of a emailReceiver and updates it. Returns the server's representation of the emailReceiver, and an error, if there is any. -func (c *FakeEmailReceivers) Update(ctx context.Context, emailReceiver *v2.EmailReceiver, opts v1.UpdateOptions) (result *v2.EmailReceiver, err error) { +func (c *FakeEmailReceivers) Update(ctx context.Context, emailReceiver *v2alpha1.EmailReceiver, opts v1.UpdateOptions) (result *v2alpha1.EmailReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(emailreceiversResource, emailReceiver), &v2.EmailReceiver{}) + Invokes(testing.NewRootUpdateAction(emailreceiversResource, emailReceiver), &v2alpha1.EmailReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.EmailReceiver), err + return obj.(*v2alpha1.EmailReceiver), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeEmailReceivers) UpdateStatus(ctx context.Context, emailReceiver *v2.EmailReceiver, opts v1.UpdateOptions) (*v2.EmailReceiver, error) { +func (c *FakeEmailReceivers) UpdateStatus(ctx context.Context, emailReceiver *v2alpha1.EmailReceiver, opts v1.UpdateOptions) (*v2alpha1.EmailReceiver, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(emailreceiversResource, "status", emailReceiver), &v2.EmailReceiver{}) + Invokes(testing.NewRootUpdateSubresourceAction(emailreceiversResource, "status", emailReceiver), &v2alpha1.EmailReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.EmailReceiver), err + return obj.(*v2alpha1.EmailReceiver), err } // Delete takes name of the emailReceiver and deletes it. Returns an error if one occurs. func (c *FakeEmailReceivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(emailreceiversResource, name), &v2.EmailReceiver{}) + Invokes(testing.NewRootDeleteAction(emailreceiversResource, name), &v2alpha1.EmailReceiver{}) return err } @@ -118,16 +118,16 @@ func (c *FakeEmailReceivers) Delete(ctx context.Context, name string, opts v1.De func (c *FakeEmailReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(emailreceiversResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.EmailReceiverList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.EmailReceiverList{}) return err } // Patch applies the patch and returns the patched emailReceiver. -func (c *FakeEmailReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.EmailReceiver, err error) { +func (c *FakeEmailReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.EmailReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(emailreceiversResource, name, pt, data, subresources...), &v2.EmailReceiver{}) + Invokes(testing.NewRootPatchSubresourceAction(emailreceiversResource, name, pt, data, subresources...), &v2alpha1.EmailReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.EmailReceiver), err + return obj.(*v2alpha1.EmailReceiver), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_notification_client.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_notification_client.go similarity index 53% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_notification_client.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_notification_client.go index eeb60aec4..cbab6a87a 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_notification_client.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_notification_client.go @@ -21,56 +21,56 @@ package fake import ( rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2alpha1" ) -type FakeNotificationV2 struct { +type FakeNotificationV2alpha1 struct { *testing.Fake } -func (c *FakeNotificationV2) DingTalkConfigs() v2.DingTalkConfigInterface { +func (c *FakeNotificationV2alpha1) DingTalkConfigs() v2alpha1.DingTalkConfigInterface { return &FakeDingTalkConfigs{c} } -func (c *FakeNotificationV2) DingTalkReceivers() v2.DingTalkReceiverInterface { +func (c *FakeNotificationV2alpha1) DingTalkReceivers() v2alpha1.DingTalkReceiverInterface { return &FakeDingTalkReceivers{c} } -func (c *FakeNotificationV2) EmailConfigs() v2.EmailConfigInterface { +func (c *FakeNotificationV2alpha1) EmailConfigs() v2alpha1.EmailConfigInterface { return &FakeEmailConfigs{c} } -func (c *FakeNotificationV2) EmailReceivers() v2.EmailReceiverInterface { +func (c *FakeNotificationV2alpha1) EmailReceivers() v2alpha1.EmailReceiverInterface { return &FakeEmailReceivers{c} } -func (c *FakeNotificationV2) SlackConfigs() v2.SlackConfigInterface { +func (c *FakeNotificationV2alpha1) SlackConfigs() v2alpha1.SlackConfigInterface { return &FakeSlackConfigs{c} } -func (c *FakeNotificationV2) SlackReceivers() v2.SlackReceiverInterface { +func (c *FakeNotificationV2alpha1) SlackReceivers() v2alpha1.SlackReceiverInterface { return &FakeSlackReceivers{c} } -func (c *FakeNotificationV2) WebhookConfigs() v2.WebhookConfigInterface { +func (c *FakeNotificationV2alpha1) WebhookConfigs() v2alpha1.WebhookConfigInterface { return &FakeWebhookConfigs{c} } -func (c *FakeNotificationV2) WebhookReceivers() v2.WebhookReceiverInterface { +func (c *FakeNotificationV2alpha1) WebhookReceivers() v2alpha1.WebhookReceiverInterface { return &FakeWebhookReceivers{c} } -func (c *FakeNotificationV2) WechatConfigs() v2.WechatConfigInterface { +func (c *FakeNotificationV2alpha1) WechatConfigs() v2alpha1.WechatConfigInterface { return &FakeWechatConfigs{c} } -func (c *FakeNotificationV2) WechatReceivers() v2.WechatReceiverInterface { +func (c *FakeNotificationV2alpha1) WechatReceivers() v2alpha1.WechatReceiverInterface { return &FakeWechatReceivers{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeNotificationV2) RESTClient() rest.Interface { +func (c *FakeNotificationV2alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_slackconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_slackconfig.go similarity index 74% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_slackconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_slackconfig.go index 605bb2d4b..ebcde2272 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_slackconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_slackconfig.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeSlackConfigs implements SlackConfigInterface type FakeSlackConfigs struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var slackconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "slackconfigs"} +var slackconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "slackconfigs"} -var slackconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "SlackConfig"} +var slackconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "SlackConfig"} // Get takes name of the slackConfig, and returns the corresponding slackConfig object, and an error if there is any. -func (c *FakeSlackConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.SlackConfig, err error) { +func (c *FakeSlackConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.SlackConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(slackconfigsResource, name), &v2.SlackConfig{}) + Invokes(testing.NewRootGetAction(slackconfigsResource, name), &v2alpha1.SlackConfig{}) if obj == nil { return nil, err } - return obj.(*v2.SlackConfig), err + return obj.(*v2alpha1.SlackConfig), err } // List takes label and field selectors, and returns the list of SlackConfigs that match those selectors. -func (c *FakeSlackConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.SlackConfigList, err error) { +func (c *FakeSlackConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.SlackConfigList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(slackconfigsResource, slackconfigsKind, opts), &v2.SlackConfigList{}) + Invokes(testing.NewRootListAction(slackconfigsResource, slackconfigsKind, opts), &v2alpha1.SlackConfigList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeSlackConfigs) List(ctx context.Context, opts v1.ListOptions) (resul if label == nil { label = labels.Everything() } - list := &v2.SlackConfigList{ListMeta: obj.(*v2.SlackConfigList).ListMeta} - for _, item := range obj.(*v2.SlackConfigList).Items { + list := &v2alpha1.SlackConfigList{ListMeta: obj.(*v2alpha1.SlackConfigList).ListMeta} + for _, item := range obj.(*v2alpha1.SlackConfigList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeSlackConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watc } // Create takes the representation of a slackConfig and creates it. Returns the server's representation of the slackConfig, and an error, if there is any. -func (c *FakeSlackConfigs) Create(ctx context.Context, slackConfig *v2.SlackConfig, opts v1.CreateOptions) (result *v2.SlackConfig, err error) { +func (c *FakeSlackConfigs) Create(ctx context.Context, slackConfig *v2alpha1.SlackConfig, opts v1.CreateOptions) (result *v2alpha1.SlackConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(slackconfigsResource, slackConfig), &v2.SlackConfig{}) + Invokes(testing.NewRootCreateAction(slackconfigsResource, slackConfig), &v2alpha1.SlackConfig{}) if obj == nil { return nil, err } - return obj.(*v2.SlackConfig), err + return obj.(*v2alpha1.SlackConfig), err } // Update takes the representation of a slackConfig and updates it. Returns the server's representation of the slackConfig, and an error, if there is any. -func (c *FakeSlackConfigs) Update(ctx context.Context, slackConfig *v2.SlackConfig, opts v1.UpdateOptions) (result *v2.SlackConfig, err error) { +func (c *FakeSlackConfigs) Update(ctx context.Context, slackConfig *v2alpha1.SlackConfig, opts v1.UpdateOptions) (result *v2alpha1.SlackConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(slackconfigsResource, slackConfig), &v2.SlackConfig{}) + Invokes(testing.NewRootUpdateAction(slackconfigsResource, slackConfig), &v2alpha1.SlackConfig{}) if obj == nil { return nil, err } - return obj.(*v2.SlackConfig), err + return obj.(*v2alpha1.SlackConfig), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeSlackConfigs) UpdateStatus(ctx context.Context, slackConfig *v2.SlackConfig, opts v1.UpdateOptions) (*v2.SlackConfig, error) { +func (c *FakeSlackConfigs) UpdateStatus(ctx context.Context, slackConfig *v2alpha1.SlackConfig, opts v1.UpdateOptions) (*v2alpha1.SlackConfig, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(slackconfigsResource, "status", slackConfig), &v2.SlackConfig{}) + Invokes(testing.NewRootUpdateSubresourceAction(slackconfigsResource, "status", slackConfig), &v2alpha1.SlackConfig{}) if obj == nil { return nil, err } - return obj.(*v2.SlackConfig), err + return obj.(*v2alpha1.SlackConfig), err } // Delete takes name of the slackConfig and deletes it. Returns an error if one occurs. func (c *FakeSlackConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(slackconfigsResource, name), &v2.SlackConfig{}) + Invokes(testing.NewRootDeleteAction(slackconfigsResource, name), &v2alpha1.SlackConfig{}) return err } @@ -118,16 +118,16 @@ func (c *FakeSlackConfigs) Delete(ctx context.Context, name string, opts v1.Dele func (c *FakeSlackConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(slackconfigsResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.SlackConfigList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.SlackConfigList{}) return err } // Patch applies the patch and returns the patched slackConfig. -func (c *FakeSlackConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.SlackConfig, err error) { +func (c *FakeSlackConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.SlackConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(slackconfigsResource, name, pt, data, subresources...), &v2.SlackConfig{}) + Invokes(testing.NewRootPatchSubresourceAction(slackconfigsResource, name, pt, data, subresources...), &v2alpha1.SlackConfig{}) if obj == nil { return nil, err } - return obj.(*v2.SlackConfig), err + return obj.(*v2alpha1.SlackConfig), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_slackreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_slackreceiver.go similarity index 73% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_slackreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_slackreceiver.go index eccd89388..dabac3b2e 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_slackreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_slackreceiver.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeSlackReceivers implements SlackReceiverInterface type FakeSlackReceivers struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var slackreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "slackreceivers"} +var slackreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "slackreceivers"} -var slackreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "SlackReceiver"} +var slackreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "SlackReceiver"} // Get takes name of the slackReceiver, and returns the corresponding slackReceiver object, and an error if there is any. -func (c *FakeSlackReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.SlackReceiver, err error) { +func (c *FakeSlackReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.SlackReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(slackreceiversResource, name), &v2.SlackReceiver{}) + Invokes(testing.NewRootGetAction(slackreceiversResource, name), &v2alpha1.SlackReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.SlackReceiver), err + return obj.(*v2alpha1.SlackReceiver), err } // List takes label and field selectors, and returns the list of SlackReceivers that match those selectors. -func (c *FakeSlackReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.SlackReceiverList, err error) { +func (c *FakeSlackReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.SlackReceiverList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(slackreceiversResource, slackreceiversKind, opts), &v2.SlackReceiverList{}) + Invokes(testing.NewRootListAction(slackreceiversResource, slackreceiversKind, opts), &v2alpha1.SlackReceiverList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeSlackReceivers) List(ctx context.Context, opts v1.ListOptions) (res if label == nil { label = labels.Everything() } - list := &v2.SlackReceiverList{ListMeta: obj.(*v2.SlackReceiverList).ListMeta} - for _, item := range obj.(*v2.SlackReceiverList).Items { + list := &v2alpha1.SlackReceiverList{ListMeta: obj.(*v2alpha1.SlackReceiverList).ListMeta} + for _, item := range obj.(*v2alpha1.SlackReceiverList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeSlackReceivers) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a slackReceiver and creates it. Returns the server's representation of the slackReceiver, and an error, if there is any. -func (c *FakeSlackReceivers) Create(ctx context.Context, slackReceiver *v2.SlackReceiver, opts v1.CreateOptions) (result *v2.SlackReceiver, err error) { +func (c *FakeSlackReceivers) Create(ctx context.Context, slackReceiver *v2alpha1.SlackReceiver, opts v1.CreateOptions) (result *v2alpha1.SlackReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(slackreceiversResource, slackReceiver), &v2.SlackReceiver{}) + Invokes(testing.NewRootCreateAction(slackreceiversResource, slackReceiver), &v2alpha1.SlackReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.SlackReceiver), err + return obj.(*v2alpha1.SlackReceiver), err } // Update takes the representation of a slackReceiver and updates it. Returns the server's representation of the slackReceiver, and an error, if there is any. -func (c *FakeSlackReceivers) Update(ctx context.Context, slackReceiver *v2.SlackReceiver, opts v1.UpdateOptions) (result *v2.SlackReceiver, err error) { +func (c *FakeSlackReceivers) Update(ctx context.Context, slackReceiver *v2alpha1.SlackReceiver, opts v1.UpdateOptions) (result *v2alpha1.SlackReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(slackreceiversResource, slackReceiver), &v2.SlackReceiver{}) + Invokes(testing.NewRootUpdateAction(slackreceiversResource, slackReceiver), &v2alpha1.SlackReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.SlackReceiver), err + return obj.(*v2alpha1.SlackReceiver), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeSlackReceivers) UpdateStatus(ctx context.Context, slackReceiver *v2.SlackReceiver, opts v1.UpdateOptions) (*v2.SlackReceiver, error) { +func (c *FakeSlackReceivers) UpdateStatus(ctx context.Context, slackReceiver *v2alpha1.SlackReceiver, opts v1.UpdateOptions) (*v2alpha1.SlackReceiver, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(slackreceiversResource, "status", slackReceiver), &v2.SlackReceiver{}) + Invokes(testing.NewRootUpdateSubresourceAction(slackreceiversResource, "status", slackReceiver), &v2alpha1.SlackReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.SlackReceiver), err + return obj.(*v2alpha1.SlackReceiver), err } // Delete takes name of the slackReceiver and deletes it. Returns an error if one occurs. func (c *FakeSlackReceivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(slackreceiversResource, name), &v2.SlackReceiver{}) + Invokes(testing.NewRootDeleteAction(slackreceiversResource, name), &v2alpha1.SlackReceiver{}) return err } @@ -118,16 +118,16 @@ func (c *FakeSlackReceivers) Delete(ctx context.Context, name string, opts v1.De func (c *FakeSlackReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(slackreceiversResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.SlackReceiverList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.SlackReceiverList{}) return err } // Patch applies the patch and returns the patched slackReceiver. -func (c *FakeSlackReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.SlackReceiver, err error) { +func (c *FakeSlackReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.SlackReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(slackreceiversResource, name, pt, data, subresources...), &v2.SlackReceiver{}) + Invokes(testing.NewRootPatchSubresourceAction(slackreceiversResource, name, pt, data, subresources...), &v2alpha1.SlackReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.SlackReceiver), err + return obj.(*v2alpha1.SlackReceiver), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_webhookconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_webhookconfig.go similarity index 73% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_webhookconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_webhookconfig.go index 750577235..9a2de967d 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_webhookconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_webhookconfig.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeWebhookConfigs implements WebhookConfigInterface type FakeWebhookConfigs struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var webhookconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "webhookconfigs"} +var webhookconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "webhookconfigs"} -var webhookconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "WebhookConfig"} +var webhookconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "WebhookConfig"} // Get takes name of the webhookConfig, and returns the corresponding webhookConfig object, and an error if there is any. -func (c *FakeWebhookConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.WebhookConfig, err error) { +func (c *FakeWebhookConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.WebhookConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(webhookconfigsResource, name), &v2.WebhookConfig{}) + Invokes(testing.NewRootGetAction(webhookconfigsResource, name), &v2alpha1.WebhookConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookConfig), err + return obj.(*v2alpha1.WebhookConfig), err } // List takes label and field selectors, and returns the list of WebhookConfigs that match those selectors. -func (c *FakeWebhookConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.WebhookConfigList, err error) { +func (c *FakeWebhookConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.WebhookConfigList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(webhookconfigsResource, webhookconfigsKind, opts), &v2.WebhookConfigList{}) + Invokes(testing.NewRootListAction(webhookconfigsResource, webhookconfigsKind, opts), &v2alpha1.WebhookConfigList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeWebhookConfigs) List(ctx context.Context, opts v1.ListOptions) (res if label == nil { label = labels.Everything() } - list := &v2.WebhookConfigList{ListMeta: obj.(*v2.WebhookConfigList).ListMeta} - for _, item := range obj.(*v2.WebhookConfigList).Items { + list := &v2alpha1.WebhookConfigList{ListMeta: obj.(*v2alpha1.WebhookConfigList).ListMeta} + for _, item := range obj.(*v2alpha1.WebhookConfigList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeWebhookConfigs) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a webhookConfig and creates it. Returns the server's representation of the webhookConfig, and an error, if there is any. -func (c *FakeWebhookConfigs) Create(ctx context.Context, webhookConfig *v2.WebhookConfig, opts v1.CreateOptions) (result *v2.WebhookConfig, err error) { +func (c *FakeWebhookConfigs) Create(ctx context.Context, webhookConfig *v2alpha1.WebhookConfig, opts v1.CreateOptions) (result *v2alpha1.WebhookConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(webhookconfigsResource, webhookConfig), &v2.WebhookConfig{}) + Invokes(testing.NewRootCreateAction(webhookconfigsResource, webhookConfig), &v2alpha1.WebhookConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookConfig), err + return obj.(*v2alpha1.WebhookConfig), err } // Update takes the representation of a webhookConfig and updates it. Returns the server's representation of the webhookConfig, and an error, if there is any. -func (c *FakeWebhookConfigs) Update(ctx context.Context, webhookConfig *v2.WebhookConfig, opts v1.UpdateOptions) (result *v2.WebhookConfig, err error) { +func (c *FakeWebhookConfigs) Update(ctx context.Context, webhookConfig *v2alpha1.WebhookConfig, opts v1.UpdateOptions) (result *v2alpha1.WebhookConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(webhookconfigsResource, webhookConfig), &v2.WebhookConfig{}) + Invokes(testing.NewRootUpdateAction(webhookconfigsResource, webhookConfig), &v2alpha1.WebhookConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookConfig), err + return obj.(*v2alpha1.WebhookConfig), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeWebhookConfigs) UpdateStatus(ctx context.Context, webhookConfig *v2.WebhookConfig, opts v1.UpdateOptions) (*v2.WebhookConfig, error) { +func (c *FakeWebhookConfigs) UpdateStatus(ctx context.Context, webhookConfig *v2alpha1.WebhookConfig, opts v1.UpdateOptions) (*v2alpha1.WebhookConfig, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(webhookconfigsResource, "status", webhookConfig), &v2.WebhookConfig{}) + Invokes(testing.NewRootUpdateSubresourceAction(webhookconfigsResource, "status", webhookConfig), &v2alpha1.WebhookConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookConfig), err + return obj.(*v2alpha1.WebhookConfig), err } // Delete takes name of the webhookConfig and deletes it. Returns an error if one occurs. func (c *FakeWebhookConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(webhookconfigsResource, name), &v2.WebhookConfig{}) + Invokes(testing.NewRootDeleteAction(webhookconfigsResource, name), &v2alpha1.WebhookConfig{}) return err } @@ -118,16 +118,16 @@ func (c *FakeWebhookConfigs) Delete(ctx context.Context, name string, opts v1.De func (c *FakeWebhookConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(webhookconfigsResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.WebhookConfigList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.WebhookConfigList{}) return err } // Patch applies the patch and returns the patched webhookConfig. -func (c *FakeWebhookConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WebhookConfig, err error) { +func (c *FakeWebhookConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WebhookConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(webhookconfigsResource, name, pt, data, subresources...), &v2.WebhookConfig{}) + Invokes(testing.NewRootPatchSubresourceAction(webhookconfigsResource, name, pt, data, subresources...), &v2alpha1.WebhookConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookConfig), err + return obj.(*v2alpha1.WebhookConfig), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_webhookreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_webhookreceiver.go similarity index 72% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_webhookreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_webhookreceiver.go index ae59dd3db..09ebc2534 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_webhookreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_webhookreceiver.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeWebhookReceivers implements WebhookReceiverInterface type FakeWebhookReceivers struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var webhookreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "webhookreceivers"} +var webhookreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "webhookreceivers"} -var webhookreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "WebhookReceiver"} +var webhookreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "WebhookReceiver"} // Get takes name of the webhookReceiver, and returns the corresponding webhookReceiver object, and an error if there is any. -func (c *FakeWebhookReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.WebhookReceiver, err error) { +func (c *FakeWebhookReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.WebhookReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(webhookreceiversResource, name), &v2.WebhookReceiver{}) + Invokes(testing.NewRootGetAction(webhookreceiversResource, name), &v2alpha1.WebhookReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookReceiver), err + return obj.(*v2alpha1.WebhookReceiver), err } // List takes label and field selectors, and returns the list of WebhookReceivers that match those selectors. -func (c *FakeWebhookReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.WebhookReceiverList, err error) { +func (c *FakeWebhookReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.WebhookReceiverList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(webhookreceiversResource, webhookreceiversKind, opts), &v2.WebhookReceiverList{}) + Invokes(testing.NewRootListAction(webhookreceiversResource, webhookreceiversKind, opts), &v2alpha1.WebhookReceiverList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeWebhookReceivers) List(ctx context.Context, opts v1.ListOptions) (r if label == nil { label = labels.Everything() } - list := &v2.WebhookReceiverList{ListMeta: obj.(*v2.WebhookReceiverList).ListMeta} - for _, item := range obj.(*v2.WebhookReceiverList).Items { + list := &v2alpha1.WebhookReceiverList{ListMeta: obj.(*v2alpha1.WebhookReceiverList).ListMeta} + for _, item := range obj.(*v2alpha1.WebhookReceiverList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeWebhookReceivers) Watch(ctx context.Context, opts v1.ListOptions) ( } // Create takes the representation of a webhookReceiver and creates it. Returns the server's representation of the webhookReceiver, and an error, if there is any. -func (c *FakeWebhookReceivers) Create(ctx context.Context, webhookReceiver *v2.WebhookReceiver, opts v1.CreateOptions) (result *v2.WebhookReceiver, err error) { +func (c *FakeWebhookReceivers) Create(ctx context.Context, webhookReceiver *v2alpha1.WebhookReceiver, opts v1.CreateOptions) (result *v2alpha1.WebhookReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(webhookreceiversResource, webhookReceiver), &v2.WebhookReceiver{}) + Invokes(testing.NewRootCreateAction(webhookreceiversResource, webhookReceiver), &v2alpha1.WebhookReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookReceiver), err + return obj.(*v2alpha1.WebhookReceiver), err } // Update takes the representation of a webhookReceiver and updates it. Returns the server's representation of the webhookReceiver, and an error, if there is any. -func (c *FakeWebhookReceivers) Update(ctx context.Context, webhookReceiver *v2.WebhookReceiver, opts v1.UpdateOptions) (result *v2.WebhookReceiver, err error) { +func (c *FakeWebhookReceivers) Update(ctx context.Context, webhookReceiver *v2alpha1.WebhookReceiver, opts v1.UpdateOptions) (result *v2alpha1.WebhookReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(webhookreceiversResource, webhookReceiver), &v2.WebhookReceiver{}) + Invokes(testing.NewRootUpdateAction(webhookreceiversResource, webhookReceiver), &v2alpha1.WebhookReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookReceiver), err + return obj.(*v2alpha1.WebhookReceiver), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeWebhookReceivers) UpdateStatus(ctx context.Context, webhookReceiver *v2.WebhookReceiver, opts v1.UpdateOptions) (*v2.WebhookReceiver, error) { +func (c *FakeWebhookReceivers) UpdateStatus(ctx context.Context, webhookReceiver *v2alpha1.WebhookReceiver, opts v1.UpdateOptions) (*v2alpha1.WebhookReceiver, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(webhookreceiversResource, "status", webhookReceiver), &v2.WebhookReceiver{}) + Invokes(testing.NewRootUpdateSubresourceAction(webhookreceiversResource, "status", webhookReceiver), &v2alpha1.WebhookReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookReceiver), err + return obj.(*v2alpha1.WebhookReceiver), err } // Delete takes name of the webhookReceiver and deletes it. Returns an error if one occurs. func (c *FakeWebhookReceivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(webhookreceiversResource, name), &v2.WebhookReceiver{}) + Invokes(testing.NewRootDeleteAction(webhookreceiversResource, name), &v2alpha1.WebhookReceiver{}) return err } @@ -118,16 +118,16 @@ func (c *FakeWebhookReceivers) Delete(ctx context.Context, name string, opts v1. func (c *FakeWebhookReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(webhookreceiversResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.WebhookReceiverList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.WebhookReceiverList{}) return err } // Patch applies the patch and returns the patched webhookReceiver. -func (c *FakeWebhookReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WebhookReceiver, err error) { +func (c *FakeWebhookReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WebhookReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(webhookreceiversResource, name, pt, data, subresources...), &v2.WebhookReceiver{}) + Invokes(testing.NewRootPatchSubresourceAction(webhookreceiversResource, name, pt, data, subresources...), &v2alpha1.WebhookReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WebhookReceiver), err + return obj.(*v2alpha1.WebhookReceiver), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_wechatconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_wechatconfig.go similarity index 73% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_wechatconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_wechatconfig.go index a30069674..63a2d694a 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_wechatconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_wechatconfig.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeWechatConfigs implements WechatConfigInterface type FakeWechatConfigs struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var wechatconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "wechatconfigs"} +var wechatconfigsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "wechatconfigs"} -var wechatconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "WechatConfig"} +var wechatconfigsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "WechatConfig"} // Get takes name of the wechatConfig, and returns the corresponding wechatConfig object, and an error if there is any. -func (c *FakeWechatConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.WechatConfig, err error) { +func (c *FakeWechatConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.WechatConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(wechatconfigsResource, name), &v2.WechatConfig{}) + Invokes(testing.NewRootGetAction(wechatconfigsResource, name), &v2alpha1.WechatConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WechatConfig), err + return obj.(*v2alpha1.WechatConfig), err } // List takes label and field selectors, and returns the list of WechatConfigs that match those selectors. -func (c *FakeWechatConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.WechatConfigList, err error) { +func (c *FakeWechatConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.WechatConfigList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(wechatconfigsResource, wechatconfigsKind, opts), &v2.WechatConfigList{}) + Invokes(testing.NewRootListAction(wechatconfigsResource, wechatconfigsKind, opts), &v2alpha1.WechatConfigList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeWechatConfigs) List(ctx context.Context, opts v1.ListOptions) (resu if label == nil { label = labels.Everything() } - list := &v2.WechatConfigList{ListMeta: obj.(*v2.WechatConfigList).ListMeta} - for _, item := range obj.(*v2.WechatConfigList).Items { + list := &v2alpha1.WechatConfigList{ListMeta: obj.(*v2alpha1.WechatConfigList).ListMeta} + for _, item := range obj.(*v2alpha1.WechatConfigList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeWechatConfigs) Watch(ctx context.Context, opts v1.ListOptions) (wat } // Create takes the representation of a wechatConfig and creates it. Returns the server's representation of the wechatConfig, and an error, if there is any. -func (c *FakeWechatConfigs) Create(ctx context.Context, wechatConfig *v2.WechatConfig, opts v1.CreateOptions) (result *v2.WechatConfig, err error) { +func (c *FakeWechatConfigs) Create(ctx context.Context, wechatConfig *v2alpha1.WechatConfig, opts v1.CreateOptions) (result *v2alpha1.WechatConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(wechatconfigsResource, wechatConfig), &v2.WechatConfig{}) + Invokes(testing.NewRootCreateAction(wechatconfigsResource, wechatConfig), &v2alpha1.WechatConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WechatConfig), err + return obj.(*v2alpha1.WechatConfig), err } // Update takes the representation of a wechatConfig and updates it. Returns the server's representation of the wechatConfig, and an error, if there is any. -func (c *FakeWechatConfigs) Update(ctx context.Context, wechatConfig *v2.WechatConfig, opts v1.UpdateOptions) (result *v2.WechatConfig, err error) { +func (c *FakeWechatConfigs) Update(ctx context.Context, wechatConfig *v2alpha1.WechatConfig, opts v1.UpdateOptions) (result *v2alpha1.WechatConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(wechatconfigsResource, wechatConfig), &v2.WechatConfig{}) + Invokes(testing.NewRootUpdateAction(wechatconfigsResource, wechatConfig), &v2alpha1.WechatConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WechatConfig), err + return obj.(*v2alpha1.WechatConfig), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeWechatConfigs) UpdateStatus(ctx context.Context, wechatConfig *v2.WechatConfig, opts v1.UpdateOptions) (*v2.WechatConfig, error) { +func (c *FakeWechatConfigs) UpdateStatus(ctx context.Context, wechatConfig *v2alpha1.WechatConfig, opts v1.UpdateOptions) (*v2alpha1.WechatConfig, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(wechatconfigsResource, "status", wechatConfig), &v2.WechatConfig{}) + Invokes(testing.NewRootUpdateSubresourceAction(wechatconfigsResource, "status", wechatConfig), &v2alpha1.WechatConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WechatConfig), err + return obj.(*v2alpha1.WechatConfig), err } // Delete takes name of the wechatConfig and deletes it. Returns an error if one occurs. func (c *FakeWechatConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(wechatconfigsResource, name), &v2.WechatConfig{}) + Invokes(testing.NewRootDeleteAction(wechatconfigsResource, name), &v2alpha1.WechatConfig{}) return err } @@ -118,16 +118,16 @@ func (c *FakeWechatConfigs) Delete(ctx context.Context, name string, opts v1.Del func (c *FakeWechatConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(wechatconfigsResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.WechatConfigList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.WechatConfigList{}) return err } // Patch applies the patch and returns the patched wechatConfig. -func (c *FakeWechatConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WechatConfig, err error) { +func (c *FakeWechatConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WechatConfig, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(wechatconfigsResource, name, pt, data, subresources...), &v2.WechatConfig{}) + Invokes(testing.NewRootPatchSubresourceAction(wechatconfigsResource, name, pt, data, subresources...), &v2alpha1.WechatConfig{}) if obj == nil { return nil, err } - return obj.(*v2.WechatConfig), err + return obj.(*v2alpha1.WechatConfig), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_wechatreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_wechatreceiver.go similarity index 72% rename from pkg/client/clientset/versioned/typed/notification/v2/fake/fake_wechatreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_wechatreceiver.go index e337b10a5..775d4803c 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/fake/fake_wechatreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/fake/fake_wechatreceiver.go @@ -27,32 +27,32 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // FakeWechatReceivers implements WechatReceiverInterface type FakeWechatReceivers struct { - Fake *FakeNotificationV2 + Fake *FakeNotificationV2alpha1 } -var wechatreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2", Resource: "wechatreceivers"} +var wechatreceiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2alpha1", Resource: "wechatreceivers"} -var wechatreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2", Kind: "WechatReceiver"} +var wechatreceiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2alpha1", Kind: "WechatReceiver"} // Get takes name of the wechatReceiver, and returns the corresponding wechatReceiver object, and an error if there is any. -func (c *FakeWechatReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.WechatReceiver, err error) { +func (c *FakeWechatReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.WechatReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(wechatreceiversResource, name), &v2.WechatReceiver{}) + Invokes(testing.NewRootGetAction(wechatreceiversResource, name), &v2alpha1.WechatReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WechatReceiver), err + return obj.(*v2alpha1.WechatReceiver), err } // List takes label and field selectors, and returns the list of WechatReceivers that match those selectors. -func (c *FakeWechatReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.WechatReceiverList, err error) { +func (c *FakeWechatReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.WechatReceiverList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(wechatreceiversResource, wechatreceiversKind, opts), &v2.WechatReceiverList{}) + Invokes(testing.NewRootListAction(wechatreceiversResource, wechatreceiversKind, opts), &v2alpha1.WechatReceiverList{}) if obj == nil { return nil, err } @@ -61,8 +61,8 @@ func (c *FakeWechatReceivers) List(ctx context.Context, opts v1.ListOptions) (re if label == nil { label = labels.Everything() } - list := &v2.WechatReceiverList{ListMeta: obj.(*v2.WechatReceiverList).ListMeta} - for _, item := range obj.(*v2.WechatReceiverList).Items { + list := &v2alpha1.WechatReceiverList{ListMeta: obj.(*v2alpha1.WechatReceiverList).ListMeta} + for _, item := range obj.(*v2alpha1.WechatReceiverList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -77,40 +77,40 @@ func (c *FakeWechatReceivers) Watch(ctx context.Context, opts v1.ListOptions) (w } // Create takes the representation of a wechatReceiver and creates it. Returns the server's representation of the wechatReceiver, and an error, if there is any. -func (c *FakeWechatReceivers) Create(ctx context.Context, wechatReceiver *v2.WechatReceiver, opts v1.CreateOptions) (result *v2.WechatReceiver, err error) { +func (c *FakeWechatReceivers) Create(ctx context.Context, wechatReceiver *v2alpha1.WechatReceiver, opts v1.CreateOptions) (result *v2alpha1.WechatReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(wechatreceiversResource, wechatReceiver), &v2.WechatReceiver{}) + Invokes(testing.NewRootCreateAction(wechatreceiversResource, wechatReceiver), &v2alpha1.WechatReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WechatReceiver), err + return obj.(*v2alpha1.WechatReceiver), err } // Update takes the representation of a wechatReceiver and updates it. Returns the server's representation of the wechatReceiver, and an error, if there is any. -func (c *FakeWechatReceivers) Update(ctx context.Context, wechatReceiver *v2.WechatReceiver, opts v1.UpdateOptions) (result *v2.WechatReceiver, err error) { +func (c *FakeWechatReceivers) Update(ctx context.Context, wechatReceiver *v2alpha1.WechatReceiver, opts v1.UpdateOptions) (result *v2alpha1.WechatReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(wechatreceiversResource, wechatReceiver), &v2.WechatReceiver{}) + Invokes(testing.NewRootUpdateAction(wechatreceiversResource, wechatReceiver), &v2alpha1.WechatReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WechatReceiver), err + return obj.(*v2alpha1.WechatReceiver), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeWechatReceivers) UpdateStatus(ctx context.Context, wechatReceiver *v2.WechatReceiver, opts v1.UpdateOptions) (*v2.WechatReceiver, error) { +func (c *FakeWechatReceivers) UpdateStatus(ctx context.Context, wechatReceiver *v2alpha1.WechatReceiver, opts v1.UpdateOptions) (*v2alpha1.WechatReceiver, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(wechatreceiversResource, "status", wechatReceiver), &v2.WechatReceiver{}) + Invokes(testing.NewRootUpdateSubresourceAction(wechatreceiversResource, "status", wechatReceiver), &v2alpha1.WechatReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WechatReceiver), err + return obj.(*v2alpha1.WechatReceiver), err } // Delete takes name of the wechatReceiver and deletes it. Returns an error if one occurs. func (c *FakeWechatReceivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(wechatreceiversResource, name), &v2.WechatReceiver{}) + Invokes(testing.NewRootDeleteAction(wechatreceiversResource, name), &v2alpha1.WechatReceiver{}) return err } @@ -118,16 +118,16 @@ func (c *FakeWechatReceivers) Delete(ctx context.Context, name string, opts v1.D func (c *FakeWechatReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(wechatreceiversResource, listOpts) - _, err := c.Fake.Invokes(action, &v2.WechatReceiverList{}) + _, err := c.Fake.Invokes(action, &v2alpha1.WechatReceiverList{}) return err } // Patch applies the patch and returns the patched wechatReceiver. -func (c *FakeWechatReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WechatReceiver, err error) { +func (c *FakeWechatReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WechatReceiver, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(wechatreceiversResource, name, pt, data, subresources...), &v2.WechatReceiver{}) + Invokes(testing.NewRootPatchSubresourceAction(wechatreceiversResource, name, pt, data, subresources...), &v2alpha1.WechatReceiver{}) if obj == nil { return nil, err } - return obj.(*v2.WechatReceiver), err + return obj.(*v2alpha1.WechatReceiver), err } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/generated_expansion.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/generated_expansion.go similarity index 98% rename from pkg/client/clientset/versioned/typed/notification/v2/generated_expansion.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/generated_expansion.go index 37b7f21a9..c13e64d2d 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/generated_expansion.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 type DingTalkConfigExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/notification/v2/notification_client.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/notification_client.go similarity index 55% rename from pkg/client/clientset/versioned/typed/notification/v2/notification_client.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/notification_client.go index ac14cb642..418449cb3 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/notification_client.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/notification_client.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) -type NotificationV2Interface interface { +type NotificationV2alpha1Interface interface { RESTClient() rest.Interface DingTalkConfigsGetter DingTalkReceiversGetter @@ -38,53 +38,53 @@ type NotificationV2Interface interface { WechatReceiversGetter } -// NotificationV2Client is used to interact with features provided by the notification.kubesphere.io group. -type NotificationV2Client struct { +// NotificationV2alpha1Client is used to interact with features provided by the notification.kubesphere.io group. +type NotificationV2alpha1Client struct { restClient rest.Interface } -func (c *NotificationV2Client) DingTalkConfigs() DingTalkConfigInterface { +func (c *NotificationV2alpha1Client) DingTalkConfigs() DingTalkConfigInterface { return newDingTalkConfigs(c) } -func (c *NotificationV2Client) DingTalkReceivers() DingTalkReceiverInterface { +func (c *NotificationV2alpha1Client) DingTalkReceivers() DingTalkReceiverInterface { return newDingTalkReceivers(c) } -func (c *NotificationV2Client) EmailConfigs() EmailConfigInterface { +func (c *NotificationV2alpha1Client) EmailConfigs() EmailConfigInterface { return newEmailConfigs(c) } -func (c *NotificationV2Client) EmailReceivers() EmailReceiverInterface { +func (c *NotificationV2alpha1Client) EmailReceivers() EmailReceiverInterface { return newEmailReceivers(c) } -func (c *NotificationV2Client) SlackConfigs() SlackConfigInterface { +func (c *NotificationV2alpha1Client) SlackConfigs() SlackConfigInterface { return newSlackConfigs(c) } -func (c *NotificationV2Client) SlackReceivers() SlackReceiverInterface { +func (c *NotificationV2alpha1Client) SlackReceivers() SlackReceiverInterface { return newSlackReceivers(c) } -func (c *NotificationV2Client) WebhookConfigs() WebhookConfigInterface { +func (c *NotificationV2alpha1Client) WebhookConfigs() WebhookConfigInterface { return newWebhookConfigs(c) } -func (c *NotificationV2Client) WebhookReceivers() WebhookReceiverInterface { +func (c *NotificationV2alpha1Client) WebhookReceivers() WebhookReceiverInterface { return newWebhookReceivers(c) } -func (c *NotificationV2Client) WechatConfigs() WechatConfigInterface { +func (c *NotificationV2alpha1Client) WechatConfigs() WechatConfigInterface { return newWechatConfigs(c) } -func (c *NotificationV2Client) WechatReceivers() WechatReceiverInterface { +func (c *NotificationV2alpha1Client) WechatReceivers() WechatReceiverInterface { return newWechatReceivers(c) } -// NewForConfig creates a new NotificationV2Client for the given config. -func NewForConfig(c *rest.Config) (*NotificationV2Client, error) { +// NewForConfig creates a new NotificationV2alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*NotificationV2alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -93,12 +93,12 @@ func NewForConfig(c *rest.Config) (*NotificationV2Client, error) { if err != nil { return nil, err } - return &NotificationV2Client{client}, nil + return &NotificationV2alpha1Client{client}, nil } -// NewForConfigOrDie creates a new NotificationV2Client for the given config and +// NewForConfigOrDie creates a new NotificationV2alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *NotificationV2Client { +func NewForConfigOrDie(c *rest.Config) *NotificationV2alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -106,13 +106,13 @@ func NewForConfigOrDie(c *rest.Config) *NotificationV2Client { return client } -// New creates a new NotificationV2Client for the given RESTClient. -func New(c rest.Interface) *NotificationV2Client { - return &NotificationV2Client{c} +// New creates a new NotificationV2alpha1Client for the given RESTClient. +func New(c rest.Interface) *NotificationV2alpha1Client { + return &NotificationV2alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v2.SchemeGroupVersion + gv := v2alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -126,7 +126,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *NotificationV2Client) RESTClient() rest.Interface { +func (c *NotificationV2alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/clientset/versioned/typed/notification/v2/slackconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/slackconfig.go similarity index 79% rename from pkg/client/clientset/versioned/typed/notification/v2/slackconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/slackconfig.go index c1919a0f0..e75a1029e 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/slackconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/slackconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type SlackConfigsGetter interface { // SlackConfigInterface has methods to work with SlackConfig resources. type SlackConfigInterface interface { - Create(ctx context.Context, slackConfig *v2.SlackConfig, opts v1.CreateOptions) (*v2.SlackConfig, error) - Update(ctx context.Context, slackConfig *v2.SlackConfig, opts v1.UpdateOptions) (*v2.SlackConfig, error) - UpdateStatus(ctx context.Context, slackConfig *v2.SlackConfig, opts v1.UpdateOptions) (*v2.SlackConfig, error) + Create(ctx context.Context, slackConfig *v2alpha1.SlackConfig, opts v1.CreateOptions) (*v2alpha1.SlackConfig, error) + Update(ctx context.Context, slackConfig *v2alpha1.SlackConfig, opts v1.UpdateOptions) (*v2alpha1.SlackConfig, error) + UpdateStatus(ctx context.Context, slackConfig *v2alpha1.SlackConfig, opts v1.UpdateOptions) (*v2alpha1.SlackConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.SlackConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.SlackConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.SlackConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.SlackConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.SlackConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.SlackConfig, err error) SlackConfigExpansion } @@ -56,15 +56,15 @@ type slackConfigs struct { } // newSlackConfigs returns a SlackConfigs -func newSlackConfigs(c *NotificationV2Client) *slackConfigs { +func newSlackConfigs(c *NotificationV2alpha1Client) *slackConfigs { return &slackConfigs{ client: c.RESTClient(), } } // Get takes name of the slackConfig, and returns the corresponding slackConfig object, and an error if there is any. -func (c *slackConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.SlackConfig, err error) { - result = &v2.SlackConfig{} +func (c *slackConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.SlackConfig, err error) { + result = &v2alpha1.SlackConfig{} err = c.client.Get(). Resource("slackconfigs"). Name(name). @@ -75,12 +75,12 @@ func (c *slackConfigs) Get(ctx context.Context, name string, options v1.GetOptio } // List takes label and field selectors, and returns the list of SlackConfigs that match those selectors. -func (c *slackConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.SlackConfigList, err error) { +func (c *slackConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.SlackConfigList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.SlackConfigList{} + result = &v2alpha1.SlackConfigList{} err = c.client.Get(). Resource("slackconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *slackConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.In } // Create takes the representation of a slackConfig and creates it. Returns the server's representation of the slackConfig, and an error, if there is any. -func (c *slackConfigs) Create(ctx context.Context, slackConfig *v2.SlackConfig, opts v1.CreateOptions) (result *v2.SlackConfig, err error) { - result = &v2.SlackConfig{} +func (c *slackConfigs) Create(ctx context.Context, slackConfig *v2alpha1.SlackConfig, opts v1.CreateOptions) (result *v2alpha1.SlackConfig, err error) { + result = &v2alpha1.SlackConfig{} err = c.client.Post(). Resource("slackconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *slackConfigs) Create(ctx context.Context, slackConfig *v2.SlackConfig, } // Update takes the representation of a slackConfig and updates it. Returns the server's representation of the slackConfig, and an error, if there is any. -func (c *slackConfigs) Update(ctx context.Context, slackConfig *v2.SlackConfig, opts v1.UpdateOptions) (result *v2.SlackConfig, err error) { - result = &v2.SlackConfig{} +func (c *slackConfigs) Update(ctx context.Context, slackConfig *v2alpha1.SlackConfig, opts v1.UpdateOptions) (result *v2alpha1.SlackConfig, err error) { + result = &v2alpha1.SlackConfig{} err = c.client.Put(). Resource("slackconfigs"). Name(slackConfig.Name). @@ -131,8 +131,8 @@ func (c *slackConfigs) Update(ctx context.Context, slackConfig *v2.SlackConfig, // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *slackConfigs) UpdateStatus(ctx context.Context, slackConfig *v2.SlackConfig, opts v1.UpdateOptions) (result *v2.SlackConfig, err error) { - result = &v2.SlackConfig{} +func (c *slackConfigs) UpdateStatus(ctx context.Context, slackConfig *v2alpha1.SlackConfig, opts v1.UpdateOptions) (result *v2alpha1.SlackConfig, err error) { + result = &v2alpha1.SlackConfig{} err = c.client.Put(). Resource("slackconfigs"). Name(slackConfig.Name). @@ -170,8 +170,8 @@ func (c *slackConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptio } // Patch applies the patch and returns the patched slackConfig. -func (c *slackConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.SlackConfig, err error) { - result = &v2.SlackConfig{} +func (c *slackConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.SlackConfig, err error) { + result = &v2alpha1.SlackConfig{} err = c.client.Patch(pt). Resource("slackconfigs"). Name(name). diff --git a/pkg/client/clientset/versioned/typed/notification/v2/slackreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/slackreceiver.go similarity index 79% rename from pkg/client/clientset/versioned/typed/notification/v2/slackreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/slackreceiver.go index 5a280fa3f..78c6ce257 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/slackreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/slackreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type SlackReceiversGetter interface { // SlackReceiverInterface has methods to work with SlackReceiver resources. type SlackReceiverInterface interface { - Create(ctx context.Context, slackReceiver *v2.SlackReceiver, opts v1.CreateOptions) (*v2.SlackReceiver, error) - Update(ctx context.Context, slackReceiver *v2.SlackReceiver, opts v1.UpdateOptions) (*v2.SlackReceiver, error) - UpdateStatus(ctx context.Context, slackReceiver *v2.SlackReceiver, opts v1.UpdateOptions) (*v2.SlackReceiver, error) + Create(ctx context.Context, slackReceiver *v2alpha1.SlackReceiver, opts v1.CreateOptions) (*v2alpha1.SlackReceiver, error) + Update(ctx context.Context, slackReceiver *v2alpha1.SlackReceiver, opts v1.UpdateOptions) (*v2alpha1.SlackReceiver, error) + UpdateStatus(ctx context.Context, slackReceiver *v2alpha1.SlackReceiver, opts v1.UpdateOptions) (*v2alpha1.SlackReceiver, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.SlackReceiver, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.SlackReceiverList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.SlackReceiver, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.SlackReceiverList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.SlackReceiver, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.SlackReceiver, err error) SlackReceiverExpansion } @@ -56,15 +56,15 @@ type slackReceivers struct { } // newSlackReceivers returns a SlackReceivers -func newSlackReceivers(c *NotificationV2Client) *slackReceivers { +func newSlackReceivers(c *NotificationV2alpha1Client) *slackReceivers { return &slackReceivers{ client: c.RESTClient(), } } // Get takes name of the slackReceiver, and returns the corresponding slackReceiver object, and an error if there is any. -func (c *slackReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.SlackReceiver, err error) { - result = &v2.SlackReceiver{} +func (c *slackReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.SlackReceiver, err error) { + result = &v2alpha1.SlackReceiver{} err = c.client.Get(). Resource("slackreceivers"). Name(name). @@ -75,12 +75,12 @@ func (c *slackReceivers) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of SlackReceivers that match those selectors. -func (c *slackReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.SlackReceiverList, err error) { +func (c *slackReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.SlackReceiverList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.SlackReceiverList{} + result = &v2alpha1.SlackReceiverList{} err = c.client.Get(). Resource("slackreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *slackReceivers) Watch(ctx context.Context, opts v1.ListOptions) (watch. } // Create takes the representation of a slackReceiver and creates it. Returns the server's representation of the slackReceiver, and an error, if there is any. -func (c *slackReceivers) Create(ctx context.Context, slackReceiver *v2.SlackReceiver, opts v1.CreateOptions) (result *v2.SlackReceiver, err error) { - result = &v2.SlackReceiver{} +func (c *slackReceivers) Create(ctx context.Context, slackReceiver *v2alpha1.SlackReceiver, opts v1.CreateOptions) (result *v2alpha1.SlackReceiver, err error) { + result = &v2alpha1.SlackReceiver{} err = c.client.Post(). Resource("slackreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *slackReceivers) Create(ctx context.Context, slackReceiver *v2.SlackRece } // Update takes the representation of a slackReceiver and updates it. Returns the server's representation of the slackReceiver, and an error, if there is any. -func (c *slackReceivers) Update(ctx context.Context, slackReceiver *v2.SlackReceiver, opts v1.UpdateOptions) (result *v2.SlackReceiver, err error) { - result = &v2.SlackReceiver{} +func (c *slackReceivers) Update(ctx context.Context, slackReceiver *v2alpha1.SlackReceiver, opts v1.UpdateOptions) (result *v2alpha1.SlackReceiver, err error) { + result = &v2alpha1.SlackReceiver{} err = c.client.Put(). Resource("slackreceivers"). Name(slackReceiver.Name). @@ -131,8 +131,8 @@ func (c *slackReceivers) Update(ctx context.Context, slackReceiver *v2.SlackRece // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *slackReceivers) UpdateStatus(ctx context.Context, slackReceiver *v2.SlackReceiver, opts v1.UpdateOptions) (result *v2.SlackReceiver, err error) { - result = &v2.SlackReceiver{} +func (c *slackReceivers) UpdateStatus(ctx context.Context, slackReceiver *v2alpha1.SlackReceiver, opts v1.UpdateOptions) (result *v2alpha1.SlackReceiver, err error) { + result = &v2alpha1.SlackReceiver{} err = c.client.Put(). Resource("slackreceivers"). Name(slackReceiver.Name). @@ -170,8 +170,8 @@ func (c *slackReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOpt } // Patch applies the patch and returns the patched slackReceiver. -func (c *slackReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.SlackReceiver, err error) { - result = &v2.SlackReceiver{} +func (c *slackReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.SlackReceiver, err error) { + result = &v2alpha1.SlackReceiver{} err = c.client.Patch(pt). Resource("slackreceivers"). Name(name). diff --git a/pkg/client/clientset/versioned/typed/notification/v2/webhookconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/webhookconfig.go similarity index 79% rename from pkg/client/clientset/versioned/typed/notification/v2/webhookconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/webhookconfig.go index 6d69cf2e8..80d879cd9 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/webhookconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/webhookconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type WebhookConfigsGetter interface { // WebhookConfigInterface has methods to work with WebhookConfig resources. type WebhookConfigInterface interface { - Create(ctx context.Context, webhookConfig *v2.WebhookConfig, opts v1.CreateOptions) (*v2.WebhookConfig, error) - Update(ctx context.Context, webhookConfig *v2.WebhookConfig, opts v1.UpdateOptions) (*v2.WebhookConfig, error) - UpdateStatus(ctx context.Context, webhookConfig *v2.WebhookConfig, opts v1.UpdateOptions) (*v2.WebhookConfig, error) + Create(ctx context.Context, webhookConfig *v2alpha1.WebhookConfig, opts v1.CreateOptions) (*v2alpha1.WebhookConfig, error) + Update(ctx context.Context, webhookConfig *v2alpha1.WebhookConfig, opts v1.UpdateOptions) (*v2alpha1.WebhookConfig, error) + UpdateStatus(ctx context.Context, webhookConfig *v2alpha1.WebhookConfig, opts v1.UpdateOptions) (*v2alpha1.WebhookConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.WebhookConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.WebhookConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.WebhookConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.WebhookConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WebhookConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WebhookConfig, err error) WebhookConfigExpansion } @@ -56,15 +56,15 @@ type webhookConfigs struct { } // newWebhookConfigs returns a WebhookConfigs -func newWebhookConfigs(c *NotificationV2Client) *webhookConfigs { +func newWebhookConfigs(c *NotificationV2alpha1Client) *webhookConfigs { return &webhookConfigs{ client: c.RESTClient(), } } // Get takes name of the webhookConfig, and returns the corresponding webhookConfig object, and an error if there is any. -func (c *webhookConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.WebhookConfig, err error) { - result = &v2.WebhookConfig{} +func (c *webhookConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.WebhookConfig, err error) { + result = &v2alpha1.WebhookConfig{} err = c.client.Get(). Resource("webhookconfigs"). Name(name). @@ -75,12 +75,12 @@ func (c *webhookConfigs) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of WebhookConfigs that match those selectors. -func (c *webhookConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.WebhookConfigList, err error) { +func (c *webhookConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.WebhookConfigList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.WebhookConfigList{} + result = &v2alpha1.WebhookConfigList{} err = c.client.Get(). Resource("webhookconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *webhookConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch. } // Create takes the representation of a webhookConfig and creates it. Returns the server's representation of the webhookConfig, and an error, if there is any. -func (c *webhookConfigs) Create(ctx context.Context, webhookConfig *v2.WebhookConfig, opts v1.CreateOptions) (result *v2.WebhookConfig, err error) { - result = &v2.WebhookConfig{} +func (c *webhookConfigs) Create(ctx context.Context, webhookConfig *v2alpha1.WebhookConfig, opts v1.CreateOptions) (result *v2alpha1.WebhookConfig, err error) { + result = &v2alpha1.WebhookConfig{} err = c.client.Post(). Resource("webhookconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *webhookConfigs) Create(ctx context.Context, webhookConfig *v2.WebhookCo } // Update takes the representation of a webhookConfig and updates it. Returns the server's representation of the webhookConfig, and an error, if there is any. -func (c *webhookConfigs) Update(ctx context.Context, webhookConfig *v2.WebhookConfig, opts v1.UpdateOptions) (result *v2.WebhookConfig, err error) { - result = &v2.WebhookConfig{} +func (c *webhookConfigs) Update(ctx context.Context, webhookConfig *v2alpha1.WebhookConfig, opts v1.UpdateOptions) (result *v2alpha1.WebhookConfig, err error) { + result = &v2alpha1.WebhookConfig{} err = c.client.Put(). Resource("webhookconfigs"). Name(webhookConfig.Name). @@ -131,8 +131,8 @@ func (c *webhookConfigs) Update(ctx context.Context, webhookConfig *v2.WebhookCo // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *webhookConfigs) UpdateStatus(ctx context.Context, webhookConfig *v2.WebhookConfig, opts v1.UpdateOptions) (result *v2.WebhookConfig, err error) { - result = &v2.WebhookConfig{} +func (c *webhookConfigs) UpdateStatus(ctx context.Context, webhookConfig *v2alpha1.WebhookConfig, opts v1.UpdateOptions) (result *v2alpha1.WebhookConfig, err error) { + result = &v2alpha1.WebhookConfig{} err = c.client.Put(). Resource("webhookconfigs"). Name(webhookConfig.Name). @@ -170,8 +170,8 @@ func (c *webhookConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOpt } // Patch applies the patch and returns the patched webhookConfig. -func (c *webhookConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WebhookConfig, err error) { - result = &v2.WebhookConfig{} +func (c *webhookConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WebhookConfig, err error) { + result = &v2alpha1.WebhookConfig{} err = c.client.Patch(pt). Resource("webhookconfigs"). Name(name). diff --git a/pkg/client/clientset/versioned/typed/notification/v2/webhookreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/webhookreceiver.go similarity index 79% rename from pkg/client/clientset/versioned/typed/notification/v2/webhookreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/webhookreceiver.go index 9072d03fd..a48ffdf7f 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/webhookreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/webhookreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type WebhookReceiversGetter interface { // WebhookReceiverInterface has methods to work with WebhookReceiver resources. type WebhookReceiverInterface interface { - Create(ctx context.Context, webhookReceiver *v2.WebhookReceiver, opts v1.CreateOptions) (*v2.WebhookReceiver, error) - Update(ctx context.Context, webhookReceiver *v2.WebhookReceiver, opts v1.UpdateOptions) (*v2.WebhookReceiver, error) - UpdateStatus(ctx context.Context, webhookReceiver *v2.WebhookReceiver, opts v1.UpdateOptions) (*v2.WebhookReceiver, error) + Create(ctx context.Context, webhookReceiver *v2alpha1.WebhookReceiver, opts v1.CreateOptions) (*v2alpha1.WebhookReceiver, error) + Update(ctx context.Context, webhookReceiver *v2alpha1.WebhookReceiver, opts v1.UpdateOptions) (*v2alpha1.WebhookReceiver, error) + UpdateStatus(ctx context.Context, webhookReceiver *v2alpha1.WebhookReceiver, opts v1.UpdateOptions) (*v2alpha1.WebhookReceiver, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.WebhookReceiver, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.WebhookReceiverList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.WebhookReceiver, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.WebhookReceiverList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WebhookReceiver, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WebhookReceiver, err error) WebhookReceiverExpansion } @@ -56,15 +56,15 @@ type webhookReceivers struct { } // newWebhookReceivers returns a WebhookReceivers -func newWebhookReceivers(c *NotificationV2Client) *webhookReceivers { +func newWebhookReceivers(c *NotificationV2alpha1Client) *webhookReceivers { return &webhookReceivers{ client: c.RESTClient(), } } // Get takes name of the webhookReceiver, and returns the corresponding webhookReceiver object, and an error if there is any. -func (c *webhookReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.WebhookReceiver, err error) { - result = &v2.WebhookReceiver{} +func (c *webhookReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.WebhookReceiver, err error) { + result = &v2alpha1.WebhookReceiver{} err = c.client.Get(). Resource("webhookreceivers"). Name(name). @@ -75,12 +75,12 @@ func (c *webhookReceivers) Get(ctx context.Context, name string, options v1.GetO } // List takes label and field selectors, and returns the list of WebhookReceivers that match those selectors. -func (c *webhookReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.WebhookReceiverList, err error) { +func (c *webhookReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.WebhookReceiverList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.WebhookReceiverList{} + result = &v2alpha1.WebhookReceiverList{} err = c.client.Get(). Resource("webhookreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *webhookReceivers) Watch(ctx context.Context, opts v1.ListOptions) (watc } // Create takes the representation of a webhookReceiver and creates it. Returns the server's representation of the webhookReceiver, and an error, if there is any. -func (c *webhookReceivers) Create(ctx context.Context, webhookReceiver *v2.WebhookReceiver, opts v1.CreateOptions) (result *v2.WebhookReceiver, err error) { - result = &v2.WebhookReceiver{} +func (c *webhookReceivers) Create(ctx context.Context, webhookReceiver *v2alpha1.WebhookReceiver, opts v1.CreateOptions) (result *v2alpha1.WebhookReceiver, err error) { + result = &v2alpha1.WebhookReceiver{} err = c.client.Post(). Resource("webhookreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *webhookReceivers) Create(ctx context.Context, webhookReceiver *v2.Webho } // Update takes the representation of a webhookReceiver and updates it. Returns the server's representation of the webhookReceiver, and an error, if there is any. -func (c *webhookReceivers) Update(ctx context.Context, webhookReceiver *v2.WebhookReceiver, opts v1.UpdateOptions) (result *v2.WebhookReceiver, err error) { - result = &v2.WebhookReceiver{} +func (c *webhookReceivers) Update(ctx context.Context, webhookReceiver *v2alpha1.WebhookReceiver, opts v1.UpdateOptions) (result *v2alpha1.WebhookReceiver, err error) { + result = &v2alpha1.WebhookReceiver{} err = c.client.Put(). Resource("webhookreceivers"). Name(webhookReceiver.Name). @@ -131,8 +131,8 @@ func (c *webhookReceivers) Update(ctx context.Context, webhookReceiver *v2.Webho // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *webhookReceivers) UpdateStatus(ctx context.Context, webhookReceiver *v2.WebhookReceiver, opts v1.UpdateOptions) (result *v2.WebhookReceiver, err error) { - result = &v2.WebhookReceiver{} +func (c *webhookReceivers) UpdateStatus(ctx context.Context, webhookReceiver *v2alpha1.WebhookReceiver, opts v1.UpdateOptions) (result *v2alpha1.WebhookReceiver, err error) { + result = &v2alpha1.WebhookReceiver{} err = c.client.Put(). Resource("webhookreceivers"). Name(webhookReceiver.Name). @@ -170,8 +170,8 @@ func (c *webhookReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteO } // Patch applies the patch and returns the patched webhookReceiver. -func (c *webhookReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WebhookReceiver, err error) { - result = &v2.WebhookReceiver{} +func (c *webhookReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WebhookReceiver, err error) { + result = &v2alpha1.WebhookReceiver{} err = c.client.Patch(pt). Resource("webhookreceivers"). Name(name). diff --git a/pkg/client/clientset/versioned/typed/notification/v2/wechatconfig.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/wechatconfig.go similarity index 79% rename from pkg/client/clientset/versioned/typed/notification/v2/wechatconfig.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/wechatconfig.go index e850bc36e..87d393cb8 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/wechatconfig.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/wechatconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type WechatConfigsGetter interface { // WechatConfigInterface has methods to work with WechatConfig resources. type WechatConfigInterface interface { - Create(ctx context.Context, wechatConfig *v2.WechatConfig, opts v1.CreateOptions) (*v2.WechatConfig, error) - Update(ctx context.Context, wechatConfig *v2.WechatConfig, opts v1.UpdateOptions) (*v2.WechatConfig, error) - UpdateStatus(ctx context.Context, wechatConfig *v2.WechatConfig, opts v1.UpdateOptions) (*v2.WechatConfig, error) + Create(ctx context.Context, wechatConfig *v2alpha1.WechatConfig, opts v1.CreateOptions) (*v2alpha1.WechatConfig, error) + Update(ctx context.Context, wechatConfig *v2alpha1.WechatConfig, opts v1.UpdateOptions) (*v2alpha1.WechatConfig, error) + UpdateStatus(ctx context.Context, wechatConfig *v2alpha1.WechatConfig, opts v1.UpdateOptions) (*v2alpha1.WechatConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.WechatConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.WechatConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.WechatConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.WechatConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WechatConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WechatConfig, err error) WechatConfigExpansion } @@ -56,15 +56,15 @@ type wechatConfigs struct { } // newWechatConfigs returns a WechatConfigs -func newWechatConfigs(c *NotificationV2Client) *wechatConfigs { +func newWechatConfigs(c *NotificationV2alpha1Client) *wechatConfigs { return &wechatConfigs{ client: c.RESTClient(), } } // Get takes name of the wechatConfig, and returns the corresponding wechatConfig object, and an error if there is any. -func (c *wechatConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.WechatConfig, err error) { - result = &v2.WechatConfig{} +func (c *wechatConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.WechatConfig, err error) { + result = &v2alpha1.WechatConfig{} err = c.client.Get(). Resource("wechatconfigs"). Name(name). @@ -75,12 +75,12 @@ func (c *wechatConfigs) Get(ctx context.Context, name string, options v1.GetOpti } // List takes label and field selectors, and returns the list of WechatConfigs that match those selectors. -func (c *wechatConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2.WechatConfigList, err error) { +func (c *wechatConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.WechatConfigList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.WechatConfigList{} + result = &v2alpha1.WechatConfigList{} err = c.client.Get(). Resource("wechatconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *wechatConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.I } // Create takes the representation of a wechatConfig and creates it. Returns the server's representation of the wechatConfig, and an error, if there is any. -func (c *wechatConfigs) Create(ctx context.Context, wechatConfig *v2.WechatConfig, opts v1.CreateOptions) (result *v2.WechatConfig, err error) { - result = &v2.WechatConfig{} +func (c *wechatConfigs) Create(ctx context.Context, wechatConfig *v2alpha1.WechatConfig, opts v1.CreateOptions) (result *v2alpha1.WechatConfig, err error) { + result = &v2alpha1.WechatConfig{} err = c.client.Post(). Resource("wechatconfigs"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *wechatConfigs) Create(ctx context.Context, wechatConfig *v2.WechatConfi } // Update takes the representation of a wechatConfig and updates it. Returns the server's representation of the wechatConfig, and an error, if there is any. -func (c *wechatConfigs) Update(ctx context.Context, wechatConfig *v2.WechatConfig, opts v1.UpdateOptions) (result *v2.WechatConfig, err error) { - result = &v2.WechatConfig{} +func (c *wechatConfigs) Update(ctx context.Context, wechatConfig *v2alpha1.WechatConfig, opts v1.UpdateOptions) (result *v2alpha1.WechatConfig, err error) { + result = &v2alpha1.WechatConfig{} err = c.client.Put(). Resource("wechatconfigs"). Name(wechatConfig.Name). @@ -131,8 +131,8 @@ func (c *wechatConfigs) Update(ctx context.Context, wechatConfig *v2.WechatConfi // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *wechatConfigs) UpdateStatus(ctx context.Context, wechatConfig *v2.WechatConfig, opts v1.UpdateOptions) (result *v2.WechatConfig, err error) { - result = &v2.WechatConfig{} +func (c *wechatConfigs) UpdateStatus(ctx context.Context, wechatConfig *v2alpha1.WechatConfig, opts v1.UpdateOptions) (result *v2alpha1.WechatConfig, err error) { + result = &v2alpha1.WechatConfig{} err = c.client.Put(). Resource("wechatconfigs"). Name(wechatConfig.Name). @@ -170,8 +170,8 @@ func (c *wechatConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOpti } // Patch applies the patch and returns the patched wechatConfig. -func (c *wechatConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WechatConfig, err error) { - result = &v2.WechatConfig{} +func (c *wechatConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WechatConfig, err error) { + result = &v2alpha1.WechatConfig{} err = c.client.Patch(pt). Resource("wechatconfigs"). Name(name). diff --git a/pkg/client/clientset/versioned/typed/notification/v2/wechatreceiver.go b/pkg/client/clientset/versioned/typed/notification/v2alpha1/wechatreceiver.go similarity index 78% rename from pkg/client/clientset/versioned/typed/notification/v2/wechatreceiver.go rename to pkg/client/clientset/versioned/typed/notification/v2alpha1/wechatreceiver.go index 9cf9145b0..483d47d58 100644 --- a/pkg/client/clientset/versioned/typed/notification/v2/wechatreceiver.go +++ b/pkg/client/clientset/versioned/typed/notification/v2alpha1/wechatreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,7 +26,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +38,15 @@ type WechatReceiversGetter interface { // WechatReceiverInterface has methods to work with WechatReceiver resources. type WechatReceiverInterface interface { - Create(ctx context.Context, wechatReceiver *v2.WechatReceiver, opts v1.CreateOptions) (*v2.WechatReceiver, error) - Update(ctx context.Context, wechatReceiver *v2.WechatReceiver, opts v1.UpdateOptions) (*v2.WechatReceiver, error) - UpdateStatus(ctx context.Context, wechatReceiver *v2.WechatReceiver, opts v1.UpdateOptions) (*v2.WechatReceiver, error) + Create(ctx context.Context, wechatReceiver *v2alpha1.WechatReceiver, opts v1.CreateOptions) (*v2alpha1.WechatReceiver, error) + Update(ctx context.Context, wechatReceiver *v2alpha1.WechatReceiver, opts v1.UpdateOptions) (*v2alpha1.WechatReceiver, error) + UpdateStatus(ctx context.Context, wechatReceiver *v2alpha1.WechatReceiver, opts v1.UpdateOptions) (*v2alpha1.WechatReceiver, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.WechatReceiver, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.WechatReceiverList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.WechatReceiver, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.WechatReceiverList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WechatReceiver, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WechatReceiver, err error) WechatReceiverExpansion } @@ -56,15 +56,15 @@ type wechatReceivers struct { } // newWechatReceivers returns a WechatReceivers -func newWechatReceivers(c *NotificationV2Client) *wechatReceivers { +func newWechatReceivers(c *NotificationV2alpha1Client) *wechatReceivers { return &wechatReceivers{ client: c.RESTClient(), } } // Get takes name of the wechatReceiver, and returns the corresponding wechatReceiver object, and an error if there is any. -func (c *wechatReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.WechatReceiver, err error) { - result = &v2.WechatReceiver{} +func (c *wechatReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.WechatReceiver, err error) { + result = &v2alpha1.WechatReceiver{} err = c.client.Get(). Resource("wechatreceivers"). Name(name). @@ -75,12 +75,12 @@ func (c *wechatReceivers) Get(ctx context.Context, name string, options v1.GetOp } // List takes label and field selectors, and returns the list of WechatReceivers that match those selectors. -func (c *wechatReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2.WechatReceiverList, err error) { +func (c *wechatReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.WechatReceiverList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v2.WechatReceiverList{} + result = &v2alpha1.WechatReceiverList{} err = c.client.Get(). Resource("wechatreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -105,8 +105,8 @@ func (c *wechatReceivers) Watch(ctx context.Context, opts v1.ListOptions) (watch } // Create takes the representation of a wechatReceiver and creates it. Returns the server's representation of the wechatReceiver, and an error, if there is any. -func (c *wechatReceivers) Create(ctx context.Context, wechatReceiver *v2.WechatReceiver, opts v1.CreateOptions) (result *v2.WechatReceiver, err error) { - result = &v2.WechatReceiver{} +func (c *wechatReceivers) Create(ctx context.Context, wechatReceiver *v2alpha1.WechatReceiver, opts v1.CreateOptions) (result *v2alpha1.WechatReceiver, err error) { + result = &v2alpha1.WechatReceiver{} err = c.client.Post(). Resource("wechatreceivers"). VersionedParams(&opts, scheme.ParameterCodec). @@ -117,8 +117,8 @@ func (c *wechatReceivers) Create(ctx context.Context, wechatReceiver *v2.WechatR } // Update takes the representation of a wechatReceiver and updates it. Returns the server's representation of the wechatReceiver, and an error, if there is any. -func (c *wechatReceivers) Update(ctx context.Context, wechatReceiver *v2.WechatReceiver, opts v1.UpdateOptions) (result *v2.WechatReceiver, err error) { - result = &v2.WechatReceiver{} +func (c *wechatReceivers) Update(ctx context.Context, wechatReceiver *v2alpha1.WechatReceiver, opts v1.UpdateOptions) (result *v2alpha1.WechatReceiver, err error) { + result = &v2alpha1.WechatReceiver{} err = c.client.Put(). Resource("wechatreceivers"). Name(wechatReceiver.Name). @@ -131,8 +131,8 @@ func (c *wechatReceivers) Update(ctx context.Context, wechatReceiver *v2.WechatR // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *wechatReceivers) UpdateStatus(ctx context.Context, wechatReceiver *v2.WechatReceiver, opts v1.UpdateOptions) (result *v2.WechatReceiver, err error) { - result = &v2.WechatReceiver{} +func (c *wechatReceivers) UpdateStatus(ctx context.Context, wechatReceiver *v2alpha1.WechatReceiver, opts v1.UpdateOptions) (result *v2alpha1.WechatReceiver, err error) { + result = &v2alpha1.WechatReceiver{} err = c.client.Put(). Resource("wechatreceivers"). Name(wechatReceiver.Name). @@ -170,8 +170,8 @@ func (c *wechatReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOp } // Patch applies the patch and returns the patched wechatReceiver. -func (c *wechatReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.WechatReceiver, err error) { - result = &v2.WechatReceiver{} +func (c *wechatReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.WechatReceiver, err error) { + result = &v2alpha1.WechatReceiver{} err = c.client.Patch(pt). Resource("wechatreceivers"). Name(name). diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index fe74bb2c5..03d3fa0e9 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -30,8 +30,12 @@ import ( v1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3" v1alpha2 "kubesphere.io/kubesphere/pkg/apis/iam/v1alpha2" networkv1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1" +<<<<<<< HEAD v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" quotav1alpha2 "kubesphere.io/kubesphere/pkg/apis/quota/v1alpha2" +======= + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" +>>>>>>> change notification crd version to v2alpha1 servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2" storagev1alpha1 "kubesphere.io/kubesphere/pkg/apis/storage/v1alpha1" tenantv1alpha1 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1" @@ -133,27 +137,27 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case networkv1alpha1.SchemeGroupVersion.WithResource("namespacenetworkpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Network().V1alpha1().NamespaceNetworkPolicies().Informer()}, nil - // Group=notification.kubesphere.io, Version=v2 - case v2.SchemeGroupVersion.WithResource("dingtalkconfigs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().DingTalkConfigs().Informer()}, nil - case v2.SchemeGroupVersion.WithResource("dingtalkreceivers"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().DingTalkReceivers().Informer()}, nil - case v2.SchemeGroupVersion.WithResource("emailconfigs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().EmailConfigs().Informer()}, nil - case v2.SchemeGroupVersion.WithResource("emailreceivers"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().EmailReceivers().Informer()}, nil - case v2.SchemeGroupVersion.WithResource("slackconfigs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().SlackConfigs().Informer()}, nil - case v2.SchemeGroupVersion.WithResource("slackreceivers"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().SlackReceivers().Informer()}, nil - case v2.SchemeGroupVersion.WithResource("webhookconfigs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().WebhookConfigs().Informer()}, nil - case v2.SchemeGroupVersion.WithResource("webhookreceivers"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().WebhookReceivers().Informer()}, nil - case v2.SchemeGroupVersion.WithResource("wechatconfigs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().WechatConfigs().Informer()}, nil - case v2.SchemeGroupVersion.WithResource("wechatreceivers"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2().WechatReceivers().Informer()}, nil + // Group=notification.kubesphere.io, Version=v2alpha1 + case v2alpha1.SchemeGroupVersion.WithResource("dingtalkconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().DingTalkConfigs().Informer()}, nil + case v2alpha1.SchemeGroupVersion.WithResource("dingtalkreceivers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().DingTalkReceivers().Informer()}, nil + case v2alpha1.SchemeGroupVersion.WithResource("emailconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().EmailConfigs().Informer()}, nil + case v2alpha1.SchemeGroupVersion.WithResource("emailreceivers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().EmailReceivers().Informer()}, nil + case v2alpha1.SchemeGroupVersion.WithResource("slackconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().SlackConfigs().Informer()}, nil + case v2alpha1.SchemeGroupVersion.WithResource("slackreceivers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().SlackReceivers().Informer()}, nil + case v2alpha1.SchemeGroupVersion.WithResource("webhookconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().WebhookConfigs().Informer()}, nil + case v2alpha1.SchemeGroupVersion.WithResource("webhookreceivers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().WebhookReceivers().Informer()}, nil + case v2alpha1.SchemeGroupVersion.WithResource("wechatconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().WechatConfigs().Informer()}, nil + case v2alpha1.SchemeGroupVersion.WithResource("wechatreceivers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2alpha1().WechatReceivers().Informer()}, nil // Group=quota.kubesphere.io, Version=v1alpha2 case quotav1alpha2.SchemeGroupVersion.WithResource("resourcequotas"): diff --git a/pkg/client/informers/externalversions/notification/interface.go b/pkg/client/informers/externalversions/notification/interface.go index c5d31fdf3..15992cecc 100644 --- a/pkg/client/informers/externalversions/notification/interface.go +++ b/pkg/client/informers/externalversions/notification/interface.go @@ -20,13 +20,13 @@ package notification import ( internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/informers/externalversions/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/informers/externalversions/notification/v2alpha1" ) // Interface provides access to each of this group's versions. type Interface interface { - // V2 provides access to shared informers for resources in V2. - V2() v2.Interface + // V2alpha1 provides access to shared informers for resources in V2alpha1. + V2alpha1() v2alpha1.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V2 returns a new v2.Interface. -func (g *group) V2() v2.Interface { - return v2.New(g.factory, g.namespace, g.tweakListOptions) +// V2alpha1 returns a new v2alpha1.Interface. +func (g *group) V2alpha1() v2alpha1.Interface { + return v2alpha1.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/notification/v2/dingtalkconfig.go b/pkg/client/informers/externalversions/notification/v2alpha1/dingtalkconfig.go similarity index 82% rename from pkg/client/informers/externalversions/notification/v2/dingtalkconfig.go rename to pkg/client/informers/externalversions/notification/v2alpha1/dingtalkconfig.go index 1cbd67536..7cb150816 100644 --- a/pkg/client/informers/externalversions/notification/v2/dingtalkconfig.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/dingtalkconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // DingTalkConfigInformer provides access to a shared informer and lister for // DingTalkConfigs. type DingTalkConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.DingTalkConfigLister + Lister() v2alpha1.DingTalkConfigLister } type dingTalkConfigInformer struct { @@ -61,16 +61,16 @@ func NewFilteredDingTalkConfigInformer(client versioned.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().DingTalkConfigs().List(context.TODO(), options) + return client.NotificationV2alpha1().DingTalkConfigs().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().DingTalkConfigs().Watch(context.TODO(), options) + return client.NotificationV2alpha1().DingTalkConfigs().Watch(context.TODO(), options) }, }, - ¬ificationv2.DingTalkConfig{}, + ¬ificationv2alpha1.DingTalkConfig{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *dingTalkConfigInformer) defaultInformer(client versioned.Interface, res } func (f *dingTalkConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.DingTalkConfig{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.DingTalkConfig{}, f.defaultInformer) } -func (f *dingTalkConfigInformer) Lister() v2.DingTalkConfigLister { - return v2.NewDingTalkConfigLister(f.Informer().GetIndexer()) +func (f *dingTalkConfigInformer) Lister() v2alpha1.DingTalkConfigLister { + return v2alpha1.NewDingTalkConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/notification/v2/dingtalkreceiver.go b/pkg/client/informers/externalversions/notification/v2alpha1/dingtalkreceiver.go similarity index 81% rename from pkg/client/informers/externalversions/notification/v2/dingtalkreceiver.go rename to pkg/client/informers/externalversions/notification/v2alpha1/dingtalkreceiver.go index 3c4f4d362..1607f3f77 100644 --- a/pkg/client/informers/externalversions/notification/v2/dingtalkreceiver.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/dingtalkreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // DingTalkReceiverInformer provides access to a shared informer and lister for // DingTalkReceivers. type DingTalkReceiverInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.DingTalkReceiverLister + Lister() v2alpha1.DingTalkReceiverLister } type dingTalkReceiverInformer struct { @@ -61,16 +61,16 @@ func NewFilteredDingTalkReceiverInformer(client versioned.Interface, resyncPerio if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().DingTalkReceivers().List(context.TODO(), options) + return client.NotificationV2alpha1().DingTalkReceivers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().DingTalkReceivers().Watch(context.TODO(), options) + return client.NotificationV2alpha1().DingTalkReceivers().Watch(context.TODO(), options) }, }, - ¬ificationv2.DingTalkReceiver{}, + ¬ificationv2alpha1.DingTalkReceiver{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *dingTalkReceiverInformer) defaultInformer(client versioned.Interface, r } func (f *dingTalkReceiverInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.DingTalkReceiver{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.DingTalkReceiver{}, f.defaultInformer) } -func (f *dingTalkReceiverInformer) Lister() v2.DingTalkReceiverLister { - return v2.NewDingTalkReceiverLister(f.Informer().GetIndexer()) +func (f *dingTalkReceiverInformer) Lister() v2alpha1.DingTalkReceiverLister { + return v2alpha1.NewDingTalkReceiverLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/notification/v2/emailconfig.go b/pkg/client/informers/externalversions/notification/v2alpha1/emailconfig.go similarity index 82% rename from pkg/client/informers/externalversions/notification/v2/emailconfig.go rename to pkg/client/informers/externalversions/notification/v2alpha1/emailconfig.go index a7860894a..0762ea5d6 100644 --- a/pkg/client/informers/externalversions/notification/v2/emailconfig.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/emailconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // EmailConfigInformer provides access to a shared informer and lister for // EmailConfigs. type EmailConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.EmailConfigLister + Lister() v2alpha1.EmailConfigLister } type emailConfigInformer struct { @@ -61,16 +61,16 @@ func NewFilteredEmailConfigInformer(client versioned.Interface, resyncPeriod tim if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().EmailConfigs().List(context.TODO(), options) + return client.NotificationV2alpha1().EmailConfigs().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().EmailConfigs().Watch(context.TODO(), options) + return client.NotificationV2alpha1().EmailConfigs().Watch(context.TODO(), options) }, }, - ¬ificationv2.EmailConfig{}, + ¬ificationv2alpha1.EmailConfig{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *emailConfigInformer) defaultInformer(client versioned.Interface, resync } func (f *emailConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.EmailConfig{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.EmailConfig{}, f.defaultInformer) } -func (f *emailConfigInformer) Lister() v2.EmailConfigLister { - return v2.NewEmailConfigLister(f.Informer().GetIndexer()) +func (f *emailConfigInformer) Lister() v2alpha1.EmailConfigLister { + return v2alpha1.NewEmailConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/notification/v2/emailreceiver.go b/pkg/client/informers/externalversions/notification/v2alpha1/emailreceiver.go similarity index 82% rename from pkg/client/informers/externalversions/notification/v2/emailreceiver.go rename to pkg/client/informers/externalversions/notification/v2alpha1/emailreceiver.go index a49a32b7d..bf109333e 100644 --- a/pkg/client/informers/externalversions/notification/v2/emailreceiver.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/emailreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // EmailReceiverInformer provides access to a shared informer and lister for // EmailReceivers. type EmailReceiverInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.EmailReceiverLister + Lister() v2alpha1.EmailReceiverLister } type emailReceiverInformer struct { @@ -61,16 +61,16 @@ func NewFilteredEmailReceiverInformer(client versioned.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().EmailReceivers().List(context.TODO(), options) + return client.NotificationV2alpha1().EmailReceivers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().EmailReceivers().Watch(context.TODO(), options) + return client.NotificationV2alpha1().EmailReceivers().Watch(context.TODO(), options) }, }, - ¬ificationv2.EmailReceiver{}, + ¬ificationv2alpha1.EmailReceiver{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *emailReceiverInformer) defaultInformer(client versioned.Interface, resy } func (f *emailReceiverInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.EmailReceiver{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.EmailReceiver{}, f.defaultInformer) } -func (f *emailReceiverInformer) Lister() v2.EmailReceiverLister { - return v2.NewEmailReceiverLister(f.Informer().GetIndexer()) +func (f *emailReceiverInformer) Lister() v2alpha1.EmailReceiverLister { + return v2alpha1.NewEmailReceiverLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/notification/v2/interface.go b/pkg/client/informers/externalversions/notification/v2alpha1/interface.go similarity index 99% rename from pkg/client/informers/externalversions/notification/v2/interface.go rename to pkg/client/informers/externalversions/notification/v2alpha1/interface.go index a1afb6e0d..b52c7460a 100644 --- a/pkg/client/informers/externalversions/notification/v2/interface.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" diff --git a/pkg/client/informers/externalversions/notification/v2/slackconfig.go b/pkg/client/informers/externalversions/notification/v2alpha1/slackconfig.go similarity index 82% rename from pkg/client/informers/externalversions/notification/v2/slackconfig.go rename to pkg/client/informers/externalversions/notification/v2alpha1/slackconfig.go index c326cd90a..317ead759 100644 --- a/pkg/client/informers/externalversions/notification/v2/slackconfig.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/slackconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // SlackConfigInformer provides access to a shared informer and lister for // SlackConfigs. type SlackConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.SlackConfigLister + Lister() v2alpha1.SlackConfigLister } type slackConfigInformer struct { @@ -61,16 +61,16 @@ func NewFilteredSlackConfigInformer(client versioned.Interface, resyncPeriod tim if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().SlackConfigs().List(context.TODO(), options) + return client.NotificationV2alpha1().SlackConfigs().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().SlackConfigs().Watch(context.TODO(), options) + return client.NotificationV2alpha1().SlackConfigs().Watch(context.TODO(), options) }, }, - ¬ificationv2.SlackConfig{}, + ¬ificationv2alpha1.SlackConfig{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *slackConfigInformer) defaultInformer(client versioned.Interface, resync } func (f *slackConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.SlackConfig{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.SlackConfig{}, f.defaultInformer) } -func (f *slackConfigInformer) Lister() v2.SlackConfigLister { - return v2.NewSlackConfigLister(f.Informer().GetIndexer()) +func (f *slackConfigInformer) Lister() v2alpha1.SlackConfigLister { + return v2alpha1.NewSlackConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/notification/v2/slackreceiver.go b/pkg/client/informers/externalversions/notification/v2alpha1/slackreceiver.go similarity index 82% rename from pkg/client/informers/externalversions/notification/v2/slackreceiver.go rename to pkg/client/informers/externalversions/notification/v2alpha1/slackreceiver.go index 89fe1e10e..928e6ee44 100644 --- a/pkg/client/informers/externalversions/notification/v2/slackreceiver.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/slackreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // SlackReceiverInformer provides access to a shared informer and lister for // SlackReceivers. type SlackReceiverInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.SlackReceiverLister + Lister() v2alpha1.SlackReceiverLister } type slackReceiverInformer struct { @@ -61,16 +61,16 @@ func NewFilteredSlackReceiverInformer(client versioned.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().SlackReceivers().List(context.TODO(), options) + return client.NotificationV2alpha1().SlackReceivers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().SlackReceivers().Watch(context.TODO(), options) + return client.NotificationV2alpha1().SlackReceivers().Watch(context.TODO(), options) }, }, - ¬ificationv2.SlackReceiver{}, + ¬ificationv2alpha1.SlackReceiver{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *slackReceiverInformer) defaultInformer(client versioned.Interface, resy } func (f *slackReceiverInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.SlackReceiver{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.SlackReceiver{}, f.defaultInformer) } -func (f *slackReceiverInformer) Lister() v2.SlackReceiverLister { - return v2.NewSlackReceiverLister(f.Informer().GetIndexer()) +func (f *slackReceiverInformer) Lister() v2alpha1.SlackReceiverLister { + return v2alpha1.NewSlackReceiverLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/notification/v2/webhookconfig.go b/pkg/client/informers/externalversions/notification/v2alpha1/webhookconfig.go similarity index 82% rename from pkg/client/informers/externalversions/notification/v2/webhookconfig.go rename to pkg/client/informers/externalversions/notification/v2alpha1/webhookconfig.go index 492babe9b..70ea50e47 100644 --- a/pkg/client/informers/externalversions/notification/v2/webhookconfig.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/webhookconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // WebhookConfigInformer provides access to a shared informer and lister for // WebhookConfigs. type WebhookConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.WebhookConfigLister + Lister() v2alpha1.WebhookConfigLister } type webhookConfigInformer struct { @@ -61,16 +61,16 @@ func NewFilteredWebhookConfigInformer(client versioned.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().WebhookConfigs().List(context.TODO(), options) + return client.NotificationV2alpha1().WebhookConfigs().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().WebhookConfigs().Watch(context.TODO(), options) + return client.NotificationV2alpha1().WebhookConfigs().Watch(context.TODO(), options) }, }, - ¬ificationv2.WebhookConfig{}, + ¬ificationv2alpha1.WebhookConfig{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *webhookConfigInformer) defaultInformer(client versioned.Interface, resy } func (f *webhookConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.WebhookConfig{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.WebhookConfig{}, f.defaultInformer) } -func (f *webhookConfigInformer) Lister() v2.WebhookConfigLister { - return v2.NewWebhookConfigLister(f.Informer().GetIndexer()) +func (f *webhookConfigInformer) Lister() v2alpha1.WebhookConfigLister { + return v2alpha1.NewWebhookConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/notification/v2/webhookreceiver.go b/pkg/client/informers/externalversions/notification/v2alpha1/webhookreceiver.go similarity index 81% rename from pkg/client/informers/externalversions/notification/v2/webhookreceiver.go rename to pkg/client/informers/externalversions/notification/v2alpha1/webhookreceiver.go index 9a41c6be6..5d9229d6a 100644 --- a/pkg/client/informers/externalversions/notification/v2/webhookreceiver.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/webhookreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // WebhookReceiverInformer provides access to a shared informer and lister for // WebhookReceivers. type WebhookReceiverInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.WebhookReceiverLister + Lister() v2alpha1.WebhookReceiverLister } type webhookReceiverInformer struct { @@ -61,16 +61,16 @@ func NewFilteredWebhookReceiverInformer(client versioned.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().WebhookReceivers().List(context.TODO(), options) + return client.NotificationV2alpha1().WebhookReceivers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().WebhookReceivers().Watch(context.TODO(), options) + return client.NotificationV2alpha1().WebhookReceivers().Watch(context.TODO(), options) }, }, - ¬ificationv2.WebhookReceiver{}, + ¬ificationv2alpha1.WebhookReceiver{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *webhookReceiverInformer) defaultInformer(client versioned.Interface, re } func (f *webhookReceiverInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.WebhookReceiver{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.WebhookReceiver{}, f.defaultInformer) } -func (f *webhookReceiverInformer) Lister() v2.WebhookReceiverLister { - return v2.NewWebhookReceiverLister(f.Informer().GetIndexer()) +func (f *webhookReceiverInformer) Lister() v2alpha1.WebhookReceiverLister { + return v2alpha1.NewWebhookReceiverLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/notification/v2/wechatconfig.go b/pkg/client/informers/externalversions/notification/v2alpha1/wechatconfig.go similarity index 82% rename from pkg/client/informers/externalversions/notification/v2/wechatconfig.go rename to pkg/client/informers/externalversions/notification/v2alpha1/wechatconfig.go index 26e05061d..b17aac222 100644 --- a/pkg/client/informers/externalversions/notification/v2/wechatconfig.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/wechatconfig.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // WechatConfigInformer provides access to a shared informer and lister for // WechatConfigs. type WechatConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.WechatConfigLister + Lister() v2alpha1.WechatConfigLister } type wechatConfigInformer struct { @@ -61,16 +61,16 @@ func NewFilteredWechatConfigInformer(client versioned.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().WechatConfigs().List(context.TODO(), options) + return client.NotificationV2alpha1().WechatConfigs().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().WechatConfigs().Watch(context.TODO(), options) + return client.NotificationV2alpha1().WechatConfigs().Watch(context.TODO(), options) }, }, - ¬ificationv2.WechatConfig{}, + ¬ificationv2alpha1.WechatConfig{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *wechatConfigInformer) defaultInformer(client versioned.Interface, resyn } func (f *wechatConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.WechatConfig{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.WechatConfig{}, f.defaultInformer) } -func (f *wechatConfigInformer) Lister() v2.WechatConfigLister { - return v2.NewWechatConfigLister(f.Informer().GetIndexer()) +func (f *wechatConfigInformer) Lister() v2alpha1.WechatConfigLister { + return v2alpha1.NewWechatConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/notification/v2/wechatreceiver.go b/pkg/client/informers/externalversions/notification/v2alpha1/wechatreceiver.go similarity index 82% rename from pkg/client/informers/externalversions/notification/v2/wechatreceiver.go rename to pkg/client/informers/externalversions/notification/v2alpha1/wechatreceiver.go index 253a69194..9a6569297 100644 --- a/pkg/client/informers/externalversions/notification/v2/wechatreceiver.go +++ b/pkg/client/informers/externalversions/notification/v2alpha1/wechatreceiver.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned" internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces" - v2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2alpha1" ) // WechatReceiverInformer provides access to a shared informer and lister for // WechatReceivers. type WechatReceiverInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.WechatReceiverLister + Lister() v2alpha1.WechatReceiverLister } type wechatReceiverInformer struct { @@ -61,16 +61,16 @@ func NewFilteredWechatReceiverInformer(client versioned.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().WechatReceivers().List(context.TODO(), options) + return client.NotificationV2alpha1().WechatReceivers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NotificationV2().WechatReceivers().Watch(context.TODO(), options) + return client.NotificationV2alpha1().WechatReceivers().Watch(context.TODO(), options) }, }, - ¬ificationv2.WechatReceiver{}, + ¬ificationv2alpha1.WechatReceiver{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *wechatReceiverInformer) defaultInformer(client versioned.Interface, res } func (f *wechatReceiverInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(¬ificationv2.WechatReceiver{}, f.defaultInformer) + return f.factory.InformerFor(¬ificationv2alpha1.WechatReceiver{}, f.defaultInformer) } -func (f *wechatReceiverInformer) Lister() v2.WechatReceiverLister { - return v2.NewWechatReceiverLister(f.Informer().GetIndexer()) +func (f *wechatReceiverInformer) Lister() v2alpha1.WechatReceiverLister { + return v2alpha1.NewWechatReceiverLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/listers/notification/v2/dingtalkconfig.go b/pkg/client/listers/notification/v2alpha1/dingtalkconfig.go similarity index 76% rename from pkg/client/listers/notification/v2/dingtalkconfig.go rename to pkg/client/listers/notification/v2alpha1/dingtalkconfig.go index 28420570b..2e20720d0 100644 --- a/pkg/client/listers/notification/v2/dingtalkconfig.go +++ b/pkg/client/listers/notification/v2alpha1/dingtalkconfig.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // DingTalkConfigLister helps list DingTalkConfigs. type DingTalkConfigLister interface { // List lists all DingTalkConfigs in the indexer. - List(selector labels.Selector) (ret []*v2.DingTalkConfig, err error) + List(selector labels.Selector) (ret []*v2alpha1.DingTalkConfig, err error) // Get retrieves the DingTalkConfig from the index for a given name. - Get(name string) (*v2.DingTalkConfig, error) + Get(name string) (*v2alpha1.DingTalkConfig, error) DingTalkConfigListerExpansion } @@ -45,21 +45,21 @@ func NewDingTalkConfigLister(indexer cache.Indexer) DingTalkConfigLister { } // List lists all DingTalkConfigs in the indexer. -func (s *dingTalkConfigLister) List(selector labels.Selector) (ret []*v2.DingTalkConfig, err error) { +func (s *dingTalkConfigLister) List(selector labels.Selector) (ret []*v2alpha1.DingTalkConfig, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.DingTalkConfig)) + ret = append(ret, m.(*v2alpha1.DingTalkConfig)) }) return ret, err } // Get retrieves the DingTalkConfig from the index for a given name. -func (s *dingTalkConfigLister) Get(name string) (*v2.DingTalkConfig, error) { +func (s *dingTalkConfigLister) Get(name string) (*v2alpha1.DingTalkConfig, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("dingtalkconfig"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("dingtalkconfig"), name) } - return obj.(*v2.DingTalkConfig), nil + return obj.(*v2alpha1.DingTalkConfig), nil } diff --git a/pkg/client/listers/notification/v2/dingtalkreceiver.go b/pkg/client/listers/notification/v2alpha1/dingtalkreceiver.go similarity index 76% rename from pkg/client/listers/notification/v2/dingtalkreceiver.go rename to pkg/client/listers/notification/v2alpha1/dingtalkreceiver.go index da88dc5f5..7019aeb46 100644 --- a/pkg/client/listers/notification/v2/dingtalkreceiver.go +++ b/pkg/client/listers/notification/v2alpha1/dingtalkreceiver.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // DingTalkReceiverLister helps list DingTalkReceivers. type DingTalkReceiverLister interface { // List lists all DingTalkReceivers in the indexer. - List(selector labels.Selector) (ret []*v2.DingTalkReceiver, err error) + List(selector labels.Selector) (ret []*v2alpha1.DingTalkReceiver, err error) // Get retrieves the DingTalkReceiver from the index for a given name. - Get(name string) (*v2.DingTalkReceiver, error) + Get(name string) (*v2alpha1.DingTalkReceiver, error) DingTalkReceiverListerExpansion } @@ -45,21 +45,21 @@ func NewDingTalkReceiverLister(indexer cache.Indexer) DingTalkReceiverLister { } // List lists all DingTalkReceivers in the indexer. -func (s *dingTalkReceiverLister) List(selector labels.Selector) (ret []*v2.DingTalkReceiver, err error) { +func (s *dingTalkReceiverLister) List(selector labels.Selector) (ret []*v2alpha1.DingTalkReceiver, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.DingTalkReceiver)) + ret = append(ret, m.(*v2alpha1.DingTalkReceiver)) }) return ret, err } // Get retrieves the DingTalkReceiver from the index for a given name. -func (s *dingTalkReceiverLister) Get(name string) (*v2.DingTalkReceiver, error) { +func (s *dingTalkReceiverLister) Get(name string) (*v2alpha1.DingTalkReceiver, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("dingtalkreceiver"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("dingtalkreceiver"), name) } - return obj.(*v2.DingTalkReceiver), nil + return obj.(*v2alpha1.DingTalkReceiver), nil } diff --git a/pkg/client/listers/notification/v2/emailconfig.go b/pkg/client/listers/notification/v2alpha1/emailconfig.go similarity index 77% rename from pkg/client/listers/notification/v2/emailconfig.go rename to pkg/client/listers/notification/v2alpha1/emailconfig.go index c0025b95c..7894a2431 100644 --- a/pkg/client/listers/notification/v2/emailconfig.go +++ b/pkg/client/listers/notification/v2alpha1/emailconfig.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // EmailConfigLister helps list EmailConfigs. type EmailConfigLister interface { // List lists all EmailConfigs in the indexer. - List(selector labels.Selector) (ret []*v2.EmailConfig, err error) + List(selector labels.Selector) (ret []*v2alpha1.EmailConfig, err error) // Get retrieves the EmailConfig from the index for a given name. - Get(name string) (*v2.EmailConfig, error) + Get(name string) (*v2alpha1.EmailConfig, error) EmailConfigListerExpansion } @@ -45,21 +45,21 @@ func NewEmailConfigLister(indexer cache.Indexer) EmailConfigLister { } // List lists all EmailConfigs in the indexer. -func (s *emailConfigLister) List(selector labels.Selector) (ret []*v2.EmailConfig, err error) { +func (s *emailConfigLister) List(selector labels.Selector) (ret []*v2alpha1.EmailConfig, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.EmailConfig)) + ret = append(ret, m.(*v2alpha1.EmailConfig)) }) return ret, err } // Get retrieves the EmailConfig from the index for a given name. -func (s *emailConfigLister) Get(name string) (*v2.EmailConfig, error) { +func (s *emailConfigLister) Get(name string) (*v2alpha1.EmailConfig, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("emailconfig"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("emailconfig"), name) } - return obj.(*v2.EmailConfig), nil + return obj.(*v2alpha1.EmailConfig), nil } diff --git a/pkg/client/listers/notification/v2/emailreceiver.go b/pkg/client/listers/notification/v2alpha1/emailreceiver.go similarity index 76% rename from pkg/client/listers/notification/v2/emailreceiver.go rename to pkg/client/listers/notification/v2alpha1/emailreceiver.go index c5d4ed0f8..d5d01e124 100644 --- a/pkg/client/listers/notification/v2/emailreceiver.go +++ b/pkg/client/listers/notification/v2alpha1/emailreceiver.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // EmailReceiverLister helps list EmailReceivers. type EmailReceiverLister interface { // List lists all EmailReceivers in the indexer. - List(selector labels.Selector) (ret []*v2.EmailReceiver, err error) + List(selector labels.Selector) (ret []*v2alpha1.EmailReceiver, err error) // Get retrieves the EmailReceiver from the index for a given name. - Get(name string) (*v2.EmailReceiver, error) + Get(name string) (*v2alpha1.EmailReceiver, error) EmailReceiverListerExpansion } @@ -45,21 +45,21 @@ func NewEmailReceiverLister(indexer cache.Indexer) EmailReceiverLister { } // List lists all EmailReceivers in the indexer. -func (s *emailReceiverLister) List(selector labels.Selector) (ret []*v2.EmailReceiver, err error) { +func (s *emailReceiverLister) List(selector labels.Selector) (ret []*v2alpha1.EmailReceiver, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.EmailReceiver)) + ret = append(ret, m.(*v2alpha1.EmailReceiver)) }) return ret, err } // Get retrieves the EmailReceiver from the index for a given name. -func (s *emailReceiverLister) Get(name string) (*v2.EmailReceiver, error) { +func (s *emailReceiverLister) Get(name string) (*v2alpha1.EmailReceiver, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("emailreceiver"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("emailreceiver"), name) } - return obj.(*v2.EmailReceiver), nil + return obj.(*v2alpha1.EmailReceiver), nil } diff --git a/pkg/client/listers/notification/v2/expansion_generated.go b/pkg/client/listers/notification/v2alpha1/expansion_generated.go similarity index 99% rename from pkg/client/listers/notification/v2/expansion_generated.go rename to pkg/client/listers/notification/v2alpha1/expansion_generated.go index fb646dbc1..5d736045e 100644 --- a/pkg/client/listers/notification/v2/expansion_generated.go +++ b/pkg/client/listers/notification/v2alpha1/expansion_generated.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 // DingTalkConfigListerExpansion allows custom methods to be added to // DingTalkConfigLister. diff --git a/pkg/client/listers/notification/v2/slackconfig.go b/pkg/client/listers/notification/v2alpha1/slackconfig.go similarity index 77% rename from pkg/client/listers/notification/v2/slackconfig.go rename to pkg/client/listers/notification/v2alpha1/slackconfig.go index 77981346f..3509986ab 100644 --- a/pkg/client/listers/notification/v2/slackconfig.go +++ b/pkg/client/listers/notification/v2alpha1/slackconfig.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // SlackConfigLister helps list SlackConfigs. type SlackConfigLister interface { // List lists all SlackConfigs in the indexer. - List(selector labels.Selector) (ret []*v2.SlackConfig, err error) + List(selector labels.Selector) (ret []*v2alpha1.SlackConfig, err error) // Get retrieves the SlackConfig from the index for a given name. - Get(name string) (*v2.SlackConfig, error) + Get(name string) (*v2alpha1.SlackConfig, error) SlackConfigListerExpansion } @@ -45,21 +45,21 @@ func NewSlackConfigLister(indexer cache.Indexer) SlackConfigLister { } // List lists all SlackConfigs in the indexer. -func (s *slackConfigLister) List(selector labels.Selector) (ret []*v2.SlackConfig, err error) { +func (s *slackConfigLister) List(selector labels.Selector) (ret []*v2alpha1.SlackConfig, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.SlackConfig)) + ret = append(ret, m.(*v2alpha1.SlackConfig)) }) return ret, err } // Get retrieves the SlackConfig from the index for a given name. -func (s *slackConfigLister) Get(name string) (*v2.SlackConfig, error) { +func (s *slackConfigLister) Get(name string) (*v2alpha1.SlackConfig, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("slackconfig"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("slackconfig"), name) } - return obj.(*v2.SlackConfig), nil + return obj.(*v2alpha1.SlackConfig), nil } diff --git a/pkg/client/listers/notification/v2/slackreceiver.go b/pkg/client/listers/notification/v2alpha1/slackreceiver.go similarity index 76% rename from pkg/client/listers/notification/v2/slackreceiver.go rename to pkg/client/listers/notification/v2alpha1/slackreceiver.go index 90906b682..ff46ab040 100644 --- a/pkg/client/listers/notification/v2/slackreceiver.go +++ b/pkg/client/listers/notification/v2alpha1/slackreceiver.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // SlackReceiverLister helps list SlackReceivers. type SlackReceiverLister interface { // List lists all SlackReceivers in the indexer. - List(selector labels.Selector) (ret []*v2.SlackReceiver, err error) + List(selector labels.Selector) (ret []*v2alpha1.SlackReceiver, err error) // Get retrieves the SlackReceiver from the index for a given name. - Get(name string) (*v2.SlackReceiver, error) + Get(name string) (*v2alpha1.SlackReceiver, error) SlackReceiverListerExpansion } @@ -45,21 +45,21 @@ func NewSlackReceiverLister(indexer cache.Indexer) SlackReceiverLister { } // List lists all SlackReceivers in the indexer. -func (s *slackReceiverLister) List(selector labels.Selector) (ret []*v2.SlackReceiver, err error) { +func (s *slackReceiverLister) List(selector labels.Selector) (ret []*v2alpha1.SlackReceiver, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.SlackReceiver)) + ret = append(ret, m.(*v2alpha1.SlackReceiver)) }) return ret, err } // Get retrieves the SlackReceiver from the index for a given name. -func (s *slackReceiverLister) Get(name string) (*v2.SlackReceiver, error) { +func (s *slackReceiverLister) Get(name string) (*v2alpha1.SlackReceiver, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("slackreceiver"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("slackreceiver"), name) } - return obj.(*v2.SlackReceiver), nil + return obj.(*v2alpha1.SlackReceiver), nil } diff --git a/pkg/client/listers/notification/v2/webhookconfig.go b/pkg/client/listers/notification/v2alpha1/webhookconfig.go similarity index 76% rename from pkg/client/listers/notification/v2/webhookconfig.go rename to pkg/client/listers/notification/v2alpha1/webhookconfig.go index 41470f642..8e87599da 100644 --- a/pkg/client/listers/notification/v2/webhookconfig.go +++ b/pkg/client/listers/notification/v2alpha1/webhookconfig.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // WebhookConfigLister helps list WebhookConfigs. type WebhookConfigLister interface { // List lists all WebhookConfigs in the indexer. - List(selector labels.Selector) (ret []*v2.WebhookConfig, err error) + List(selector labels.Selector) (ret []*v2alpha1.WebhookConfig, err error) // Get retrieves the WebhookConfig from the index for a given name. - Get(name string) (*v2.WebhookConfig, error) + Get(name string) (*v2alpha1.WebhookConfig, error) WebhookConfigListerExpansion } @@ -45,21 +45,21 @@ func NewWebhookConfigLister(indexer cache.Indexer) WebhookConfigLister { } // List lists all WebhookConfigs in the indexer. -func (s *webhookConfigLister) List(selector labels.Selector) (ret []*v2.WebhookConfig, err error) { +func (s *webhookConfigLister) List(selector labels.Selector) (ret []*v2alpha1.WebhookConfig, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.WebhookConfig)) + ret = append(ret, m.(*v2alpha1.WebhookConfig)) }) return ret, err } // Get retrieves the WebhookConfig from the index for a given name. -func (s *webhookConfigLister) Get(name string) (*v2.WebhookConfig, error) { +func (s *webhookConfigLister) Get(name string) (*v2alpha1.WebhookConfig, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("webhookconfig"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("webhookconfig"), name) } - return obj.(*v2.WebhookConfig), nil + return obj.(*v2alpha1.WebhookConfig), nil } diff --git a/pkg/client/listers/notification/v2/webhookreceiver.go b/pkg/client/listers/notification/v2alpha1/webhookreceiver.go similarity index 76% rename from pkg/client/listers/notification/v2/webhookreceiver.go rename to pkg/client/listers/notification/v2alpha1/webhookreceiver.go index 07359add3..2a207cfb3 100644 --- a/pkg/client/listers/notification/v2/webhookreceiver.go +++ b/pkg/client/listers/notification/v2alpha1/webhookreceiver.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // WebhookReceiverLister helps list WebhookReceivers. type WebhookReceiverLister interface { // List lists all WebhookReceivers in the indexer. - List(selector labels.Selector) (ret []*v2.WebhookReceiver, err error) + List(selector labels.Selector) (ret []*v2alpha1.WebhookReceiver, err error) // Get retrieves the WebhookReceiver from the index for a given name. - Get(name string) (*v2.WebhookReceiver, error) + Get(name string) (*v2alpha1.WebhookReceiver, error) WebhookReceiverListerExpansion } @@ -45,21 +45,21 @@ func NewWebhookReceiverLister(indexer cache.Indexer) WebhookReceiverLister { } // List lists all WebhookReceivers in the indexer. -func (s *webhookReceiverLister) List(selector labels.Selector) (ret []*v2.WebhookReceiver, err error) { +func (s *webhookReceiverLister) List(selector labels.Selector) (ret []*v2alpha1.WebhookReceiver, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.WebhookReceiver)) + ret = append(ret, m.(*v2alpha1.WebhookReceiver)) }) return ret, err } // Get retrieves the WebhookReceiver from the index for a given name. -func (s *webhookReceiverLister) Get(name string) (*v2.WebhookReceiver, error) { +func (s *webhookReceiverLister) Get(name string) (*v2alpha1.WebhookReceiver, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("webhookreceiver"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("webhookreceiver"), name) } - return obj.(*v2.WebhookReceiver), nil + return obj.(*v2alpha1.WebhookReceiver), nil } diff --git a/pkg/client/listers/notification/v2/wechatconfig.go b/pkg/client/listers/notification/v2alpha1/wechatconfig.go similarity index 76% rename from pkg/client/listers/notification/v2/wechatconfig.go rename to pkg/client/listers/notification/v2alpha1/wechatconfig.go index ccccb4716..431a36631 100644 --- a/pkg/client/listers/notification/v2/wechatconfig.go +++ b/pkg/client/listers/notification/v2alpha1/wechatconfig.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // WechatConfigLister helps list WechatConfigs. type WechatConfigLister interface { // List lists all WechatConfigs in the indexer. - List(selector labels.Selector) (ret []*v2.WechatConfig, err error) + List(selector labels.Selector) (ret []*v2alpha1.WechatConfig, err error) // Get retrieves the WechatConfig from the index for a given name. - Get(name string) (*v2.WechatConfig, error) + Get(name string) (*v2alpha1.WechatConfig, error) WechatConfigListerExpansion } @@ -45,21 +45,21 @@ func NewWechatConfigLister(indexer cache.Indexer) WechatConfigLister { } // List lists all WechatConfigs in the indexer. -func (s *wechatConfigLister) List(selector labels.Selector) (ret []*v2.WechatConfig, err error) { +func (s *wechatConfigLister) List(selector labels.Selector) (ret []*v2alpha1.WechatConfig, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.WechatConfig)) + ret = append(ret, m.(*v2alpha1.WechatConfig)) }) return ret, err } // Get retrieves the WechatConfig from the index for a given name. -func (s *wechatConfigLister) Get(name string) (*v2.WechatConfig, error) { +func (s *wechatConfigLister) Get(name string) (*v2alpha1.WechatConfig, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("wechatconfig"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("wechatconfig"), name) } - return obj.(*v2.WechatConfig), nil + return obj.(*v2alpha1.WechatConfig), nil } diff --git a/pkg/client/listers/notification/v2/wechatreceiver.go b/pkg/client/listers/notification/v2alpha1/wechatreceiver.go similarity index 76% rename from pkg/client/listers/notification/v2/wechatreceiver.go rename to pkg/client/listers/notification/v2alpha1/wechatreceiver.go index 14b15669a..9365e2f21 100644 --- a/pkg/client/listers/notification/v2/wechatreceiver.go +++ b/pkg/client/listers/notification/v2alpha1/wechatreceiver.go @@ -16,21 +16,21 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v2 +package v2alpha1 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" ) // WechatReceiverLister helps list WechatReceivers. type WechatReceiverLister interface { // List lists all WechatReceivers in the indexer. - List(selector labels.Selector) (ret []*v2.WechatReceiver, err error) + List(selector labels.Selector) (ret []*v2alpha1.WechatReceiver, err error) // Get retrieves the WechatReceiver from the index for a given name. - Get(name string) (*v2.WechatReceiver, error) + Get(name string) (*v2alpha1.WechatReceiver, error) WechatReceiverListerExpansion } @@ -45,21 +45,21 @@ func NewWechatReceiverLister(indexer cache.Indexer) WechatReceiverLister { } // List lists all WechatReceivers in the indexer. -func (s *wechatReceiverLister) List(selector labels.Selector) (ret []*v2.WechatReceiver, err error) { +func (s *wechatReceiverLister) List(selector labels.Selector) (ret []*v2alpha1.WechatReceiver, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.WechatReceiver)) + ret = append(ret, m.(*v2alpha1.WechatReceiver)) }) return ret, err } // Get retrieves the WechatReceiver from the index for a given name. -func (s *wechatReceiverLister) Get(name string) (*v2.WechatReceiver, error) { +func (s *wechatReceiverLister) Get(name string) (*v2alpha1.WechatReceiver, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v2.Resource("wechatreceiver"), name) + return nil, errors.NewNotFound(v2alpha1.Resource("wechatreceiver"), name) } - return obj.(*v2.WechatReceiver), nil + return obj.(*v2alpha1.WechatReceiver), nil } diff --git a/pkg/controller/notification/notification_controller.go b/pkg/controller/notification/notification_controller.go index fee776747..afef76589 100644 --- a/pkg/controller/notification/notification_controller.go +++ b/pkg/controller/notification/notification_controller.go @@ -33,7 +33,7 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" "k8s.io/klog" - "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" "kubesphere.io/kubesphere/pkg/apis/types/v1beta1" "kubesphere.io/kubesphere/pkg/constants" "reflect" @@ -95,16 +95,16 @@ func (c *Controller) setEventHandlers() error { if c.reconciledObjs != nil && len(c.reconciledObjs) > 0 { c.reconciledObjs = c.reconciledObjs[:0] } - c.reconciledObjs = append(c.reconciledObjs, &v2.DingTalkConfig{}) - c.reconciledObjs = append(c.reconciledObjs, &v2.DingTalkReceiver{}) - c.reconciledObjs = append(c.reconciledObjs, &v2.EmailConfig{}) - c.reconciledObjs = append(c.reconciledObjs, &v2.EmailReceiver{}) - c.reconciledObjs = append(c.reconciledObjs, &v2.SlackConfig{}) - c.reconciledObjs = append(c.reconciledObjs, &v2.SlackReceiver{}) - c.reconciledObjs = append(c.reconciledObjs, &v2.WebhookConfig{}) - c.reconciledObjs = append(c.reconciledObjs, &v2.WebhookReceiver{}) - c.reconciledObjs = append(c.reconciledObjs, &v2.WechatConfig{}) - c.reconciledObjs = append(c.reconciledObjs, &v2.WechatReceiver{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.DingTalkConfig{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.DingTalkReceiver{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.EmailConfig{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.EmailReceiver{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.SlackConfig{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.SlackReceiver{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.WebhookConfig{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.WebhookReceiver{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.WechatConfig{}) + c.reconciledObjs = append(c.reconciledObjs, &v2alpha1.WechatReceiver{}) c.reconciledObjs = append(c.reconciledObjs, &corev1.Secret{}) if c.informerSynced != nil && len(c.informerSynced) > 0 { @@ -269,26 +269,26 @@ func (c *Controller) multiClusterSync(ctx context.Context, obj runtime.Object) e } switch obj.(type) { - case *v2.DingTalkConfig: - return c.syncFederatedDingTalkConfig(obj.(*v2.DingTalkConfig)) - case *v2.DingTalkReceiver: - return c.syncFederatedDingTalkReceiver(obj.(*v2.DingTalkReceiver)) - case *v2.EmailConfig: - return c.syncFederatedEmailConfig(obj.(*v2.EmailConfig)) - case *v2.EmailReceiver: - return c.syncFederatedEmailReceiver(obj.(*v2.EmailReceiver)) - case *v2.SlackConfig: - return c.syncFederatedSlackConfig(obj.(*v2.SlackConfig)) - case *v2.SlackReceiver: - return c.syncFederatedSlackReceiver(obj.(*v2.SlackReceiver)) - case *v2.WebhookConfig: - return c.syncFederatedWebhookConfig(obj.(*v2.WebhookConfig)) - case *v2.WebhookReceiver: - return c.syncFederatedWebhookReceiver(obj.(*v2.WebhookReceiver)) - case *v2.WechatConfig: - return c.syncFederatedWechatConfig(obj.(*v2.WechatConfig)) - case *v2.WechatReceiver: - return c.syncFederatedWechatReceiver(obj.(*v2.WechatReceiver)) + case *v2alpha1.DingTalkConfig: + return c.syncFederatedDingTalkConfig(obj.(*v2alpha1.DingTalkConfig)) + case *v2alpha1.DingTalkReceiver: + return c.syncFederatedDingTalkReceiver(obj.(*v2alpha1.DingTalkReceiver)) + case *v2alpha1.EmailConfig: + return c.syncFederatedEmailConfig(obj.(*v2alpha1.EmailConfig)) + case *v2alpha1.EmailReceiver: + return c.syncFederatedEmailReceiver(obj.(*v2alpha1.EmailReceiver)) + case *v2alpha1.SlackConfig: + return c.syncFederatedSlackConfig(obj.(*v2alpha1.SlackConfig)) + case *v2alpha1.SlackReceiver: + return c.syncFederatedSlackReceiver(obj.(*v2alpha1.SlackReceiver)) + case *v2alpha1.WebhookConfig: + return c.syncFederatedWebhookConfig(obj.(*v2alpha1.WebhookConfig)) + case *v2alpha1.WebhookReceiver: + return c.syncFederatedWebhookReceiver(obj.(*v2alpha1.WebhookReceiver)) + case *v2alpha1.WechatConfig: + return c.syncFederatedWechatConfig(obj.(*v2alpha1.WechatConfig)) + case *v2alpha1.WechatReceiver: + return c.syncFederatedWechatReceiver(obj.(*v2alpha1.WechatReceiver)) case *corev1.Secret: return c.syncFederatedSecret(obj.(*corev1.Secret)) default: @@ -297,7 +297,7 @@ func (c *Controller) multiClusterSync(ctx context.Context, obj runtime.Object) e } } -func (c *Controller) syncFederatedDingTalkConfig(obj *v2.DingTalkConfig) error { +func (c *Controller) syncFederatedDingTalkConfig(obj *v2alpha1.DingTalkConfig) error { fedObj := &v1beta1.FederatedDingTalkConfig{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) @@ -353,7 +353,7 @@ func (c *Controller) syncFederatedDingTalkConfig(obj *v2.DingTalkConfig) error { return nil } -func (c *Controller) syncFederatedDingTalkReceiver(obj *v2.DingTalkReceiver) error { +func (c *Controller) syncFederatedDingTalkReceiver(obj *v2alpha1.DingTalkReceiver) error { fedObj := &v1beta1.FederatedDingTalkReceiver{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) @@ -409,7 +409,7 @@ func (c *Controller) syncFederatedDingTalkReceiver(obj *v2.DingTalkReceiver) err return nil } -func (c *Controller) syncFederatedEmailConfig(obj *v2.EmailConfig) error { +func (c *Controller) syncFederatedEmailConfig(obj *v2alpha1.EmailConfig) error { fedObj := &v1beta1.FederatedEmailConfig{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) @@ -465,7 +465,7 @@ func (c *Controller) syncFederatedEmailConfig(obj *v2.EmailConfig) error { return nil } -func (c *Controller) syncFederatedEmailReceiver(obj *v2.EmailReceiver) error { +func (c *Controller) syncFederatedEmailReceiver(obj *v2alpha1.EmailReceiver) error { fedObj := &v1beta1.FederatedEmailReceiver{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) @@ -521,7 +521,7 @@ func (c *Controller) syncFederatedEmailReceiver(obj *v2.EmailReceiver) error { return nil } -func (c *Controller) syncFederatedSlackConfig(obj *v2.SlackConfig) error { +func (c *Controller) syncFederatedSlackConfig(obj *v2alpha1.SlackConfig) error { fedObj := &v1beta1.FederatedSlackConfig{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) @@ -577,7 +577,7 @@ func (c *Controller) syncFederatedSlackConfig(obj *v2.SlackConfig) error { return nil } -func (c *Controller) syncFederatedSlackReceiver(obj *v2.SlackReceiver) error { +func (c *Controller) syncFederatedSlackReceiver(obj *v2alpha1.SlackReceiver) error { fedObj := &v1beta1.FederatedSlackReceiver{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) @@ -633,7 +633,7 @@ func (c *Controller) syncFederatedSlackReceiver(obj *v2.SlackReceiver) error { return nil } -func (c *Controller) syncFederatedWebhookConfig(obj *v2.WebhookConfig) error { +func (c *Controller) syncFederatedWebhookConfig(obj *v2alpha1.WebhookConfig) error { fedObj := &v1beta1.FederatedWebhookConfig{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) @@ -689,7 +689,7 @@ func (c *Controller) syncFederatedWebhookConfig(obj *v2.WebhookConfig) error { return nil } -func (c *Controller) syncFederatedWebhookReceiver(obj *v2.WebhookReceiver) error { +func (c *Controller) syncFederatedWebhookReceiver(obj *v2alpha1.WebhookReceiver) error { fedObj := &v1beta1.FederatedWebhookReceiver{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) @@ -745,7 +745,7 @@ func (c *Controller) syncFederatedWebhookReceiver(obj *v2.WebhookReceiver) error return nil } -func (c *Controller) syncFederatedWechatConfig(obj *v2.WechatConfig) error { +func (c *Controller) syncFederatedWechatConfig(obj *v2alpha1.WechatConfig) error { fedObj := &v1beta1.FederatedWechatConfig{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) @@ -801,7 +801,7 @@ func (c *Controller) syncFederatedWechatConfig(obj *v2.WechatConfig) error { return nil } -func (c *Controller) syncFederatedWechatReceiver(obj *v2.WechatReceiver) error { +func (c *Controller) syncFederatedWechatReceiver(obj *v2alpha1.WechatReceiver) error { fedObj := &v1beta1.FederatedWechatReceiver{} err := c.Get(context.Background(), client.ObjectKey{Name: obj.Name}, fedObj) diff --git a/pkg/controller/notification/notification_controller_suite_test.go b/pkg/controller/notification/notification_controller_suite_test.go index 0a2d23362..3ddba360f 100644 --- a/pkg/controller/notification/notification_controller_suite_test.go +++ b/pkg/controller/notification/notification_controller_suite_test.go @@ -20,7 +20,7 @@ import ( "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/scheme" "kubesphere.io/kubesphere/pkg/apis" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" "path/filepath" "testing" @@ -53,7 +53,7 @@ var _ = BeforeSuite(func(done Done) { Expect(err).NotTo(HaveOccurred()) Expect(cfg).ToNot(BeNil()) - err = v2.AddToScheme(scheme.Scheme) + err = v2alpha1.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred()) err = apis.AddToScheme(scheme.Scheme) diff --git a/pkg/controller/notification/notification_controller_test.go b/pkg/controller/notification/notification_controller_test.go index 1dcb06331..4bc0a1d9c 100644 --- a/pkg/controller/notification/notification_controller_test.go +++ b/pkg/controller/notification/notification_controller_test.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" "kubesphere.io/kubesphere/pkg/apis/types/v1beta1" "kubesphere.io/kubesphere/pkg/constants" "sigs.k8s.io/controller-runtime/pkg/cache" @@ -126,7 +126,7 @@ var ( const timeout = time.Second * 30 const interval = time.Second * 1 - obj := &v2.DingTalkConfig{ + obj := &v2alpha1.DingTalkConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: constants.NotificationSecretNamespace, diff --git a/pkg/models/notification/notification.go b/pkg/models/notification/notification.go index 42ed9bdda..807389f4f 100644 --- a/pkg/models/notification/notification.go +++ b/pkg/models/notification/notification.go @@ -11,7 +11,7 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/klog" "kubesphere.io/kubesphere/pkg/api" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + v2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" "kubesphere.io/kubesphere/pkg/apiserver/query" kubesphere "kubesphere.io/kubesphere/pkg/client/clientset/versioned" "kubesphere.io/kubesphere/pkg/constants" @@ -100,26 +100,26 @@ func (o *operator) Create(user, resource string, obj runtime.Object) (runtime.Ob } switch resource { - case v2.ResourcesPluralDingTalkConfig: - return o.ksClient.NotificationV2().DingTalkConfigs().Create(context.Background(), obj.(*v2.DingTalkConfig), v1.CreateOptions{}) - case v2.ResourcesPluralDingTalkReceiver: - return o.ksClient.NotificationV2().DingTalkReceivers().Create(context.Background(), obj.(*v2.DingTalkReceiver), v1.CreateOptions{}) - case v2.ResourcesPluralEmailConfig: - return o.ksClient.NotificationV2().EmailConfigs().Create(context.Background(), obj.(*v2.EmailConfig), v1.CreateOptions{}) - case v2.ResourcesPluralEmailReceiver: - return o.ksClient.NotificationV2().EmailReceivers().Create(context.Background(), obj.(*v2.EmailReceiver), v1.CreateOptions{}) - case v2.ResourcesPluralSlackConfig: - return o.ksClient.NotificationV2().SlackConfigs().Create(context.Background(), obj.(*v2.SlackConfig), v1.CreateOptions{}) - case v2.ResourcesPluralSlackReceiver: - return o.ksClient.NotificationV2().SlackReceivers().Create(context.Background(), obj.(*v2.SlackReceiver), v1.CreateOptions{}) - case v2.ResourcesPluralWebhookConfig: - return o.ksClient.NotificationV2().WebhookConfigs().Create(context.Background(), obj.(*v2.WebhookConfig), v1.CreateOptions{}) - case v2.ResourcesPluralWebhookReceiver: - return o.ksClient.NotificationV2().WebhookReceivers().Create(context.Background(), obj.(*v2.WebhookReceiver), v1.CreateOptions{}) - case v2.ResourcesPluralWechatConfig: - return o.ksClient.NotificationV2().WechatConfigs().Create(context.Background(), obj.(*v2.WechatConfig), v1.CreateOptions{}) - case v2.ResourcesPluralWechatReceiver: - return o.ksClient.NotificationV2().WechatReceivers().Create(context.Background(), obj.(*v2.WechatReceiver), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralDingTalkConfig: + return o.ksClient.NotificationV2alpha1().DingTalkConfigs().Create(context.Background(), obj.(*v2alpha1.DingTalkConfig), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralDingTalkReceiver: + return o.ksClient.NotificationV2alpha1().DingTalkReceivers().Create(context.Background(), obj.(*v2alpha1.DingTalkReceiver), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralEmailConfig: + return o.ksClient.NotificationV2alpha1().EmailConfigs().Create(context.Background(), obj.(*v2alpha1.EmailConfig), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralEmailReceiver: + return o.ksClient.NotificationV2alpha1().EmailReceivers().Create(context.Background(), obj.(*v2alpha1.EmailReceiver), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralSlackConfig: + return o.ksClient.NotificationV2alpha1().SlackConfigs().Create(context.Background(), obj.(*v2alpha1.SlackConfig), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralSlackReceiver: + return o.ksClient.NotificationV2alpha1().SlackReceivers().Create(context.Background(), obj.(*v2alpha1.SlackReceiver), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralWebhookConfig: + return o.ksClient.NotificationV2alpha1().WebhookConfigs().Create(context.Background(), obj.(*v2alpha1.WebhookConfig), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralWebhookReceiver: + return o.ksClient.NotificationV2alpha1().WebhookReceivers().Create(context.Background(), obj.(*v2alpha1.WebhookReceiver), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralWechatConfig: + return o.ksClient.NotificationV2alpha1().WechatConfigs().Create(context.Background(), obj.(*v2alpha1.WechatConfig), v1.CreateOptions{}) + case v2alpha1.ResourcesPluralWechatReceiver: + return o.ksClient.NotificationV2alpha1().WechatReceivers().Create(context.Background(), obj.(*v2alpha1.WechatReceiver), v1.CreateOptions{}) case "secrets": return o.k8sClient.CoreV1().Secrets(constants.NotificationSecretNamespace).Create(context.Background(), obj.(*corev1.Secret), v1.CreateOptions{}) default: @@ -140,26 +140,26 @@ func (o *operator) Delete(user, resource, name string) error { } switch resource { - case v2.ResourcesPluralDingTalkConfig: - return o.ksClient.NotificationV2().DingTalkConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) - case v2.ResourcesPluralDingTalkReceiver: - return o.ksClient.NotificationV2().DingTalkReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) - case v2.ResourcesPluralEmailConfig: - return o.ksClient.NotificationV2().EmailConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) - case v2.ResourcesPluralEmailReceiver: - return o.ksClient.NotificationV2().EmailReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) - case v2.ResourcesPluralSlackConfig: - return o.ksClient.NotificationV2().SlackConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) - case v2.ResourcesPluralSlackReceiver: - return o.ksClient.NotificationV2().SlackReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) - case v2.ResourcesPluralWebhookConfig: - return o.ksClient.NotificationV2().WebhookConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) - case v2.ResourcesPluralWebhookReceiver: - return o.ksClient.NotificationV2().WebhookReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) - case v2.ResourcesPluralWechatConfig: - return o.ksClient.NotificationV2().WechatConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) - case v2.ResourcesPluralWechatReceiver: - return o.ksClient.NotificationV2().WechatReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralDingTalkConfig: + return o.ksClient.NotificationV2alpha1().DingTalkConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralDingTalkReceiver: + return o.ksClient.NotificationV2alpha1().DingTalkReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralEmailConfig: + return o.ksClient.NotificationV2alpha1().EmailConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralEmailReceiver: + return o.ksClient.NotificationV2alpha1().EmailReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralSlackConfig: + return o.ksClient.NotificationV2alpha1().SlackConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralSlackReceiver: + return o.ksClient.NotificationV2alpha1().SlackReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralWebhookConfig: + return o.ksClient.NotificationV2alpha1().WebhookConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralWebhookReceiver: + return o.ksClient.NotificationV2alpha1().WebhookReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralWechatConfig: + return o.ksClient.NotificationV2alpha1().WechatConfigs().Delete(context.Background(), name, v1.DeleteOptions{}) + case v2alpha1.ResourcesPluralWechatReceiver: + return o.ksClient.NotificationV2alpha1().WechatReceivers().Delete(context.Background(), name, v1.DeleteOptions{}) case "secrets": return o.k8sClient.CoreV1().Secrets(constants.NotificationSecretNamespace).Delete(context.Background(), name, v1.DeleteOptions{}) default: @@ -184,26 +184,26 @@ func (o *operator) Update(user, resource, name string, obj runtime.Object) (runt } switch resource { - case v2.ResourcesPluralDingTalkConfig: - return o.ksClient.NotificationV2().DingTalkConfigs().Update(context.Background(), obj.(*v2.DingTalkConfig), v1.UpdateOptions{}) - case v2.ResourcesPluralDingTalkReceiver: - return o.ksClient.NotificationV2().DingTalkReceivers().Update(context.Background(), obj.(*v2.DingTalkReceiver), v1.UpdateOptions{}) - case v2.ResourcesPluralEmailConfig: - return o.ksClient.NotificationV2().EmailConfigs().Update(context.Background(), obj.(*v2.EmailConfig), v1.UpdateOptions{}) - case v2.ResourcesPluralEmailReceiver: - return o.ksClient.NotificationV2().EmailReceivers().Update(context.Background(), obj.(*v2.EmailReceiver), v1.UpdateOptions{}) - case v2.ResourcesPluralSlackConfig: - return o.ksClient.NotificationV2().SlackConfigs().Update(context.Background(), obj.(*v2.SlackConfig), v1.UpdateOptions{}) - case v2.ResourcesPluralSlackReceiver: - return o.ksClient.NotificationV2().SlackReceivers().Update(context.Background(), obj.(*v2.SlackReceiver), v1.UpdateOptions{}) - case v2.ResourcesPluralWebhookConfig: - return o.ksClient.NotificationV2().WebhookConfigs().Update(context.Background(), obj.(*v2.WebhookConfig), v1.UpdateOptions{}) - case v2.ResourcesPluralWebhookReceiver: - return o.ksClient.NotificationV2().WebhookReceivers().Update(context.Background(), obj.(*v2.WebhookReceiver), v1.UpdateOptions{}) - case v2.ResourcesPluralWechatConfig: - return o.ksClient.NotificationV2().WechatConfigs().Update(context.Background(), obj.(*v2.WechatConfig), v1.UpdateOptions{}) - case v2.ResourcesPluralWechatReceiver: - return o.ksClient.NotificationV2().WechatReceivers().Update(context.Background(), obj.(*v2.WechatReceiver), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralDingTalkConfig: + return o.ksClient.NotificationV2alpha1().DingTalkConfigs().Update(context.Background(), obj.(*v2alpha1.DingTalkConfig), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralDingTalkReceiver: + return o.ksClient.NotificationV2alpha1().DingTalkReceivers().Update(context.Background(), obj.(*v2alpha1.DingTalkReceiver), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralEmailConfig: + return o.ksClient.NotificationV2alpha1().EmailConfigs().Update(context.Background(), obj.(*v2alpha1.EmailConfig), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralEmailReceiver: + return o.ksClient.NotificationV2alpha1().EmailReceivers().Update(context.Background(), obj.(*v2alpha1.EmailReceiver), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralSlackConfig: + return o.ksClient.NotificationV2alpha1().SlackConfigs().Update(context.Background(), obj.(*v2alpha1.SlackConfig), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralSlackReceiver: + return o.ksClient.NotificationV2alpha1().SlackReceivers().Update(context.Background(), obj.(*v2alpha1.SlackReceiver), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralWebhookConfig: + return o.ksClient.NotificationV2alpha1().WebhookConfigs().Update(context.Background(), obj.(*v2alpha1.WebhookConfig), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralWebhookReceiver: + return o.ksClient.NotificationV2alpha1().WebhookReceivers().Update(context.Background(), obj.(*v2alpha1.WebhookReceiver), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralWechatConfig: + return o.ksClient.NotificationV2alpha1().WechatConfigs().Update(context.Background(), obj.(*v2alpha1.WechatConfig), v1.UpdateOptions{}) + case v2alpha1.ResourcesPluralWechatReceiver: + return o.ksClient.NotificationV2alpha1().WechatReceivers().Update(context.Background(), obj.(*v2alpha1.WechatReceiver), v1.UpdateOptions{}) case "secrets": return o.k8sClient.CoreV1().Secrets(constants.NotificationSecretNamespace).Update(context.Background(), obj.(*corev1.Secret), v1.UpdateOptions{}) default: @@ -214,26 +214,26 @@ func (o *operator) Update(user, resource, name string, obj runtime.Object) (runt func (o *operator) GetObject(resource string) runtime.Object { switch resource { - case v2.ResourcesPluralDingTalkConfig: - return &v2.DingTalkConfig{} - case v2.ResourcesPluralDingTalkReceiver: - return &v2.DingTalkReceiver{} - case v2.ResourcesPluralEmailConfig: - return &v2.EmailConfig{} - case v2.ResourcesPluralEmailReceiver: - return &v2.EmailReceiver{} - case v2.ResourcesPluralSlackConfig: - return &v2.SlackConfig{} - case v2.ResourcesPluralSlackReceiver: - return &v2.SlackReceiver{} - case v2.ResourcesPluralWebhookConfig: - return &v2.WebhookConfig{} - case v2.ResourcesPluralWebhookReceiver: - return &v2.WebhookReceiver{} - case v2.ResourcesPluralWechatConfig: - return &v2.WechatConfig{} - case v2.ResourcesPluralWechatReceiver: - return &v2.WechatReceiver{} + case v2alpha1.ResourcesPluralDingTalkConfig: + return &v2alpha1.DingTalkConfig{} + case v2alpha1.ResourcesPluralDingTalkReceiver: + return &v2alpha1.DingTalkReceiver{} + case v2alpha1.ResourcesPluralEmailConfig: + return &v2alpha1.EmailConfig{} + case v2alpha1.ResourcesPluralEmailReceiver: + return &v2alpha1.EmailReceiver{} + case v2alpha1.ResourcesPluralSlackConfig: + return &v2alpha1.SlackConfig{} + case v2alpha1.ResourcesPluralSlackReceiver: + return &v2alpha1.SlackReceiver{} + case v2alpha1.ResourcesPluralWebhookConfig: + return &v2alpha1.WebhookConfig{} + case v2alpha1.ResourcesPluralWebhookReceiver: + return &v2alpha1.WebhookReceiver{} + case v2alpha1.ResourcesPluralWechatConfig: + return &v2alpha1.WechatConfig{} + case v2alpha1.ResourcesPluralWechatReceiver: + return &v2alpha1.WechatReceiver{} case "secrets": return &corev1.Secret{} default: @@ -254,13 +254,13 @@ func (o *operator) IsKnownResource(resource string) bool { func authorizer(user string, obj runtime.Object) error { // If the user is not nil, it must equal to the tenant specified in labels of the object. if user != "" && !isOwner(user, obj) { - return errors.NewForbidden(v2.Resource(obj.GetObjectKind().GroupVersionKind().GroupKind().Kind), "", + return errors.NewForbidden(v2alpha1.Resource(obj.GetObjectKind().GroupVersionKind().GroupKind().Kind), "", fmt.Errorf("user '%s' is not the owner of object", user)) } // If the user is nil, the object must be a global object. if user == "" && !isGlobal(obj) { - return errors.NewForbidden(v2.Resource(obj.GetObjectKind().GroupVersionKind().GroupKind().Kind), "", + return errors.NewForbidden(v2alpha1.Resource(obj.GetObjectKind().GroupVersionKind().GroupKind().Kind), "", fmt.Errorf("object is not a global object")) } @@ -281,7 +281,7 @@ func isOwner(user string, obj interface{}) bool { func isConfig(obj runtime.Object) bool { switch obj.(type) { - case *v2.DingTalkConfig, *v2.EmailConfig, *v2.SlackConfig, *v2.WebhookConfig, *v2.WechatConfig: + case *v2alpha1.DingTalkConfig, *v2alpha1.EmailConfig, *v2alpha1.SlackConfig, *v2alpha1.WebhookConfig, *v2alpha1.WechatConfig: return true default: return false diff --git a/pkg/models/resources/v1alpha3/notification/notification.go b/pkg/models/resources/v1alpha3/notification/notification.go index aa77737ad..92e3aee69 100644 --- a/pkg/models/resources/v1alpha3/notification/notification.go +++ b/pkg/models/resources/v1alpha3/notification/notification.go @@ -34,11 +34,11 @@ func NewDingTalkConfigGetter(informer ksinformers.SharedInformerFactory) v1alpha } func (g *dingtalkConfigGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().DingTalkConfigs().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().DingTalkConfigs().Lister().Get(name) } func (g *dingtalkConfigGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().DingTalkConfigs().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().DingTalkConfigs().Lister().List(query.Selector()) if err != nil { return nil, err } @@ -59,11 +59,11 @@ func NewDingTalkReceiverGetter(informer ksinformers.SharedInformerFactory) v1alp } func (g *dingtalkReceiverGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().DingTalkReceivers().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().DingTalkReceivers().Lister().Get(name) } func (g *dingtalkReceiverGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().DingTalkReceivers().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().DingTalkReceivers().Lister().List(query.Selector()) if err != nil { return nil, err } @@ -84,11 +84,11 @@ func NewEmailConfigGetter(informer ksinformers.SharedInformerFactory) v1alpha3.I } func (g *emailConfigGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().EmailConfigs().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().EmailConfigs().Lister().Get(name) } func (g *emailConfigGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().EmailConfigs().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().EmailConfigs().Lister().List(query.Selector()) if err != nil { return nil, err } @@ -109,11 +109,11 @@ func NewEmailReceiverGetter(informer ksinformers.SharedInformerFactory) v1alpha3 } func (g *emailReceiverGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().EmailReceivers().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().EmailReceivers().Lister().Get(name) } func (g *emailReceiverGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().EmailReceivers().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().EmailReceivers().Lister().List(query.Selector()) if err != nil { return nil, err } @@ -134,11 +134,11 @@ func NewSlackConfigGetter(informer ksinformers.SharedInformerFactory) v1alpha3.I } func (g *slackConfigGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().SlackConfigs().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().SlackConfigs().Lister().Get(name) } func (g *slackConfigGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().SlackConfigs().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().SlackConfigs().Lister().List(query.Selector()) if err != nil { return nil, err } @@ -159,11 +159,11 @@ func NewSlackReceiverGetter(informer ksinformers.SharedInformerFactory) v1alpha3 } func (g *slackReceiverGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().SlackReceivers().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().SlackReceivers().Lister().Get(name) } func (g *slackReceiverGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().SlackReceivers().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().SlackReceivers().Lister().List(query.Selector()) if err != nil { return nil, err } @@ -184,11 +184,11 @@ func NewWebhookConfigGetter(informer ksinformers.SharedInformerFactory) v1alpha3 } func (g *webhookConfigGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().WebhookConfigs().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().WebhookConfigs().Lister().Get(name) } func (g *webhookConfigGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().WebhookConfigs().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().WebhookConfigs().Lister().List(query.Selector()) if err != nil { return nil, err } @@ -209,11 +209,11 @@ func NewWebhookReceiverGetter(informer ksinformers.SharedInformerFactory) v1alph } func (g *webhookReceiverGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().WebhookReceivers().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().WebhookReceivers().Lister().Get(name) } func (g *webhookReceiverGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().WebhookReceivers().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().WebhookReceivers().Lister().List(query.Selector()) if err != nil { return nil, err } @@ -234,11 +234,11 @@ func NewWechatConfigGetter(informer ksinformers.SharedInformerFactory) v1alpha3. } func (g *wechatConfigGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().WechatConfigs().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().WechatConfigs().Lister().Get(name) } func (g *wechatConfigGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().WechatConfigs().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().WechatConfigs().Lister().List(query.Selector()) if err != nil { return nil, err } @@ -259,11 +259,11 @@ func NewWechatReceiverGetter(informer ksinformers.SharedInformerFactory) v1alpha } func (g *wechatReceiverGetter) Get(_, name string) (runtime.Object, error) { - return g.ksInformer.Notification().V2().WechatReceivers().Lister().Get(name) + return g.ksInformer.Notification().V2alpha1().WechatReceivers().Lister().Get(name) } func (g *wechatReceiverGetter) List(_ string, query *query.Query) (*api.ListResult, error) { - objs, err := g.ksInformer.Notification().V2().WechatReceivers().Lister().List(query.Selector()) + objs, err := g.ksInformer.Notification().V2alpha1().WechatReceivers().Lister().List(query.Selector()) if err != nil { return nil, err } diff --git a/pkg/models/resources/v1alpha3/notification/notification_test.go b/pkg/models/resources/v1alpha3/notification/notification_test.go index e8023250c..52bbb0b1a 100644 --- a/pkg/models/resources/v1alpha3/notification/notification_test.go +++ b/pkg/models/resources/v1alpha3/notification/notification_test.go @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/cache" "kubesphere.io/kubesphere/pkg/api" - v2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" "kubesphere.io/kubesphere/pkg/apiserver/query" "kubesphere.io/kubesphere/pkg/client/clientset/versioned/fake" ksinformers "kubesphere.io/kubesphere/pkg/client/informers/externalversions" @@ -47,43 +47,43 @@ func TestListObjects(t *testing.T) { }{ { "test name filter", - v2.ResourcesPluralDingTalkConfig, + v2alpha1.ResourcesPluralDingTalkConfig, }, { "test name filter", - v2.ResourcesPluralDingTalkReceiver, + v2alpha1.ResourcesPluralDingTalkReceiver, }, { "test name filter", - v2.ResourcesPluralEmailConfig, + v2alpha1.ResourcesPluralEmailConfig, }, { "test name filter", - v2.ResourcesPluralEmailReceiver, + v2alpha1.ResourcesPluralEmailReceiver, }, { "test name filter", - v2.ResourcesPluralSlackConfig, + v2alpha1.ResourcesPluralSlackConfig, }, { "test name filter", - v2.ResourcesPluralSlackReceiver, + v2alpha1.ResourcesPluralSlackReceiver, }, { "test name filter", - v2.ResourcesPluralWebhookConfig, + v2alpha1.ResourcesPluralWebhookConfig, }, { "test name filter", - v2.ResourcesPluralWebhookReceiver, + v2alpha1.ResourcesPluralWebhookReceiver, }, { "test name filter", - v2.ResourcesPluralWechatConfig, + v2alpha1.ResourcesPluralWechatConfig, }, { "test name filter", - v2.ResourcesPluralWechatReceiver, + v2alpha1.ResourcesPluralWechatReceiver, }, } @@ -128,48 +128,48 @@ func prepare(key string) (v1alpha3.Interface, []interface{}, error) { var indexer cache.Indexer var getter func(informer ksinformers.SharedInformerFactory) v1alpha3.Interface switch key { - case v2.ResourcesPluralDingTalkConfig: - indexer = informer.Notification().V2().DingTalkConfigs().Informer().GetIndexer() + case v2alpha1.ResourcesPluralDingTalkConfig: + indexer = informer.Notification().V2alpha1().DingTalkConfigs().Informer().GetIndexer() getter = NewDingTalkConfigGetter - obj = &v2.DingTalkConfig{} - case v2.ResourcesPluralDingTalkReceiver: - indexer = informer.Notification().V2().DingTalkReceivers().Informer().GetIndexer() + obj = &v2alpha1.DingTalkConfig{} + case v2alpha1.ResourcesPluralDingTalkReceiver: + indexer = informer.Notification().V2alpha1().DingTalkReceivers().Informer().GetIndexer() getter = NewDingTalkReceiverGetter - obj = &v2.DingTalkReceiver{} - case v2.ResourcesPluralEmailConfig: - indexer = informer.Notification().V2().EmailConfigs().Informer().GetIndexer() + obj = &v2alpha1.DingTalkReceiver{} + case v2alpha1.ResourcesPluralEmailConfig: + indexer = informer.Notification().V2alpha1().EmailConfigs().Informer().GetIndexer() getter = NewEmailConfigGetter - obj = &v2.EmailConfig{} - case v2.ResourcesPluralEmailReceiver: - indexer = informer.Notification().V2().EmailReceivers().Informer().GetIndexer() + obj = &v2alpha1.EmailConfig{} + case v2alpha1.ResourcesPluralEmailReceiver: + indexer = informer.Notification().V2alpha1().EmailReceivers().Informer().GetIndexer() getter = NewEmailReceiverGetter - obj = &v2.EmailReceiver{} - case v2.ResourcesPluralSlackConfig: - indexer = informer.Notification().V2().SlackConfigs().Informer().GetIndexer() + obj = &v2alpha1.EmailReceiver{} + case v2alpha1.ResourcesPluralSlackConfig: + indexer = informer.Notification().V2alpha1().SlackConfigs().Informer().GetIndexer() getter = NewSlackConfigGetter - obj = &v2.SlackConfig{} - case v2.ResourcesPluralSlackReceiver: - indexer = informer.Notification().V2().SlackReceivers().Informer().GetIndexer() + obj = &v2alpha1.SlackConfig{} + case v2alpha1.ResourcesPluralSlackReceiver: + indexer = informer.Notification().V2alpha1().SlackReceivers().Informer().GetIndexer() getter = NewSlackReceiverGetter - obj = &v2.SlackReceiver{} - case v2.ResourcesPluralWebhookConfig: - indexer = informer.Notification().V2().WebhookConfigs().Informer().GetIndexer() + obj = &v2alpha1.SlackReceiver{} + case v2alpha1.ResourcesPluralWebhookConfig: + indexer = informer.Notification().V2alpha1().WebhookConfigs().Informer().GetIndexer() getter = NewWebhookConfigGetter - obj = &v2.WebhookConfig{} - case v2.ResourcesPluralWebhookReceiver: - indexer = informer.Notification().V2().WebhookReceivers().Informer().GetIndexer() + obj = &v2alpha1.WebhookConfig{} + case v2alpha1.ResourcesPluralWebhookReceiver: + indexer = informer.Notification().V2alpha1().WebhookReceivers().Informer().GetIndexer() getter = NewWebhookReceiverGetter - obj = &v2.WebhookReceiver{} - case v2.ResourcesPluralWechatConfig: - indexer = informer.Notification().V2().WechatConfigs().Informer().GetIndexer() + obj = &v2alpha1.WebhookReceiver{} + case v2alpha1.ResourcesPluralWechatConfig: + indexer = informer.Notification().V2alpha1().WechatConfigs().Informer().GetIndexer() getter = NewWechatConfigGetter - obj = &v2.WechatConfig{} - case v2.ResourcesPluralWechatReceiver: - indexer = informer.Notification().V2().WechatReceivers().Informer().GetIndexer() + obj = &v2alpha1.WechatConfig{} + case v2alpha1.ResourcesPluralWechatReceiver: + indexer = informer.Notification().V2alpha1().WechatReceivers().Informer().GetIndexer() getter = NewWechatReceiverGetter - obj = &v2.WechatReceiver{} + obj = &v2alpha1.WechatReceiver{} default: - return nil, nil, errors.New("unkonwed type %s", key) + return nil, nil, errors.New("unowned type %s", key) } num := rand.Intn(LengthMax) diff --git a/pkg/models/resources/v1alpha3/resource/resource.go b/pkg/models/resources/v1alpha3/resource/resource.go index 23f1e82c3..a205b0922 100644 --- a/pkg/models/resources/v1alpha3/resource/resource.go +++ b/pkg/models/resources/v1alpha3/resource/resource.go @@ -26,7 +26,7 @@ import ( devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3" iamv1alpha2 "kubesphere.io/kubesphere/pkg/apis/iam/v1alpha2" networkv1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1" - notificationv2 "kubesphere.io/kubesphere/pkg/apis/notification/v2" + notificationv2alpha1 "kubesphere.io/kubesphere/pkg/apis/notification/v2alpha1" tenantv1alpha1 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1" tenantv1alpha2 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha2" typesv1beta1 "kubesphere.io/kubesphere/pkg/apis/types/v1beta1" @@ -126,16 +126,16 @@ func NewResourceGetter(factory informers.InformerFactory, cache cache.Cache) *Re getters[schema.GroupVersionResource{Group: "cluster.kubesphere.io", Version: "v1alpha1", Resource: "clusters"}] = cluster.New(factory.KubeSphereSharedInformerFactory()) getters[schema.GroupVersionResource{Group: "apiextensions.k8s.io", Version: "v1", Resource: "customresourcedefinitions"}] = customresourcedefinition.New(factory.ApiExtensionSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralDingTalkConfig)] = notification.NewDingTalkConfigGetter(factory.KubeSphereSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralDingTalkReceiver)] = notification.NewDingTalkReceiverGetter(factory.KubeSphereSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralEmailConfig)] = notification.NewEmailConfigGetter(factory.KubeSphereSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralEmailReceiver)] = notification.NewEmailReceiverGetter(factory.KubeSphereSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralSlackConfig)] = notification.NewSlackConfigGetter(factory.KubeSphereSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralSlackReceiver)] = notification.NewSlackReceiverGetter(factory.KubeSphereSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralWebhookConfig)] = notification.NewWebhookConfigGetter(factory.KubeSphereSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralWebhookReceiver)] = notification.NewWebhookReceiverGetter(factory.KubeSphereSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralWechatConfig)] = notification.NewWechatConfigGetter(factory.KubeSphereSharedInformerFactory()) - getters[notificationv2.SchemeGroupVersion.WithResource(notificationv2.ResourcesPluralWechatReceiver)] = notification.NewWechatReceiverGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralDingTalkConfig)] = notification.NewDingTalkConfigGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralDingTalkReceiver)] = notification.NewDingTalkReceiverGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralEmailConfig)] = notification.NewEmailConfigGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralEmailReceiver)] = notification.NewEmailReceiverGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralSlackConfig)] = notification.NewSlackConfigGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralSlackReceiver)] = notification.NewSlackReceiverGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralWebhookConfig)] = notification.NewWebhookConfigGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralWebhookReceiver)] = notification.NewWebhookReceiverGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralWechatConfig)] = notification.NewWechatConfigGetter(factory.KubeSphereSharedInformerFactory()) + getters[notificationv2alpha1.SchemeGroupVersion.WithResource(notificationv2alpha1.ResourcesPluralWechatReceiver)] = notification.NewWechatReceiverGetter(factory.KubeSphereSharedInformerFactory()) // federated resources getters[typesv1beta1.SchemeGroupVersion.WithResource(typesv1beta1.ResourcePluralFederatedNamespace)] = federatednamespace.New(factory.KubeSphereSharedInformerFactory())