This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch refactor-with-go
in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git
The following commit(s) were added to refs/heads/refactor-with-go by this push:
new f394a6a Add peer authentication crd
f394a6a is described below
commit f394a6addecfda2092cdc8d6b214799f469cafb1
Author: Albumen Kevin <[email protected]>
AuthorDate: Thu Mar 2 10:48:38 2023 +0800
Add peer authentication crd
---
ca/deploy/crd.yaml | 170 ++++++++++++++
ca/deploy/example-peerauthentication.yaml | 19 ++
ca/pkg/apis/dubbo.apache.org/v1beta1/doc.go | 19 ++
ca/pkg/apis/dubbo.apache.org/v1beta1/register.go | 64 ++++++
ca/pkg/apis/dubbo.apache.org/v1beta1/type.go | 51 +++++
.../v1beta1/zz_generated.deepcopy.go | 196 ++++++++++++++++
.../dubbo.apache.org/v1beta1/extendconfig.go | 47 ++++
.../dubbo.apache.org/v1beta1/peerauthentication.go | 209 +++++++++++++++++
.../v1beta1/peerauthenticationspec.go | 56 +++++
.../dubbo.apache.org/v1beta1/rule.go | 57 +++++
.../dubbo.apache.org/v1beta1/source.go | 123 ++++++++++
.../applyconfiguration/internal/internal.go | 61 +++++
ca/pkg/generated/applyconfiguration/utils.go | 44 ++++
ca/pkg/generated/clientset/versioned/clientset.go | 119 ++++++++++
.../versioned/fake/clientset_generated.go | 84 +++++++
ca/pkg/generated/clientset/versioned/fake/doc.go | 19 ++
.../generated/clientset/versioned/fake/register.go | 55 +++++
ca/pkg/generated/clientset/versioned/scheme/doc.go | 19 ++
.../clientset/versioned/scheme/register.go | 55 +++++
.../typed/dubbo.apache.org/v1beta1/doc.go | 19 ++
.../v1beta1/dubbo.apache.org_client.go | 106 +++++++++
.../typed/dubbo.apache.org/v1beta1/fake/doc.go | 19 ++
.../v1beta1/fake/fake_dubbo.apache.org_client.go | 39 ++++
.../v1beta1/fake/fake_peerauthentication.go | 153 +++++++++++++
.../v1beta1/generated_expansion.go | 20 ++
.../dubbo.apache.org/v1beta1/peerauthentication.go | 207 +++++++++++++++++
.../externalversions/dubbo.apache.org/interface.go | 45 ++++
.../dubbo.apache.org/v1beta1/interface.go | 44 ++++
.../dubbo.apache.org/v1beta1/peerauthentication.go | 89 ++++++++
.../informers/externalversions/factory.go | 250 +++++++++++++++++++++
.../informers/externalversions/generic.go | 61 +++++
.../internalinterfaces/factory_interfaces.go | 39 ++++
.../v1beta1/expansion_generated.go | 26 +++
.../dubbo.apache.org/v1beta1/peerauthentication.go | 98 ++++++++
34 files changed, 2682 insertions(+)
diff --git a/ca/deploy/crd.yaml b/ca/deploy/crd.yaml
new file mode 100644
index 0000000..3e25633
--- /dev/null
+++ b/ca/deploy/crd.yaml
@@ -0,0 +1,170 @@
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: peerauthentications.dubbo.apache.org
+spec:
+ group: dubbo.apache.org
+ versions:
+ - name: v1beta1
+ served: true
+ storage: true
+ schema:
+ openAPIV3Schema:
+ type: object
+ properties:
+ spec:
+ type: object
+ properties:
+ action:
+ type: string
+ description: "The action to take when a rule is matched."
+ enum:
+ - NONE
+ - CLIENT_AUTH
+ - SERVER_AUTH
+ rule:
+ type: array
+ items:
+ type: object
+ properties:
+ from:
+ type: array
+ description: "The source of the traffic to be matched."
+ items:
+ type: object
+ properties:
+ source:
+ type: object
+ properties:
+ namespaces:
+ type: array
+ description: "The namespaces to match of the
source workload."
+ items:
+ type: string
+ notNamespaces:
+ type: array
+ description: "The namespaces not to match of
the source workload."
+ items:
+ type: string
+ ipBlocks:
+ type: array
+ description: "The IP addresses to match of
the source workload."
+ items:
+ type: string
+ notIpBlocks:
+ type: array
+ description: "The IP addresses not to match
of the source workload."
+ items:
+ type: string
+ principals:
+ type: array
+ description: "The identities(from spiffe) to
match of the source workload."
+ items:
+ type: string
+ notPrincipals:
+ type: array
+ description: "The identities(from spiffe)
not to match of the source workload."
+ items:
+ type: string
+ extends:
+ type: array
+ description: "The extended identities(from
Dubbo Auth) to match of the source workload."
+ items:
+ type: object
+ properties:
+ key:
+ type: string
+ description: "The key of the extended
identity."
+ value:
+ type: string
+ description: "The value of the
extended identity."
+ notExtends:
+ type: array
+ description: "The extended identities(from
Dubbo Auth) not to match of the source workload."
+ items:
+ type: object
+ properties:
+ key:
+ type: string
+ description: "The key of the extended
identity."
+ value:
+ type: string
+ description: "The value of the
extended identity."
+ to:
+ type: array
+ description: "The destination of the traffic to be
matched."
+ items:
+ type: object
+ properties:
+ source:
+ type: object
+ properties:
+ namespaces:
+ type: array
+ description: "The namespaces to match of the
destination workload."
+ items:
+ type: string
+ notNamespaces:
+ type: array
+ description: "The namespaces not to match of
the destination workload."
+ items:
+ type: string
+ ipBlocks:
+ type: array
+ description: "The IP addresses to match of
the destination workload."
+ items:
+ type: string
+ notIpBlocks:
+ type: array
+ description: "The IP addresses not to match
of the destination workload."
+ items:
+ type: string
+ principals:
+ type: array
+ description: "The identities(from spiffe) to
match of the destination workload."
+ items:
+ type: string
+ notPrincipals:
+ type: array
+ description: "The identities(from spiffe)
not to match of the destination workload."
+ items:
+ type: string
+ extends:
+ type: array
+ description: "The extended identities(from
Dubbo Auth) to match of the destination workload."
+ items:
+ type: object
+ properties:
+ key:
+ type: string
+ description: "The key of the extended
identity."
+ value:
+ type: string
+ description: "The value of the
extended identity."
+ notExtends:
+ type: array
+ description: "The extended identities(from
Dubbo Auth) not to match of the destination workload."
+ items:
+ type: object
+ properties:
+ key:
+ type: string
+ description: "The key of the extended
identity."
+ value:
+ type: string
+ description: "The value of the
extended identity."
+ order:
+ type: integer
+ description: "The order of the rule. The rule with the
highest precedence is matched first."
+ minimum: -2147483648
+ default: 0
+ maximum: 2147483647
+ required:
+ - action
+ scope: Namespaced
+ names:
+ plural: peerauthentications
+ singular: peerauthentication
+ kind: PeerAuthentication
+ shortNames:
+ - pa
diff --git a/ca/deploy/example-peerauthentication.yaml
b/ca/deploy/example-peerauthentication.yaml
new file mode 100644
index 0000000..1d8560b
--- /dev/null
+++ b/ca/deploy/example-peerauthentication.yaml
@@ -0,0 +1,19 @@
+apiVersion: dubbo.apache.org/v1beta1
+kind: PeerAuthentication
+metadata:
+ name: default
+ namespace: default
+spec:
+ action: CLIENT_AUTH
+ rule:
+ - from:
+ - source:
+ principals: ["cluster.local/ns/default/sa/sleep"]
+ - source:
+ namespaces: ["test"]
+ - to:
+ - source:
+ principals: ["cluster.local/ns/default/sa/sleep"]
+ - source:
+ namespaces: ["demo"]
+ order: 0
\ No newline at end of file
diff --git a/ca/pkg/apis/dubbo.apache.org/v1beta1/doc.go
b/ca/pkg/apis/dubbo.apache.org/v1beta1/doc.go
new file mode 100644
index 0000000..b4d6c1d
--- /dev/null
+++ b/ca/pkg/apis/dubbo.apache.org/v1beta1/doc.go
@@ -0,0 +1,19 @@
+// +k8s:deepcopy-gen=package
+// +groupName=dubbo.apache.org
+
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package v1beta1
diff --git a/ca/pkg/apis/dubbo.apache.org/v1beta1/register.go
b/ca/pkg/apis/dubbo.apache.org/v1beta1/register.go
new file mode 100644
index 0000000..7d35c56
--- /dev/null
+++ b/ca/pkg/apis/dubbo.apache.org/v1beta1/register.go
@@ -0,0 +1,64 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+type PeerAuthentication struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec PeerAuthenticationSpec `json:"spec"`
+}
+
+type PeerAuthenticationList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata"`
+
+ Items []PeerAuthentication `json:"items"`
+}
+
+type PeerAuthenticationSpec struct {
+ Action string `json:"action,omitempty"`
+ Rule Rule `json:"rule,omitempty"`
+ Order int `json:"order,omitempty"`
+}
+
+type Rule struct {
+ From []Source `json:"from,omitempty"`
+ To []Source `json:"to,omitempty"`
+}
+
+type Source struct {
+ Namespaces []string `json:"namespaces,omitempty"`
+ NotNamespaces []string `json:"notNamespaces,omitempty"`
+ IpBlocks []string `json:"ipBlocks,omitempty"`
+ NotIpBlocks []string `json:"notIpBlocks,omitempty"`
+ Principals []string `json:"principals,omitempty"`
+ NotPrincipals []string `json:"notPrincipals,omitempty"`
+ Extends []ExtendConfig `json:"extends,omitempty"`
+ NotExtends []ExtendConfig `json:"notExtends,omitempty"`
+}
+
+type ExtendConfig struct {
+ Key string `json:"key,omitempty"`
+ Value string `json:"value,omitempty"`
+}
diff --git a/ca/pkg/apis/dubbo.apache.org/v1beta1/type.go
b/ca/pkg/apis/dubbo.apache.org/v1beta1/type.go
new file mode 100644
index 0000000..a5d8071
--- /dev/null
+++ b/ca/pkg/apis/dubbo.apache.org/v1beta1/type.go
@@ -0,0 +1,51 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// SchemeGroupVersion is group version used to register these objects
+var SchemeGroupVersion = schema.GroupVersion{Group: "dubbo.apache.org",
Version: "v1beta1"}
+
+// Kind takes an unqualified kind and returns back a Group qualified GroupKind
+func Kind(kind string) schema.GroupKind {
+ return SchemeGroupVersion.WithKind(kind).GroupKind()
+}
+
+// Resource takes an unqualified resource and returns a Group qualified
GroupResource
+func Resource(resource string) schema.GroupResource {
+ return SchemeGroupVersion.WithResource(resource).GroupResource()
+}
+
+var (
+ // SchemeBuilder initializes a scheme builder
+ SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
+ // AddToScheme is a global function that registers this API group &
version to a scheme
+ AddToScheme = SchemeBuilder.AddToScheme
+)
+
+// Adds the list of known types to Scheme.
+func addKnownTypes(scheme *runtime.Scheme) error {
+ scheme.AddKnownTypes(SchemeGroupVersion,
+ &PeerAuthentication{},
+ )
+ metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
+ return nil
+}
diff --git a/ca/pkg/apis/dubbo.apache.org/v1beta1/zz_generated.deepcopy.go
b/ca/pkg/apis/dubbo.apache.org/v1beta1/zz_generated.deepcopy.go
new file mode 100644
index 0000000..ede23df
--- /dev/null
+++ b/ca/pkg/apis/dubbo.apache.org/v1beta1/zz_generated.deepcopy.go
@@ -0,0 +1,196 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by deepcopy-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
+func (in *ExtendConfig) DeepCopyInto(out *ExtendConfig) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new ExtendConfig.
+func (in *ExtendConfig) DeepCopy() *ExtendConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(ExtendConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
+func (in *PeerAuthentication) DeepCopyInto(out *PeerAuthentication) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new PeerAuthentication.
+func (in *PeerAuthentication) DeepCopy() *PeerAuthentication {
+ if in == nil {
+ return nil
+ }
+ out := new(PeerAuthentication)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver,
creating a new runtime.Object.
+func (in *PeerAuthentication) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
+func (in *PeerAuthenticationList) DeepCopyInto(out *PeerAuthenticationList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]PeerAuthentication, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new PeerAuthenticationList.
+func (in *PeerAuthenticationList) DeepCopy() *PeerAuthenticationList {
+ if in == nil {
+ return nil
+ }
+ out := new(PeerAuthenticationList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
+func (in *PeerAuthenticationSpec) DeepCopyInto(out *PeerAuthenticationSpec) {
+ *out = *in
+ in.Rule.DeepCopyInto(&out.Rule)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new PeerAuthenticationSpec.
+func (in *PeerAuthenticationSpec) DeepCopy() *PeerAuthenticationSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(PeerAuthenticationSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
+func (in *Rule) DeepCopyInto(out *Rule) {
+ *out = *in
+ if in.From != nil {
+ in, out := &in.From, &out.From
+ *out = make([]Source, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.To != nil {
+ in, out := &in.To, &out.To
+ *out = make([]Source, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new Rule.
+func (in *Rule) DeepCopy() *Rule {
+ if in == nil {
+ return nil
+ }
+ out := new(Rule)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
+func (in *Source) DeepCopyInto(out *Source) {
+ *out = *in
+ if in.Namespaces != nil {
+ in, out := &in.Namespaces, &out.Namespaces
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.NotNamespaces != nil {
+ in, out := &in.NotNamespaces, &out.NotNamespaces
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.IpBlocks != nil {
+ in, out := &in.IpBlocks, &out.IpBlocks
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.NotIpBlocks != nil {
+ in, out := &in.NotIpBlocks, &out.NotIpBlocks
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Principals != nil {
+ in, out := &in.Principals, &out.Principals
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.NotPrincipals != nil {
+ in, out := &in.NotPrincipals, &out.NotPrincipals
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Extends != nil {
+ in, out := &in.Extends, &out.Extends
+ *out = make([]ExtendConfig, len(*in))
+ copy(*out, *in)
+ }
+ if in.NotExtends != nil {
+ in, out := &in.NotExtends, &out.NotExtends
+ *out = make([]ExtendConfig, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new Source.
+func (in *Source) DeepCopy() *Source {
+ if in == nil {
+ return nil
+ }
+ out := new(Source)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git
a/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/extendconfig.go
b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/extendconfig.go
new file mode 100644
index 0000000..74f3c01
--- /dev/null
+++
b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/extendconfig.go
@@ -0,0 +1,47 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+// ExtendConfigApplyConfiguration represents an declarative configuration of
the ExtendConfig type for use
+// with apply.
+type ExtendConfigApplyConfiguration struct {
+ Key *string `json:"key,omitempty"`
+ Value *string `json:"value,omitempty"`
+}
+
+// ExtendConfigApplyConfiguration constructs an declarative configuration of
the ExtendConfig type for use with
+// apply.
+func ExtendConfig() *ExtendConfigApplyConfiguration {
+ return &ExtendConfigApplyConfiguration{}
+}
+
+// WithKey sets the Key field in the declarative configuration to the given
value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Key field is set to the value of the last
call.
+func (b *ExtendConfigApplyConfiguration) WithKey(value string)
*ExtendConfigApplyConfiguration {
+ b.Key = &value
+ return b
+}
+
+// WithValue sets the Value field in the declarative configuration to the
given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Value field is set to the value of the last
call.
+func (b *ExtendConfigApplyConfiguration) WithValue(value string)
*ExtendConfigApplyConfiguration {
+ b.Value = &value
+ return b
+}
diff --git
a/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/peerauthentication.go
b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/peerauthentication.go
new file mode 100644
index 0000000..de083b2
--- /dev/null
+++
b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/peerauthentication.go
@@ -0,0 +1,209 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// PeerAuthenticationApplyConfiguration represents an declarative
configuration of the PeerAuthentication type for use
+// with apply.
+type PeerAuthenticationApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec
*PeerAuthenticationSpecApplyConfiguration `json:"spec,omitempty"`
+}
+
+// PeerAuthentication constructs an declarative configuration of the
PeerAuthentication type for use with
+// apply.
+func PeerAuthentication(name, namespace string)
*PeerAuthenticationApplyConfiguration {
+ b := &PeerAuthenticationApplyConfiguration{}
+ b.WithName(name)
+ b.WithNamespace(namespace)
+ b.WithKind("PeerAuthentication")
+ b.WithAPIVersion("dubbo.apache.org/v1beta1")
+ return b
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given
value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Kind field is set to the value of the last
call.
+func (b *PeerAuthenticationApplyConfiguration) WithKind(value string)
*PeerAuthenticationApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration
to the given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the APIVersion field is set to the value of the
last call.
+func (b *PeerAuthenticationApplyConfiguration) WithAPIVersion(value string)
*PeerAuthenticationApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given
value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Name field is set to the value of the last
call.
+func (b *PeerAuthenticationApplyConfiguration) WithName(value string)
*PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative
configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the GenerateName field is set to the value of the
last call.
+func (b *PeerAuthenticationApplyConfiguration) WithGenerateName(value string)
*PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to
the given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Namespace field is set to the value of the
last call.
+func (b *PeerAuthenticationApplyConfiguration) WithNamespace(value string)
*PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given
value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the UID field is set to the value of the last
call.
+func (b *PeerAuthenticationApplyConfiguration) WithUID(value types.UID)
*PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative
configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of
the last call.
+func (b *PeerAuthenticationApplyConfiguration) WithResourceVersion(value
string) *PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration
to the given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Generation field is set to the value of the
last call.
+func (b *PeerAuthenticationApplyConfiguration) WithGeneration(value int64)
*PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative
configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value
of the last call.
+func (b *PeerAuthenticationApplyConfiguration) WithCreationTimestamp(value
metav1.Time) *PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative
configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value
of the last call.
+func (b *PeerAuthenticationApplyConfiguration) WithDeletionTimestamp(value
metav1.Time) *PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in
the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to
the value of the last call.
+func (b *PeerAuthenticationApplyConfiguration)
WithDeletionGracePeriodSeconds(value int64)
*PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative
configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, the entries provided by each call will be put on
the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *PeerAuthenticationApplyConfiguration) WithLabels(entries
map[string]string) *PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the
declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, the entries provided by each call will be put on
the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *PeerAuthenticationApplyConfiguration) WithAnnotations(entries
map[string]string) *PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in
the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the OwnerReferences field.
+func (b *PeerAuthenticationApplyConfiguration) WithOwnerReferences(values
...*v1.OwnerReferenceApplyConfiguration) *PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the
declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the Finalizers field.
+func (b *PeerAuthenticationApplyConfiguration) WithFinalizers(values
...string) *PeerAuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *PeerAuthenticationApplyConfiguration)
ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration =
&v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given
value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Spec field is set to the value of the last
call.
+func (b *PeerAuthenticationApplyConfiguration) WithSpec(value
*PeerAuthenticationSpecApplyConfiguration)
*PeerAuthenticationApplyConfiguration {
+ b.Spec = value
+ return b
+}
diff --git
a/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/peerauthenticationspec.go
b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/peerauthenticationspec.go
new file mode 100644
index 0000000..6e811ed
--- /dev/null
+++
b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/peerauthenticationspec.go
@@ -0,0 +1,56 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+// PeerAuthenticationSpecApplyConfiguration represents an declarative
configuration of the PeerAuthenticationSpec type for use
+// with apply.
+type PeerAuthenticationSpecApplyConfiguration struct {
+ Action *string `json:"action,omitempty"`
+ Rule *RuleApplyConfiguration `json:"rule,omitempty"`
+ Order *int `json:"order,omitempty"`
+}
+
+// PeerAuthenticationSpecApplyConfiguration constructs an declarative
configuration of the PeerAuthenticationSpec type for use with
+// apply.
+func PeerAuthenticationSpec() *PeerAuthenticationSpecApplyConfiguration {
+ return &PeerAuthenticationSpecApplyConfiguration{}
+}
+
+// WithAction sets the Action field in the declarative configuration to the
given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Action field is set to the value of the last
call.
+func (b *PeerAuthenticationSpecApplyConfiguration) WithAction(value string)
*PeerAuthenticationSpecApplyConfiguration {
+ b.Action = &value
+ return b
+}
+
+// WithRule sets the Rule field in the declarative configuration to the given
value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Rule field is set to the value of the last
call.
+func (b *PeerAuthenticationSpecApplyConfiguration) WithRule(value
*RuleApplyConfiguration) *PeerAuthenticationSpecApplyConfiguration {
+ b.Rule = value
+ return b
+}
+
+// WithOrder sets the Order field in the declarative configuration to the
given value
+// and returns the receiver, so that objects can be built by chaining "With"
function invocations.
+// If called multiple times, the Order field is set to the value of the last
call.
+func (b *PeerAuthenticationSpecApplyConfiguration) WithOrder(value int)
*PeerAuthenticationSpecApplyConfiguration {
+ b.Order = &value
+ return b
+}
diff --git
a/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/rule.go
b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/rule.go
new file mode 100644
index 0000000..c5365b0
--- /dev/null
+++ b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/rule.go
@@ -0,0 +1,57 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+// RuleApplyConfiguration represents an declarative configuration of the Rule
type for use
+// with apply.
+type RuleApplyConfiguration struct {
+ From []SourceApplyConfiguration `json:"from,omitempty"`
+ To []SourceApplyConfiguration `json:"to,omitempty"`
+}
+
+// RuleApplyConfiguration constructs an declarative configuration of the Rule
type for use with
+// apply.
+func Rule() *RuleApplyConfiguration {
+ return &RuleApplyConfiguration{}
+}
+
+// WithFrom adds the given value to the From field in the declarative
configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the From field.
+func (b *RuleApplyConfiguration) WithFrom(values ...*SourceApplyConfiguration)
*RuleApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithFrom")
+ }
+ b.From = append(b.From, *values[i])
+ }
+ return b
+}
+
+// WithTo adds the given value to the To field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the To field.
+func (b *RuleApplyConfiguration) WithTo(values ...*SourceApplyConfiguration)
*RuleApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithTo")
+ }
+ b.To = append(b.To, *values[i])
+ }
+ return b
+}
diff --git
a/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/source.go
b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/source.go
new file mode 100644
index 0000000..0229465
--- /dev/null
+++ b/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1/source.go
@@ -0,0 +1,123 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+// SourceApplyConfiguration represents an declarative configuration of the
Source type for use
+// with apply.
+type SourceApplyConfiguration struct {
+ Namespaces []string
`json:"namespaces,omitempty"`
+ NotNamespaces []string
`json:"notNamespaces,omitempty"`
+ IpBlocks []string
`json:"ipBlocks,omitempty"`
+ NotIpBlocks []string
`json:"notIpBlocks,omitempty"`
+ Principals []string
`json:"principals,omitempty"`
+ NotPrincipals []string
`json:"notPrincipals,omitempty"`
+ Extends []ExtendConfigApplyConfiguration
`json:"extends,omitempty"`
+ NotExtends []ExtendConfigApplyConfiguration
`json:"notExtends,omitempty"`
+}
+
+// SourceApplyConfiguration constructs an declarative configuration of the
Source type for use with
+// apply.
+func Source() *SourceApplyConfiguration {
+ return &SourceApplyConfiguration{}
+}
+
+// WithNamespaces adds the given value to the Namespaces field in the
declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the Namespaces field.
+func (b *SourceApplyConfiguration) WithNamespaces(values ...string)
*SourceApplyConfiguration {
+ for i := range values {
+ b.Namespaces = append(b.Namespaces, values[i])
+ }
+ return b
+}
+
+// WithNotNamespaces adds the given value to the NotNamespaces field in the
declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the NotNamespaces field.
+func (b *SourceApplyConfiguration) WithNotNamespaces(values ...string)
*SourceApplyConfiguration {
+ for i := range values {
+ b.NotNamespaces = append(b.NotNamespaces, values[i])
+ }
+ return b
+}
+
+// WithIpBlocks adds the given value to the IpBlocks field in the declarative
configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the IpBlocks field.
+func (b *SourceApplyConfiguration) WithIpBlocks(values ...string)
*SourceApplyConfiguration {
+ for i := range values {
+ b.IpBlocks = append(b.IpBlocks, values[i])
+ }
+ return b
+}
+
+// WithNotIpBlocks adds the given value to the NotIpBlocks field in the
declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the NotIpBlocks field.
+func (b *SourceApplyConfiguration) WithNotIpBlocks(values ...string)
*SourceApplyConfiguration {
+ for i := range values {
+ b.NotIpBlocks = append(b.NotIpBlocks, values[i])
+ }
+ return b
+}
+
+// WithPrincipals adds the given value to the Principals field in the
declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the Principals field.
+func (b *SourceApplyConfiguration) WithPrincipals(values ...string)
*SourceApplyConfiguration {
+ for i := range values {
+ b.Principals = append(b.Principals, values[i])
+ }
+ return b
+}
+
+// WithNotPrincipals adds the given value to the NotPrincipals field in the
declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the NotPrincipals field.
+func (b *SourceApplyConfiguration) WithNotPrincipals(values ...string)
*SourceApplyConfiguration {
+ for i := range values {
+ b.NotPrincipals = append(b.NotPrincipals, values[i])
+ }
+ return b
+}
+
+// WithExtends adds the given value to the Extends field in the declarative
configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the Extends field.
+func (b *SourceApplyConfiguration) WithExtends(values
...*ExtendConfigApplyConfiguration) *SourceApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithExtends")
+ }
+ b.Extends = append(b.Extends, *values[i])
+ }
+ return b
+}
+
+// WithNotExtends adds the given value to the NotExtends field in the
declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With"
function invocations.
+// If called multiple times, values provided by each call will be appended to
the NotExtends field.
+func (b *SourceApplyConfiguration) WithNotExtends(values
...*ExtendConfigApplyConfiguration) *SourceApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithNotExtends")
+ }
+ b.NotExtends = append(b.NotExtends, *values[i])
+ }
+ return b
+}
diff --git a/ca/pkg/generated/applyconfiguration/internal/internal.go
b/ca/pkg/generated/applyconfiguration/internal/internal.go
new file mode 100644
index 0000000..041ac5f
--- /dev/null
+++ b/ca/pkg/generated/applyconfiguration/internal/internal.go
@@ -0,0 +1,61 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package internal
+
+import (
+ "fmt"
+ "sync"
+
+ typed "sigs.k8s.io/structured-merge-diff/v4/typed"
+)
+
+func Parser() *typed.Parser {
+ parserOnce.Do(func() {
+ var err error
+ parser, err = typed.NewParser(schemaYAML)
+ if err != nil {
+ panic(fmt.Sprintf("Failed to parse schema: %v", err))
+ }
+ })
+ return parser
+}
+
+var parserOnce sync.Once
+var parser *typed.Parser
+var schemaYAML = typed.YAMLObject(`types:
+- name: __untyped_atomic_
+ scalar: untyped
+ list:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+ map:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+- name: __untyped_deduced_
+ scalar: untyped
+ list:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+ map:
+ elementType:
+ namedType: __untyped_deduced_
+ elementRelationship: separable
+`)
diff --git a/ca/pkg/generated/applyconfiguration/utils.go
b/ca/pkg/generated/applyconfiguration/utils.go
new file mode 100644
index 0000000..5a73e45
--- /dev/null
+++ b/ca/pkg/generated/applyconfiguration/utils.go
@@ -0,0 +1,44 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package applyconfiguration
+
+import (
+ v1beta1
"github.com/apache/dubbo-admin/ca/pkg/apis/dubbo.apache.org/v1beta1"
+ dubboapacheorgv1beta1
"github.com/apache/dubbo-admin/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+// ForKind returns an apply configuration type for the given GroupVersionKind,
or nil if no
+// apply configuration type exists for the given GroupVersionKind.
+func ForKind(kind schema.GroupVersionKind) interface{} {
+ switch kind {
+ // Group=dubbo.apache.org, Version=v1beta1
+ case v1beta1.SchemeGroupVersion.WithKind("ExtendConfig"):
+ return &dubboapacheorgv1beta1.ExtendConfigApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("PeerAuthentication"):
+ return
&dubboapacheorgv1beta1.PeerAuthenticationApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("PeerAuthenticationSpec"):
+ return
&dubboapacheorgv1beta1.PeerAuthenticationSpecApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("Rule"):
+ return &dubboapacheorgv1beta1.RuleApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("Source"):
+ return &dubboapacheorgv1beta1.SourceApplyConfiguration{}
+
+ }
+ return nil
+}
diff --git a/ca/pkg/generated/clientset/versioned/clientset.go
b/ca/pkg/generated/clientset/versioned/clientset.go
new file mode 100644
index 0000000..b6938ac
--- /dev/null
+++ b/ca/pkg/generated/clientset/versioned/clientset.go
@@ -0,0 +1,119 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package versioned
+
+import (
+ "fmt"
+ "net/http"
+
+ dubbov1beta1
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1"
+ discovery "k8s.io/client-go/discovery"
+ rest "k8s.io/client-go/rest"
+ flowcontrol "k8s.io/client-go/util/flowcontrol"
+)
+
+type Interface interface {
+ Discovery() discovery.DiscoveryInterface
+ DubboV1beta1() dubbov1beta1.DubboV1beta1Interface
+}
+
+// Clientset contains the clients for groups.
+type Clientset struct {
+ *discovery.DiscoveryClient
+ dubboV1beta1 *dubbov1beta1.DubboV1beta1Client
+}
+
+// DubboV1beta1 retrieves the DubboV1beta1Client
+func (c *Clientset) DubboV1beta1() dubbov1beta1.DubboV1beta1Interface {
+ return c.dubboV1beta1
+}
+
+// Discovery retrieves the DiscoveryClient
+func (c *Clientset) Discovery() discovery.DiscoveryInterface {
+ if c == nil {
+ return nil
+ }
+ return c.DiscoveryClient
+}
+
+// NewForConfig creates a new Clientset for the given config.
+// If config's RateLimiter is not set and QPS and Burst are acceptable,
+// NewForConfig will generate a rate-limiter in configShallowCopy.
+// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
+// where httpClient was generated with rest.HTTPClientFor(c).
+func NewForConfig(c *rest.Config) (*Clientset, error) {
+ configShallowCopy := *c
+
+ if configShallowCopy.UserAgent == "" {
+ configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent()
+ }
+
+ // share the transport between all clients
+ httpClient, err := rest.HTTPClientFor(&configShallowCopy)
+ if err != nil {
+ return nil, err
+ }
+
+ return NewForConfigAndClient(&configShallowCopy, httpClient)
+}
+
+// NewForConfigAndClient creates a new Clientset for the given config and http
client.
+// Note the http client provided takes precedence over the configured
transport values.
+// If config's RateLimiter is not set and QPS and Burst are acceptable,
+// NewForConfigAndClient will generate a rate-limiter in configShallowCopy.
+func NewForConfigAndClient(c *rest.Config, httpClient *http.Client)
(*Clientset, error) {
+ configShallowCopy := *c
+ if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
+ if configShallowCopy.Burst <= 0 {
+ return nil, fmt.Errorf("burst is required to be greater
than 0 when RateLimiter is not set and QPS is set to greater than 0")
+ }
+ configShallowCopy.RateLimiter =
flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS,
configShallowCopy.Burst)
+ }
+
+ var cs Clientset
+ var err error
+ cs.dubboV1beta1, err =
dubbov1beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
+ if err != nil {
+ return nil, err
+ }
+
+ cs.DiscoveryClient, err =
discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient)
+ if err != nil {
+ return nil, err
+ }
+ return &cs, nil
+}
+
+// NewForConfigOrDie creates a new Clientset for the given config and
+// panics if there is an error in the config.
+func NewForConfigOrDie(c *rest.Config) *Clientset {
+ cs, err := NewForConfig(c)
+ if err != nil {
+ panic(err)
+ }
+ return cs
+}
+
+// New creates a new Clientset for the given RESTClient.
+func New(c rest.Interface) *Clientset {
+ var cs Clientset
+ cs.dubboV1beta1 = dubbov1beta1.New(c)
+
+ cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
+ return &cs
+}
diff --git a/ca/pkg/generated/clientset/versioned/fake/clientset_generated.go
b/ca/pkg/generated/clientset/versioned/fake/clientset_generated.go
new file mode 100644
index 0000000..580e6e4
--- /dev/null
+++ b/ca/pkg/generated/clientset/versioned/fake/clientset_generated.go
@@ -0,0 +1,84 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ clientset
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned"
+ dubbov1beta1
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1"
+ fakedubbov1beta1
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/watch"
+ "k8s.io/client-go/discovery"
+ fakediscovery "k8s.io/client-go/discovery/fake"
+ "k8s.io/client-go/testing"
+)
+
+// NewSimpleClientset returns a clientset that will respond with the provided
objects.
+// It's backed by a very simple object tracker that processes creates, updates
and deletions as-is,
+// without applying any validations and/or defaults. It shouldn't be
considered a replacement
+// for a real clientset and is mostly useful in simple unit tests.
+func NewSimpleClientset(objects ...runtime.Object) *Clientset {
+ o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
+ for _, obj := range objects {
+ if err := o.Add(obj); err != nil {
+ panic(err)
+ }
+ }
+
+ cs := &Clientset{tracker: o}
+ cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
+ cs.AddReactor("*", "*", testing.ObjectReaction(o))
+ cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret
watch.Interface, err error) {
+ gvr := action.GetResource()
+ ns := action.GetNamespace()
+ watch, err := o.Watch(gvr, ns)
+ if err != nil {
+ return false, nil, err
+ }
+ return true, watch, nil
+ })
+
+ return cs
+}
+
+// Clientset implements clientset.Interface. Meant to be embedded into a
+// struct to get a default implementation. This makes faking out just the
method
+// you want to test easier.
+type Clientset struct {
+ testing.Fake
+ discovery *fakediscovery.FakeDiscovery
+ tracker testing.ObjectTracker
+}
+
+func (c *Clientset) Discovery() discovery.DiscoveryInterface {
+ return c.discovery
+}
+
+func (c *Clientset) Tracker() testing.ObjectTracker {
+ return c.tracker
+}
+
+var (
+ _ clientset.Interface = &Clientset{}
+ _ testing.FakeClient = &Clientset{}
+)
+
+// DubboV1beta1 retrieves the DubboV1beta1Client
+func (c *Clientset) DubboV1beta1() dubbov1beta1.DubboV1beta1Interface {
+ return &fakedubbov1beta1.FakeDubboV1beta1{Fake: &c.Fake}
+}
diff --git a/ca/pkg/generated/clientset/versioned/fake/doc.go
b/ca/pkg/generated/clientset/versioned/fake/doc.go
new file mode 100644
index 0000000..9da4639
--- /dev/null
+++ b/ca/pkg/generated/clientset/versioned/fake/doc.go
@@ -0,0 +1,19 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+// This package has the automatically generated fake clientset.
+package fake
diff --git a/ca/pkg/generated/clientset/versioned/fake/register.go
b/ca/pkg/generated/clientset/versioned/fake/register.go
new file mode 100644
index 0000000..47713b3
--- /dev/null
+++ b/ca/pkg/generated/clientset/versioned/fake/register.go
@@ -0,0 +1,55 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ dubbov1beta1
"github.com/apache/dubbo-admin/ca/pkg/apis/dubbo.apache.org/v1beta1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ serializer "k8s.io/apimachinery/pkg/runtime/serializer"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+)
+
+var scheme = runtime.NewScheme()
+var codecs = serializer.NewCodecFactory(scheme)
+
+var localSchemeBuilder = runtime.SchemeBuilder{
+ dubbov1beta1.AddToScheme,
+}
+
+// AddToScheme adds all types of this clientset into the given scheme. This
allows composition
+// of clientsets, like in:
+//
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme
"k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
+//
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+//
+// After this, RawExtensions in Kubernetes types will serialize
kube-aggregator types
+// correctly.
+var AddToScheme = localSchemeBuilder.AddToScheme
+
+func init() {
+ v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
+ utilruntime.Must(AddToScheme(scheme))
+}
diff --git a/ca/pkg/generated/clientset/versioned/scheme/doc.go
b/ca/pkg/generated/clientset/versioned/scheme/doc.go
new file mode 100644
index 0000000..039ebd3
--- /dev/null
+++ b/ca/pkg/generated/clientset/versioned/scheme/doc.go
@@ -0,0 +1,19 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+// This package contains the scheme of the automatically generated clientset.
+package scheme
diff --git a/ca/pkg/generated/clientset/versioned/scheme/register.go
b/ca/pkg/generated/clientset/versioned/scheme/register.go
new file mode 100644
index 0000000..09f9510
--- /dev/null
+++ b/ca/pkg/generated/clientset/versioned/scheme/register.go
@@ -0,0 +1,55 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package scheme
+
+import (
+ dubbov1beta1
"github.com/apache/dubbo-admin/ca/pkg/apis/dubbo.apache.org/v1beta1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ serializer "k8s.io/apimachinery/pkg/runtime/serializer"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+)
+
+var Scheme = runtime.NewScheme()
+var Codecs = serializer.NewCodecFactory(Scheme)
+var ParameterCodec = runtime.NewParameterCodec(Scheme)
+var localSchemeBuilder = runtime.SchemeBuilder{
+ dubbov1beta1.AddToScheme,
+}
+
+// AddToScheme adds all types of this clientset into the given scheme. This
allows composition
+// of clientsets, like in:
+//
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme
"k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
+//
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+//
+// After this, RawExtensions in Kubernetes types will serialize
kube-aggregator types
+// correctly.
+var AddToScheme = localSchemeBuilder.AddToScheme
+
+func init() {
+ v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
+ utilruntime.Must(AddToScheme(Scheme))
+}
diff --git
a/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/doc.go
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/doc.go
new file mode 100644
index 0000000..a1112f7
--- /dev/null
+++ b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/doc.go
@@ -0,0 +1,19 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+// This package has the automatically generated typed clients.
+package v1beta1
diff --git
a/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/dubbo.apache.org_client.go
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/dubbo.apache.org_client.go
new file mode 100644
index 0000000..4278f7d
--- /dev/null
+++
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/dubbo.apache.org_client.go
@@ -0,0 +1,106 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "net/http"
+
+ v1beta1
"github.com/apache/dubbo-admin/ca/pkg/apis/dubbo.apache.org/v1beta1"
+
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned/scheme"
+ rest "k8s.io/client-go/rest"
+)
+
+type DubboV1beta1Interface interface {
+ RESTClient() rest.Interface
+ PeerAuthenticationsGetter
+}
+
+// DubboV1beta1Client is used to interact with features provided by the
dubbo.apache.org group.
+type DubboV1beta1Client struct {
+ restClient rest.Interface
+}
+
+func (c *DubboV1beta1Client) PeerAuthentications(namespace string)
PeerAuthenticationInterface {
+ return newPeerAuthentications(c, namespace)
+}
+
+// NewForConfig creates a new DubboV1beta1Client for the given config.
+// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
+// where httpClient was generated with rest.HTTPClientFor(c).
+func NewForConfig(c *rest.Config) (*DubboV1beta1Client, error) {
+ config := *c
+ if err := setConfigDefaults(&config); err != nil {
+ return nil, err
+ }
+ httpClient, err := rest.HTTPClientFor(&config)
+ if err != nil {
+ return nil, err
+ }
+ return NewForConfigAndClient(&config, httpClient)
+}
+
+// NewForConfigAndClient creates a new DubboV1beta1Client for the given config
and http client.
+// Note the http client provided takes precedence over the configured
transport values.
+func NewForConfigAndClient(c *rest.Config, h *http.Client)
(*DubboV1beta1Client, error) {
+ config := *c
+ if err := setConfigDefaults(&config); err != nil {
+ return nil, err
+ }
+ client, err := rest.RESTClientForConfigAndClient(&config, h)
+ if err != nil {
+ return nil, err
+ }
+ return &DubboV1beta1Client{client}, nil
+}
+
+// NewForConfigOrDie creates a new DubboV1beta1Client for the given config and
+// panics if there is an error in the config.
+func NewForConfigOrDie(c *rest.Config) *DubboV1beta1Client {
+ client, err := NewForConfig(c)
+ if err != nil {
+ panic(err)
+ }
+ return client
+}
+
+// New creates a new DubboV1beta1Client for the given RESTClient.
+func New(c rest.Interface) *DubboV1beta1Client {
+ return &DubboV1beta1Client{c}
+}
+
+func setConfigDefaults(config *rest.Config) error {
+ gv := v1beta1.SchemeGroupVersion
+ config.GroupVersion = &gv
+ config.APIPath = "/apis"
+ config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
+
+ if config.UserAgent == "" {
+ config.UserAgent = rest.DefaultKubernetesUserAgent()
+ }
+
+ return nil
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *DubboV1beta1Client) RESTClient() rest.Interface {
+ if c == nil {
+ return nil
+ }
+ return c.restClient
+}
diff --git
a/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/doc.go
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/doc.go
new file mode 100644
index 0000000..4610412
--- /dev/null
+++
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/doc.go
@@ -0,0 +1,19 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+// Package fake has the automatically generated clients.
+package fake
diff --git
a/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dubbo.apache.org_client.go
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dubbo.apache.org_client.go
new file mode 100644
index 0000000..99abb12
--- /dev/null
+++
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dubbo.apache.org_client.go
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ v1beta1
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1"
+ rest "k8s.io/client-go/rest"
+ testing "k8s.io/client-go/testing"
+)
+
+type FakeDubboV1beta1 struct {
+ *testing.Fake
+}
+
+func (c *FakeDubboV1beta1) PeerAuthentications(namespace string)
v1beta1.PeerAuthenticationInterface {
+ return &FakePeerAuthentications{c, namespace}
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *FakeDubboV1beta1) RESTClient() rest.Interface {
+ var ret *rest.RESTClient
+ return ret
+}
diff --git
a/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_peerauthentication.go
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_peerauthentication.go
new file mode 100644
index 0000000..d21665c
--- /dev/null
+++
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_peerauthentication.go
@@ -0,0 +1,153 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ json "encoding/json"
+ "fmt"
+
+ v1beta1
"github.com/apache/dubbo-admin/ca/pkg/apis/dubbo.apache.org/v1beta1"
+ dubboapacheorgv1beta1
"github.com/apache/dubbo-admin/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+)
+
+// FakePeerAuthentications implements PeerAuthenticationInterface
+type FakePeerAuthentications struct {
+ Fake *FakeDubboV1beta1
+ ns string
+}
+
+var peerauthenticationsResource =
v1beta1.SchemeGroupVersion.WithResource("peerauthentications")
+
+var peerauthenticationsKind =
v1beta1.SchemeGroupVersion.WithKind("PeerAuthentication")
+
+// Get takes name of the peerAuthentication, and returns the corresponding
peerAuthentication object, and an error if there is any.
+func (c *FakePeerAuthentications) Get(ctx context.Context, name string,
options v1.GetOptions) (result *v1beta1.PeerAuthentication, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(peerauthenticationsResource, c.ns,
name), &v1beta1.PeerAuthentication{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1beta1.PeerAuthentication), err
+}
+
+// List takes label and field selectors, and returns the list of
PeerAuthentications that match those selectors.
+func (c *FakePeerAuthentications) List(ctx context.Context, opts
v1.ListOptions) (result *v1beta1.PeerAuthenticationList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(peerauthenticationsResource,
peerauthenticationsKind, c.ns, opts), &v1beta1.PeerAuthenticationList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1beta1.PeerAuthenticationList{ListMeta:
obj.(*v1beta1.PeerAuthenticationList).ListMeta}
+ for _, item := range obj.(*v1beta1.PeerAuthenticationList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested
peerAuthentications.
+func (c *FakePeerAuthentications) Watch(ctx context.Context, opts
v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+
InvokesWatch(testing.NewWatchAction(peerauthenticationsResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a peerAuthentication and creates it.
Returns the server's representation of the peerAuthentication, and an error, if
there is any.
+func (c *FakePeerAuthentications) Create(ctx context.Context,
peerAuthentication *v1beta1.PeerAuthentication, opts v1.CreateOptions) (result
*v1beta1.PeerAuthentication, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(peerauthenticationsResource,
c.ns, peerAuthentication), &v1beta1.PeerAuthentication{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1beta1.PeerAuthentication), err
+}
+
+// Update takes the representation of a peerAuthentication and updates it.
Returns the server's representation of the peerAuthentication, and an error, if
there is any.
+func (c *FakePeerAuthentications) Update(ctx context.Context,
peerAuthentication *v1beta1.PeerAuthentication, opts v1.UpdateOptions) (result
*v1beta1.PeerAuthentication, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(peerauthenticationsResource,
c.ns, peerAuthentication), &v1beta1.PeerAuthentication{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1beta1.PeerAuthentication), err
+}
+
+// Delete takes name of the peerAuthentication and deletes it. Returns an
error if one occurs.
+func (c *FakePeerAuthentications) Delete(ctx context.Context, name string,
opts v1.DeleteOptions) error {
+ _, err := c.Fake.
+
Invokes(testing.NewDeleteActionWithOptions(peerauthenticationsResource, c.ns,
name, opts), &v1beta1.PeerAuthentication{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakePeerAuthentications) DeleteCollection(ctx context.Context, opts
v1.DeleteOptions, listOpts v1.ListOptions) error {
+ action :=
testing.NewDeleteCollectionAction(peerauthenticationsResource, c.ns, listOpts)
+
+ _, err := c.Fake.Invokes(action, &v1beta1.PeerAuthenticationList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched peerAuthentication.
+func (c *FakePeerAuthentications) Patch(ctx context.Context, name string, pt
types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string)
(result *v1beta1.PeerAuthentication, err error) {
+ obj, err := c.Fake.
+
Invokes(testing.NewPatchSubresourceAction(peerauthenticationsResource, c.ns,
name, pt, data, subresources...), &v1beta1.PeerAuthentication{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1beta1.PeerAuthentication), err
+}
+
+// Apply takes the given apply declarative configuration, applies it and
returns the applied peerAuthentication.
+func (c *FakePeerAuthentications) Apply(ctx context.Context,
peerAuthentication *dubboapacheorgv1beta1.PeerAuthenticationApplyConfiguration,
opts v1.ApplyOptions) (result *v1beta1.PeerAuthentication, err error) {
+ if peerAuthentication == nil {
+ return nil, fmt.Errorf("peerAuthentication provided to Apply
must not be nil")
+ }
+ data, err := json.Marshal(peerAuthentication)
+ if err != nil {
+ return nil, err
+ }
+ name := peerAuthentication.Name
+ if name == nil {
+ return nil, fmt.Errorf("peerAuthentication.Name must be
provided to Apply")
+ }
+ obj, err := c.Fake.
+
Invokes(testing.NewPatchSubresourceAction(peerauthenticationsResource, c.ns,
*name, types.ApplyPatchType, data), &v1beta1.PeerAuthentication{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1beta1.PeerAuthentication), err
+}
diff --git
a/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/generated_expansion.go
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/generated_expansion.go
new file mode 100644
index 0000000..d68fe00
--- /dev/null
+++
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/generated_expansion.go
@@ -0,0 +1,20 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1beta1
+
+type PeerAuthenticationExpansion interface{}
diff --git
a/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/peerauthentication.go
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/peerauthentication.go
new file mode 100644
index 0000000..2e1cd50
--- /dev/null
+++
b/ca/pkg/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/peerauthentication.go
@@ -0,0 +1,207 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "context"
+ json "encoding/json"
+ "fmt"
+ "time"
+
+ v1beta1
"github.com/apache/dubbo-admin/ca/pkg/apis/dubbo.apache.org/v1beta1"
+ dubboapacheorgv1beta1
"github.com/apache/dubbo-admin/ca/pkg/generated/applyconfiguration/dubbo.apache.org/v1beta1"
+ scheme
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned/scheme"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ rest "k8s.io/client-go/rest"
+)
+
+// PeerAuthenticationsGetter has a method to return a
PeerAuthenticationInterface.
+// A group's client should implement this interface.
+type PeerAuthenticationsGetter interface {
+ PeerAuthentications(namespace string) PeerAuthenticationInterface
+}
+
+// PeerAuthenticationInterface has methods to work with PeerAuthentication
resources.
+type PeerAuthenticationInterface interface {
+ Create(ctx context.Context, peerAuthentication
*v1beta1.PeerAuthentication, opts v1.CreateOptions)
(*v1beta1.PeerAuthentication, error)
+ Update(ctx context.Context, peerAuthentication
*v1beta1.PeerAuthentication, opts v1.UpdateOptions)
(*v1beta1.PeerAuthentication, 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)
(*v1beta1.PeerAuthentication, error)
+ List(ctx context.Context, opts v1.ListOptions)
(*v1beta1.PeerAuthenticationList, 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
*v1beta1.PeerAuthentication, err error)
+ Apply(ctx context.Context, peerAuthentication
*dubboapacheorgv1beta1.PeerAuthenticationApplyConfiguration, opts
v1.ApplyOptions) (result *v1beta1.PeerAuthentication, err error)
+ PeerAuthenticationExpansion
+}
+
+// peerAuthentications implements PeerAuthenticationInterface
+type peerAuthentications struct {
+ client rest.Interface
+ ns string
+}
+
+// newPeerAuthentications returns a PeerAuthentications
+func newPeerAuthentications(c *DubboV1beta1Client, namespace string)
*peerAuthentications {
+ return &peerAuthentications{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the peerAuthentication, and returns the corresponding
peerAuthentication object, and an error if there is any.
+func (c *peerAuthentications) Get(ctx context.Context, name string, options
v1.GetOptions) (result *v1beta1.PeerAuthentication, err error) {
+ result = &v1beta1.PeerAuthentication{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("peerauthentications").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of
PeerAuthentications that match those selectors.
+func (c *peerAuthentications) List(ctx context.Context, opts v1.ListOptions)
(result *v1beta1.PeerAuthenticationList, err error) {
+ var timeout time.Duration
+ if opts.TimeoutSeconds != nil {
+ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
+ }
+ result = &v1beta1.PeerAuthenticationList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("peerauthentications").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Timeout(timeout).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested
peerAuthentications.
+func (c *peerAuthentications) Watch(ctx context.Context, opts v1.ListOptions)
(watch.Interface, error) {
+ var timeout time.Duration
+ if opts.TimeoutSeconds != nil {
+ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
+ }
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("peerauthentications").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Timeout(timeout).
+ Watch(ctx)
+}
+
+// Create takes the representation of a peerAuthentication and creates it.
Returns the server's representation of the peerAuthentication, and an error, if
there is any.
+func (c *peerAuthentications) Create(ctx context.Context, peerAuthentication
*v1beta1.PeerAuthentication, opts v1.CreateOptions) (result
*v1beta1.PeerAuthentication, err error) {
+ result = &v1beta1.PeerAuthentication{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("peerauthentications").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(peerAuthentication).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Update takes the representation of a peerAuthentication and updates it.
Returns the server's representation of the peerAuthentication, and an error, if
there is any.
+func (c *peerAuthentications) Update(ctx context.Context, peerAuthentication
*v1beta1.PeerAuthentication, opts v1.UpdateOptions) (result
*v1beta1.PeerAuthentication, err error) {
+ result = &v1beta1.PeerAuthentication{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("peerauthentications").
+ Name(peerAuthentication.Name).
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(peerAuthentication).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Delete takes name of the peerAuthentication and deletes it. Returns an
error if one occurs.
+func (c *peerAuthentications) Delete(ctx context.Context, name string, opts
v1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("peerauthentications").
+ Name(name).
+ Body(&opts).
+ Do(ctx).
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *peerAuthentications) DeleteCollection(ctx context.Context, opts
v1.DeleteOptions, listOpts v1.ListOptions) error {
+ var timeout time.Duration
+ if listOpts.TimeoutSeconds != nil {
+ timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
+ }
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("peerauthentications").
+ VersionedParams(&listOpts, scheme.ParameterCodec).
+ Timeout(timeout).
+ Body(&opts).
+ Do(ctx).
+ Error()
+}
+
+// Patch applies the patch and returns the patched peerAuthentication.
+func (c *peerAuthentications) Patch(ctx context.Context, name string, pt
types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string)
(result *v1beta1.PeerAuthentication, err error) {
+ result = &v1beta1.PeerAuthentication{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("peerauthentications").
+ Name(name).
+ SubResource(subresources...).
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(data).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Apply takes the given apply declarative configuration, applies it and
returns the applied peerAuthentication.
+func (c *peerAuthentications) Apply(ctx context.Context, peerAuthentication
*dubboapacheorgv1beta1.PeerAuthenticationApplyConfiguration, opts
v1.ApplyOptions) (result *v1beta1.PeerAuthentication, err error) {
+ if peerAuthentication == nil {
+ return nil, fmt.Errorf("peerAuthentication provided to Apply
must not be nil")
+ }
+ patchOpts := opts.ToPatchOptions()
+ data, err := json.Marshal(peerAuthentication)
+ if err != nil {
+ return nil, err
+ }
+ name := peerAuthentication.Name
+ if name == nil {
+ return nil, fmt.Errorf("peerAuthentication.Name must be
provided to Apply")
+ }
+ result = &v1beta1.PeerAuthentication{}
+ err = c.client.Patch(types.ApplyPatchType).
+ Namespace(c.ns).
+ Resource("peerauthentications").
+ Name(*name).
+ VersionedParams(&patchOpts, scheme.ParameterCodec).
+ Body(data).
+ Do(ctx).
+ Into(result)
+ return
+}
diff --git
a/ca/pkg/generated/informers/externalversions/dubbo.apache.org/interface.go
b/ca/pkg/generated/informers/externalversions/dubbo.apache.org/interface.go
new file mode 100644
index 0000000..24a7c42
--- /dev/null
+++ b/ca/pkg/generated/informers/externalversions/dubbo.apache.org/interface.go
@@ -0,0 +1,45 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package dubbo
+
+import (
+ v1beta1
"github.com/apache/dubbo-admin/ca/pkg/generated/informers/externalversions/dubbo.apache.org/v1beta1"
+ internalinterfaces
"github.com/apache/dubbo-admin/ca/pkg/generated/informers/externalversions/internalinterfaces"
+)
+
+// Interface provides access to each of this group's versions.
+type Interface interface {
+ // V1beta1 provides access to shared informers for resources in V1beta1.
+ V1beta1() v1beta1.Interface
+}
+
+type group struct {
+ factory internalinterfaces.SharedInformerFactory
+ namespace string
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+}
+
+// New returns a new Interface.
+func New(f internalinterfaces.SharedInformerFactory, namespace string,
tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
+ return &group{factory: f, namespace: namespace, tweakListOptions:
tweakListOptions}
+}
+
+// V1beta1 returns a new v1beta1.Interface.
+func (g *group) V1beta1() v1beta1.Interface {
+ return v1beta1.New(g.factory, g.namespace, g.tweakListOptions)
+}
diff --git
a/ca/pkg/generated/informers/externalversions/dubbo.apache.org/v1beta1/interface.go
b/ca/pkg/generated/informers/externalversions/dubbo.apache.org/v1beta1/interface.go
new file mode 100644
index 0000000..d792da6
--- /dev/null
+++
b/ca/pkg/generated/informers/externalversions/dubbo.apache.org/v1beta1/interface.go
@@ -0,0 +1,44 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ internalinterfaces
"github.com/apache/dubbo-admin/ca/pkg/generated/informers/externalversions/internalinterfaces"
+)
+
+// Interface provides access to all the informers in this group version.
+type Interface interface {
+ // PeerAuthentications returns a PeerAuthenticationInformer.
+ PeerAuthentications() PeerAuthenticationInformer
+}
+
+type version struct {
+ factory internalinterfaces.SharedInformerFactory
+ namespace string
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+}
+
+// New returns a new Interface.
+func New(f internalinterfaces.SharedInformerFactory, namespace string,
tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
+ return &version{factory: f, namespace: namespace, tweakListOptions:
tweakListOptions}
+}
+
+// PeerAuthentications returns a PeerAuthenticationInformer.
+func (v *version) PeerAuthentications() PeerAuthenticationInformer {
+ return &peerAuthenticationInformer{factory: v.factory, namespace:
v.namespace, tweakListOptions: v.tweakListOptions}
+}
diff --git
a/ca/pkg/generated/informers/externalversions/dubbo.apache.org/v1beta1/peerauthentication.go
b/ca/pkg/generated/informers/externalversions/dubbo.apache.org/v1beta1/peerauthentication.go
new file mode 100644
index 0000000..9154748
--- /dev/null
+++
b/ca/pkg/generated/informers/externalversions/dubbo.apache.org/v1beta1/peerauthentication.go
@@ -0,0 +1,89 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ "context"
+ time "time"
+
+ dubboapacheorgv1beta1
"github.com/apache/dubbo-admin/ca/pkg/apis/dubbo.apache.org/v1beta1"
+ versioned
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned"
+ internalinterfaces
"github.com/apache/dubbo-admin/ca/pkg/generated/informers/externalversions/internalinterfaces"
+ v1beta1
"github.com/apache/dubbo-admin/ca/pkg/generated/listers/dubbo.apache.org/v1beta1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+)
+
+// PeerAuthenticationInformer provides access to a shared informer and lister
for
+// PeerAuthentications.
+type PeerAuthenticationInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1beta1.PeerAuthenticationLister
+}
+
+type peerAuthenticationInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewPeerAuthenticationInformer constructs a new informer for
PeerAuthentication type.
+// Always prefer using an informer factory to get a shared informer instead of
getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewPeerAuthenticationInformer(client versioned.Interface, namespace
string, resyncPeriod time.Duration, indexers cache.Indexers)
cache.SharedIndexInformer {
+ return NewFilteredPeerAuthenticationInformer(client, namespace,
resyncPeriod, indexers, nil)
+}
+
+// NewFilteredPeerAuthenticationInformer constructs a new informer for
PeerAuthentication type.
+// Always prefer using an informer factory to get a shared informer instead of
getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredPeerAuthenticationInformer(client versioned.Interface,
namespace string, resyncPeriod time.Duration, indexers cache.Indexers,
tweakListOptions internalinterfaces.TweakListOptionsFunc)
cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object,
error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return
client.DubboV1beta1().PeerAuthentications(namespace).List(context.TODO(),
options)
+ },
+ WatchFunc: func(options v1.ListOptions)
(watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return
client.DubboV1beta1().PeerAuthentications(namespace).Watch(context.TODO(),
options)
+ },
+ },
+ &dubboapacheorgv1beta1.PeerAuthentication{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *peerAuthenticationInformer) defaultInformer(client
versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredPeerAuthenticationInformer(client, f.namespace,
resyncPeriod, cache.Indexers{cache.NamespaceIndex:
cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *peerAuthenticationInformer) Informer() cache.SharedIndexInformer {
+ return
f.factory.InformerFor(&dubboapacheorgv1beta1.PeerAuthentication{},
f.defaultInformer)
+}
+
+func (f *peerAuthenticationInformer) Lister() v1beta1.PeerAuthenticationLister
{
+ return v1beta1.NewPeerAuthenticationLister(f.Informer().GetIndexer())
+}
diff --git a/ca/pkg/generated/informers/externalversions/factory.go
b/ca/pkg/generated/informers/externalversions/factory.go
new file mode 100644
index 0000000..e2425f7
--- /dev/null
+++ b/ca/pkg/generated/informers/externalversions/factory.go
@@ -0,0 +1,250 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package externalversions
+
+import (
+ reflect "reflect"
+ sync "sync"
+ time "time"
+
+ versioned
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned"
+ dubboapacheorg
"github.com/apache/dubbo-admin/ca/pkg/generated/informers/externalversions/dubbo.apache.org"
+ internalinterfaces
"github.com/apache/dubbo-admin/ca/pkg/generated/informers/externalversions/internalinterfaces"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ cache "k8s.io/client-go/tools/cache"
+)
+
+// SharedInformerOption defines the functional option type for
SharedInformerFactory.
+type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory
+
+type sharedInformerFactory struct {
+ client versioned.Interface
+ namespace string
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ lock sync.Mutex
+ defaultResync time.Duration
+ customResync map[reflect.Type]time.Duration
+
+ informers map[reflect.Type]cache.SharedIndexInformer
+ // startedInformers is used for tracking which informers have been
started.
+ // This allows Start() to be called multiple times safely.
+ startedInformers map[reflect.Type]bool
+ // wg tracks how many goroutines were started.
+ wg sync.WaitGroup
+ // shuttingDown is true when Shutdown has been called. It may still be
running
+ // because it needs to wait for goroutines.
+ shuttingDown bool
+}
+
+// WithCustomResyncConfig sets a custom resync period for the specified
informer types.
+func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration)
SharedInformerOption {
+ return func(factory *sharedInformerFactory) *sharedInformerFactory {
+ for k, v := range resyncConfig {
+ factory.customResync[reflect.TypeOf(k)] = v
+ }
+ return factory
+ }
+}
+
+// WithTweakListOptions sets a custom filter on all listers of the configured
SharedInformerFactory.
+func WithTweakListOptions(tweakListOptions
internalinterfaces.TweakListOptionsFunc) SharedInformerOption {
+ return func(factory *sharedInformerFactory) *sharedInformerFactory {
+ factory.tweakListOptions = tweakListOptions
+ return factory
+ }
+}
+
+// WithNamespace limits the SharedInformerFactory to the specified namespace.
+func WithNamespace(namespace string) SharedInformerOption {
+ return func(factory *sharedInformerFactory) *sharedInformerFactory {
+ factory.namespace = namespace
+ return factory
+ }
+}
+
+// NewSharedInformerFactory constructs a new instance of sharedInformerFactory
for all namespaces.
+func NewSharedInformerFactory(client versioned.Interface, defaultResync
time.Duration) SharedInformerFactory {
+ return NewSharedInformerFactoryWithOptions(client, defaultResync)
+}
+
+// NewFilteredSharedInformerFactory constructs a new instance of
sharedInformerFactory.
+// Listers obtained via this SharedInformerFactory will be subject to the same
filters
+// as specified here.
+// Deprecated: Please use NewSharedInformerFactoryWithOptions instead
+func NewFilteredSharedInformerFactory(client versioned.Interface,
defaultResync time.Duration, namespace string, tweakListOptions
internalinterfaces.TweakListOptionsFunc) SharedInformerFactory {
+ return NewSharedInformerFactoryWithOptions(client, defaultResync,
WithNamespace(namespace), WithTweakListOptions(tweakListOptions))
+}
+
+// NewSharedInformerFactoryWithOptions constructs a new instance of a
SharedInformerFactory with additional options.
+func NewSharedInformerFactoryWithOptions(client versioned.Interface,
defaultResync time.Duration, options ...SharedInformerOption)
SharedInformerFactory {
+ factory := &sharedInformerFactory{
+ client: client,
+ namespace: v1.NamespaceAll,
+ defaultResync: defaultResync,
+ informers:
make(map[reflect.Type]cache.SharedIndexInformer),
+ startedInformers: make(map[reflect.Type]bool),
+ customResync: make(map[reflect.Type]time.Duration),
+ }
+
+ // Apply all options
+ for _, opt := range options {
+ factory = opt(factory)
+ }
+
+ return factory
+}
+
+func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) {
+ f.lock.Lock()
+ defer f.lock.Unlock()
+
+ if f.shuttingDown {
+ return
+ }
+
+ for informerType, informer := range f.informers {
+ if !f.startedInformers[informerType] {
+ f.wg.Add(1)
+ // We need a new variable in each loop iteration,
+ // otherwise the goroutine would use the loop variable
+ // and that keeps changing.
+ informer := informer
+ go func() {
+ defer f.wg.Done()
+ informer.Run(stopCh)
+ }()
+ f.startedInformers[informerType] = true
+ }
+ }
+}
+
+func (f *sharedInformerFactory) Shutdown() {
+ f.lock.Lock()
+ f.shuttingDown = true
+ f.lock.Unlock()
+
+ // Will return immediately if there is nothing to wait for.
+ f.wg.Wait()
+}
+
+func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{})
map[reflect.Type]bool {
+ informers := func() map[reflect.Type]cache.SharedIndexInformer {
+ f.lock.Lock()
+ defer f.lock.Unlock()
+
+ informers := map[reflect.Type]cache.SharedIndexInformer{}
+ for informerType, informer := range f.informers {
+ if f.startedInformers[informerType] {
+ informers[informerType] = informer
+ }
+ }
+ return informers
+ }()
+
+ res := map[reflect.Type]bool{}
+ for informType, informer := range informers {
+ res[informType] = cache.WaitForCacheSync(stopCh,
informer.HasSynced)
+ }
+ return res
+}
+
+// InternalInformerFor returns the SharedIndexInformer for obj using an
internal
+// client.
+func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc
internalinterfaces.NewInformerFunc) cache.SharedIndexInformer {
+ f.lock.Lock()
+ defer f.lock.Unlock()
+
+ informerType := reflect.TypeOf(obj)
+ informer, exists := f.informers[informerType]
+ if exists {
+ return informer
+ }
+
+ resyncPeriod, exists := f.customResync[informerType]
+ if !exists {
+ resyncPeriod = f.defaultResync
+ }
+
+ informer = newFunc(f.client, resyncPeriod)
+ f.informers[informerType] = informer
+
+ return informer
+}
+
+// SharedInformerFactory provides shared informers for resources in all known
+// API group versions.
+//
+// It is typically used like this:
+//
+// ctx, cancel := context.Background()
+// defer cancel()
+// factory := NewSharedInformerFactory(client, resyncPeriod)
+// defer factory.WaitForStop() // Returns immediately if nothing was
started.
+// genericInformer := factory.ForResource(resource)
+// typedInformer := factory.SomeAPIGroup().V1().SomeType()
+// factory.Start(ctx.Done()) // Start processing these informers.
+// synced := factory.WaitForCacheSync(ctx.Done())
+// for v, ok := range synced {
+// if !ok {
+// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v)
+// return
+// }
+// }
+//
+// // Creating informers can also be created after Start, but then
+// // Start must be called again:
+// anotherGenericInformer := factory.ForResource(resource)
+// factory.Start(ctx.Done())
+type SharedInformerFactory interface {
+ internalinterfaces.SharedInformerFactory
+
+ // Start initializes all requested informers. They are handled in
goroutines
+ // which run until the stop channel gets closed.
+ Start(stopCh <-chan struct{})
+
+ // Shutdown marks a factory as shutting down. At that point no new
+ // informers can be started anymore and Start will return without
+ // doing anything.
+ //
+ // In addition, Shutdown blocks until all goroutines have terminated.
For that
+ // to happen, the close channel(s) that they were started with must be
closed,
+ // either before Shutdown gets called or while it is waiting.
+ //
+ // Shutdown may be called multiple times, even concurrently. All such
calls will
+ // block until all goroutines have terminated.
+ Shutdown()
+
+ // WaitForCacheSync blocks until all started informers' caches were
synced
+ // or the stop channel gets closed.
+ WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
+
+ // ForResource gives generic access to a shared informer of the
matching type.
+ ForResource(resource schema.GroupVersionResource) (GenericInformer,
error)
+
+ // InternalInformerFor returns the SharedIndexInformer for obj using an
internal
+ // client.
+ InformerFor(obj runtime.Object, newFunc
internalinterfaces.NewInformerFunc) cache.SharedIndexInformer
+
+ Dubbo() dubboapacheorg.Interface
+}
+
+func (f *sharedInformerFactory) Dubbo() dubboapacheorg.Interface {
+ return dubboapacheorg.New(f, f.namespace, f.tweakListOptions)
+}
diff --git a/ca/pkg/generated/informers/externalversions/generic.go
b/ca/pkg/generated/informers/externalversions/generic.go
new file mode 100644
index 0000000..42abcc2
--- /dev/null
+++ b/ca/pkg/generated/informers/externalversions/generic.go
@@ -0,0 +1,61 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package externalversions
+
+import (
+ "fmt"
+
+ v1beta1
"github.com/apache/dubbo-admin/ca/pkg/apis/dubbo.apache.org/v1beta1"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ cache "k8s.io/client-go/tools/cache"
+)
+
+// GenericInformer is type of SharedIndexInformer which will locate and
delegate to other
+// sharedInformers based on type
+type GenericInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() cache.GenericLister
+}
+
+type genericInformer struct {
+ informer cache.SharedIndexInformer
+ resource schema.GroupResource
+}
+
+// Informer returns the SharedIndexInformer.
+func (f *genericInformer) Informer() cache.SharedIndexInformer {
+ return f.informer
+}
+
+// Lister returns the GenericLister.
+func (f *genericInformer) Lister() cache.GenericLister {
+ return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource)
+}
+
+// ForResource gives generic access to a shared informer of the matching type
+// TODO extend this to unknown resources with a client pool
+func (f *sharedInformerFactory) ForResource(resource
schema.GroupVersionResource) (GenericInformer, error) {
+ switch resource {
+ // Group=dubbo.apache.org, Version=v1beta1
+ case v1beta1.SchemeGroupVersion.WithResource("peerauthentications"):
+ return &genericInformer{resource: resource.GroupResource(),
informer: f.Dubbo().V1beta1().PeerAuthentications().Informer()}, nil
+
+ }
+
+ return nil, fmt.Errorf("no informer found for %v", resource)
+}
diff --git
a/ca/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go
b/ca/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go
new file mode 100644
index 0000000..eb1b8d7
--- /dev/null
+++
b/ca/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package internalinterfaces
+
+import (
+ time "time"
+
+ versioned
"github.com/apache/dubbo-admin/ca/pkg/generated/clientset/versioned"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ cache "k8s.io/client-go/tools/cache"
+)
+
+// NewInformerFunc takes versioned.Interface and time.Duration to return a
SharedIndexInformer.
+type NewInformerFunc func(versioned.Interface, time.Duration)
cache.SharedIndexInformer
+
+// SharedInformerFactory a small interface to allow for adding an informer
without an import cycle
+type SharedInformerFactory interface {
+ Start(stopCh <-chan struct{})
+ InformerFor(obj runtime.Object, newFunc NewInformerFunc)
cache.SharedIndexInformer
+}
+
+// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
+type TweakListOptionsFunc func(*v1.ListOptions)
diff --git
a/ca/pkg/generated/listers/dubbo.apache.org/v1beta1/expansion_generated.go
b/ca/pkg/generated/listers/dubbo.apache.org/v1beta1/expansion_generated.go
new file mode 100644
index 0000000..54aeb97
--- /dev/null
+++ b/ca/pkg/generated/listers/dubbo.apache.org/v1beta1/expansion_generated.go
@@ -0,0 +1,26 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1beta1
+
+// PeerAuthenticationListerExpansion allows custom methods to be added to
+// PeerAuthenticationLister.
+type PeerAuthenticationListerExpansion interface{}
+
+// PeerAuthenticationNamespaceListerExpansion allows custom methods to be
added to
+// PeerAuthenticationNamespaceLister.
+type PeerAuthenticationNamespaceListerExpansion interface{}
diff --git
a/ca/pkg/generated/listers/dubbo.apache.org/v1beta1/peerauthentication.go
b/ca/pkg/generated/listers/dubbo.apache.org/v1beta1/peerauthentication.go
new file mode 100644
index 0000000..c2f39d1
--- /dev/null
+++ b/ca/pkg/generated/listers/dubbo.apache.org/v1beta1/peerauthentication.go
@@ -0,0 +1,98 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ v1beta1
"github.com/apache/dubbo-admin/ca/pkg/apis/dubbo.apache.org/v1beta1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// PeerAuthenticationLister helps list PeerAuthentications.
+// All objects returned here must be treated as read-only.
+type PeerAuthenticationLister interface {
+ // List lists all PeerAuthentications in the indexer.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1beta1.PeerAuthentication, err
error)
+ // PeerAuthentications returns an object that can list and get
PeerAuthentications.
+ PeerAuthentications(namespace string) PeerAuthenticationNamespaceLister
+ PeerAuthenticationListerExpansion
+}
+
+// peerAuthenticationLister implements the PeerAuthenticationLister interface.
+type peerAuthenticationLister struct {
+ indexer cache.Indexer
+}
+
+// NewPeerAuthenticationLister returns a new PeerAuthenticationLister.
+func NewPeerAuthenticationLister(indexer cache.Indexer)
PeerAuthenticationLister {
+ return &peerAuthenticationLister{indexer: indexer}
+}
+
+// List lists all PeerAuthentications in the indexer.
+func (s *peerAuthenticationLister) List(selector labels.Selector) (ret
[]*v1beta1.PeerAuthentication, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1beta1.PeerAuthentication))
+ })
+ return ret, err
+}
+
+// PeerAuthentications returns an object that can list and get
PeerAuthentications.
+func (s *peerAuthenticationLister) PeerAuthentications(namespace string)
PeerAuthenticationNamespaceLister {
+ return peerAuthenticationNamespaceLister{indexer: s.indexer, namespace:
namespace}
+}
+
+// PeerAuthenticationNamespaceLister helps list and get PeerAuthentications.
+// All objects returned here must be treated as read-only.
+type PeerAuthenticationNamespaceLister interface {
+ // List lists all PeerAuthentications in the indexer for a given
namespace.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1beta1.PeerAuthentication, err
error)
+ // Get retrieves the PeerAuthentication from the indexer for a given
namespace and name.
+ // Objects returned here must be treated as read-only.
+ Get(name string) (*v1beta1.PeerAuthentication, error)
+ PeerAuthenticationNamespaceListerExpansion
+}
+
+// peerAuthenticationNamespaceLister implements the
PeerAuthenticationNamespaceLister
+// interface.
+type peerAuthenticationNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all PeerAuthentications in the indexer for a given namespace.
+func (s peerAuthenticationNamespaceLister) List(selector labels.Selector) (ret
[]*v1beta1.PeerAuthentication, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m
interface{}) {
+ ret = append(ret, m.(*v1beta1.PeerAuthentication))
+ })
+ return ret, err
+}
+
+// Get retrieves the PeerAuthentication from the indexer for a given namespace
and name.
+func (s peerAuthenticationNamespaceLister) Get(name string)
(*v1beta1.PeerAuthentication, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil,
errors.NewNotFound(v1beta1.Resource("peerauthentication"), name)
+ }
+ return obj.(*v1beta1.PeerAuthentication), nil
+}