diff --git a/build/charts/antrea/crds/tier.yaml b/build/charts/antrea/crds/tier.yaml index ac36e9573f1..ddc5045e27e 100644 --- a/build/charts/antrea/crds/tier.yaml +++ b/build/charts/antrea/crds/tier.yaml @@ -7,32 +7,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha1 - served: true - storage: false - additionalPrinterColumns: - - name: Priority - type: integer - description: The Priority of this Tier relative to other Tiers. - jsonPath: .spec.priority - - name: Age - type: date - jsonPath: .metadata.creationTimestamp - schema: - openAPIV3Schema: - type: object - properties: - spec: - required: - - priority - type: object - properties: - priority: - type: integer - minimum: 0 - maximum: 255 - description: - type: string - name: v1beta1 served: true storage: true diff --git a/build/charts/antrea/templates/webhooks/validating/crdvalidator.yaml b/build/charts/antrea/templates/webhooks/validating/crdvalidator.yaml index 0dfe1f8acd3..9f98ff1e1cb 100644 --- a/build/charts/antrea/templates/webhooks/validating/crdvalidator.yaml +++ b/build/charts/antrea/templates/webhooks/validating/crdvalidator.yaml @@ -15,7 +15,7 @@ webhooks: rules: - operations: ["CREATE", "UPDATE", "DELETE"] apiGroups: ["crd.antrea.io"] - apiVersions: ["v1alpha1", "v1beta1"] + apiVersions: ["v1beta1"] resources: ["tiers"] scope: "Cluster" admissionReviewVersions: ["v1", "v1beta1"] diff --git a/docs/api.md b/docs/api.md index 6d039cea37e..27406d13652 100644 --- a/docs/api.md +++ b/docs/api.md @@ -44,7 +44,6 @@ These are the CRDs currently available in `crd.antrea.io`. | `NetworkPolicy` | v1alpha1 | v1.0.0 | v1.13.0 | N/A | | `NetworkPolicy` | v1beta1 | v1.13.0 | N/A | N/A | | `SupportBundleCollection` | v1alpha1 | v1.10.0 | N/A | N/A | -| `Tier` | v1alpha1 | v1.0.0 | v1.13.0 | v2.0.0 | | `Tier` | v1beta1 | v1.13.0 | N/A | N/A | | `Traceflow` | v1alpha1 | v1.0.0 | v1.13.0 | N/A | | `Traceflow` | v1beta1 | v1.13.0 | N/A | N/A | @@ -81,3 +80,4 @@ These are the API group versions which are currently available when using Antrea | CRD | CRD version | Introduced in | Deprecated in | Removed in | |---|---|---|---|---| | `ClusterGroup` | v1alpha2 | v1.0.0 | v1.1.0 | v2.0.0 | +| `Tier` | v1alpha1 | v1.0.0 | v1.13.0 | v2.0.0 | diff --git a/pkg/apis/crd/v1alpha1/register.go b/pkg/apis/crd/v1alpha1/register.go index a9492ab5ac0..461d87bea6a 100644 --- a/pkg/apis/crd/v1alpha1/register.go +++ b/pkg/apis/crd/v1alpha1/register.go @@ -55,8 +55,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &NetworkPolicyList{}, &ClusterNetworkPolicy{}, &ClusterNetworkPolicyList{}, - &Tier{}, - &TierList{}, &ExternalNode{}, &ExternalNodeList{}, &SupportBundleCollection{}, diff --git a/pkg/apis/crd/v1alpha1/types.go b/pkg/apis/crd/v1alpha1/types.go index 8682ddeb09b..c05357d63d0 100644 --- a/pkg/apis/crd/v1alpha1/types.go +++ b/pkg/apis/crd/v1alpha1/types.go @@ -676,39 +676,6 @@ type ClusterNetworkPolicyList struct { Items []ClusterNetworkPolicy `json:"items"` } -// +genclient -// +genclient:nonNamespaced -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type Tier struct { - metav1.TypeMeta `json:",inline"` - // Standard metadata of the object. - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Specification of the desired behavior of Tier. - Spec TierSpec `json:"spec"` -} - -// TierSpec defines the desired state for Tier. -type TierSpec struct { - // Priority specfies the order of the Tier relative to other Tiers. - Priority int32 `json:"priority"` - // Description is an optional field to add more information regarding - // the purpose of this Tier. - Description string `json:"description,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type TierList struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - Items []Tier `json:"items"` -} - // NamespacedName refers to a Namespace scoped resource. // All fields must be used together. type NamespacedName struct { diff --git a/pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go index f80a99a2c64..dc263299b3f 100644 --- a/pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated // +build !ignore_autogenerated -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -1141,82 +1141,6 @@ func (in *TLSProtocol) DeepCopy() *TLSProtocol { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Tier) DeepCopyInto(out *Tier) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tier. -func (in *Tier) DeepCopy() *Tier { - if in == nil { - return nil - } - out := new(Tier) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Tier) 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 *TierList) DeepCopyInto(out *TierList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Tier, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TierList. -func (in *TierList) DeepCopy() *TierList { - if in == nil { - return nil - } - out := new(TierList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TierList) 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 *TierSpec) DeepCopyInto(out *TierSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TierSpec. -func (in *TierSpec) DeepCopy() *TierSpec { - if in == nil { - return nil - } - out := new(TierSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Traceflow) DeepCopyInto(out *Traceflow) { *out = *in diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/crd_client.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/crd_client.go index 140c2de5f47..1d448f11beb 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/crd_client.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha1/crd_client.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ type CrdV1alpha1Interface interface { ExternalNodesGetter NetworkPoliciesGetter SupportBundleCollectionsGetter - TiersGetter TraceflowsGetter } @@ -55,10 +54,6 @@ func (c *CrdV1alpha1Client) SupportBundleCollections() SupportBundleCollectionIn return newSupportBundleCollections(c) } -func (c *CrdV1alpha1Client) Tiers() TierInterface { - return newTiers(c) -} - func (c *CrdV1alpha1Client) Traceflows() TraceflowInterface { return newTraceflows(c) } diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_crd_client.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_crd_client.go index a90f91178bc..93f1e80ec2d 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_crd_client.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_crd_client.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -42,10 +42,6 @@ func (c *FakeCrdV1alpha1) SupportBundleCollections() v1alpha1.SupportBundleColle return &FakeSupportBundleCollections{c} } -func (c *FakeCrdV1alpha1) Tiers() v1alpha1.TierInterface { - return &FakeTiers{c} -} - func (c *FakeCrdV1alpha1) Traceflows() v1alpha1.TraceflowInterface { return &FakeTraceflows{c} } diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_tier.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_tier.go deleted file mode 100644 index 76305519610..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_tier.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2024 Antrea Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" - 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" -) - -// FakeTiers implements TierInterface -type FakeTiers struct { - Fake *FakeCrdV1alpha1 -} - -var tiersResource = v1alpha1.SchemeGroupVersion.WithResource("tiers") - -var tiersKind = v1alpha1.SchemeGroupVersion.WithKind("Tier") - -// Get takes name of the tier, and returns the corresponding tier object, and an error if there is any. -func (c *FakeTiers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Tier, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(tiersResource, name), &v1alpha1.Tier{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.Tier), err -} - -// List takes label and field selectors, and returns the list of Tiers that match those selectors. -func (c *FakeTiers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TierList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(tiersResource, tiersKind, opts), &v1alpha1.TierList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.TierList{ListMeta: obj.(*v1alpha1.TierList).ListMeta} - for _, item := range obj.(*v1alpha1.TierList).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 tiers. -func (c *FakeTiers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(tiersResource, opts)) -} - -// Create takes the representation of a tier and creates it. Returns the server's representation of the tier, and an error, if there is any. -func (c *FakeTiers) Create(ctx context.Context, tier *v1alpha1.Tier, opts v1.CreateOptions) (result *v1alpha1.Tier, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(tiersResource, tier), &v1alpha1.Tier{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.Tier), err -} - -// Update takes the representation of a tier and updates it. Returns the server's representation of the tier, and an error, if there is any. -func (c *FakeTiers) Update(ctx context.Context, tier *v1alpha1.Tier, opts v1.UpdateOptions) (result *v1alpha1.Tier, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(tiersResource, tier), &v1alpha1.Tier{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.Tier), err -} - -// Delete takes name of the tier and deletes it. Returns an error if one occurs. -func (c *FakeTiers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(tiersResource, name, opts), &v1alpha1.Tier{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeTiers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(tiersResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.TierList{}) - return err -} - -// Patch applies the patch and returns the patched tier. -func (c *FakeTiers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Tier, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(tiersResource, name, pt, data, subresources...), &v1alpha1.Tier{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.Tier), err -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/generated_expansion.go index d4d390824f7..7005bbb8240 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha1/generated_expansion.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,6 +24,4 @@ type NetworkPolicyExpansion interface{} type SupportBundleCollectionExpansion interface{} -type TierExpansion interface{} - type TraceflowExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/tier.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/tier.go deleted file mode 100644 index da817a5c5ee..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/tier.go +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2021 Antrea Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" - scheme "antrea.io/antrea/pkg/client/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" -) - -// TiersGetter has a method to return a TierInterface. -// A group's client should implement this interface. -type TiersGetter interface { - Tiers() TierInterface -} - -// TierInterface has methods to work with Tier resources. -type TierInterface interface { - Create(ctx context.Context, tier *v1alpha1.Tier, opts v1.CreateOptions) (*v1alpha1.Tier, error) - Update(ctx context.Context, tier *v1alpha1.Tier, opts v1.UpdateOptions) (*v1alpha1.Tier, 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) (*v1alpha1.Tier, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.TierList, 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 *v1alpha1.Tier, err error) - TierExpansion -} - -// tiers implements TierInterface -type tiers struct { - client rest.Interface -} - -// newTiers returns a Tiers -func newTiers(c *CrdV1alpha1Client) *tiers { - return &tiers{ - client: c.RESTClient(), - } -} - -// Get takes name of the tier, and returns the corresponding tier object, and an error if there is any. -func (c *tiers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Tier, err error) { - result = &v1alpha1.Tier{} - err = c.client.Get(). - Resource("tiers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Tiers that match those selectors. -func (c *tiers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TierList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.TierList{} - err = c.client.Get(). - Resource("tiers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested tiers. -func (c *tiers) 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(). - Resource("tiers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a tier and creates it. Returns the server's representation of the tier, and an error, if there is any. -func (c *tiers) Create(ctx context.Context, tier *v1alpha1.Tier, opts v1.CreateOptions) (result *v1alpha1.Tier, err error) { - result = &v1alpha1.Tier{} - err = c.client.Post(). - Resource("tiers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tier). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a tier and updates it. Returns the server's representation of the tier, and an error, if there is any. -func (c *tiers) Update(ctx context.Context, tier *v1alpha1.Tier, opts v1.UpdateOptions) (result *v1alpha1.Tier, err error) { - result = &v1alpha1.Tier{} - err = c.client.Put(). - Resource("tiers"). - Name(tier.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tier). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the tier and deletes it. Returns an error if one occurs. -func (c *tiers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("tiers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *tiers) 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(). - Resource("tiers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched tier. -func (c *tiers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Tier, err error) { - result = &v1alpha1.Tier{} - err = c.client.Patch(pt). - Resource("tiers"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/informers/externalversions/crd/v1alpha1/interface.go b/pkg/client/informers/externalversions/crd/v1alpha1/interface.go index 5f34c67e3e2..3b573dbfd43 100644 --- a/pkg/client/informers/externalversions/crd/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/crd/v1alpha1/interface.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,8 +30,6 @@ type Interface interface { NetworkPolicies() NetworkPolicyInformer // SupportBundleCollections returns a SupportBundleCollectionInformer. SupportBundleCollections() SupportBundleCollectionInformer - // Tiers returns a TierInformer. - Tiers() TierInformer // Traceflows returns a TraceflowInformer. Traceflows() TraceflowInformer } @@ -67,11 +65,6 @@ func (v *version) SupportBundleCollections() SupportBundleCollectionInformer { return &supportBundleCollectionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// Tiers returns a TierInformer. -func (v *version) Tiers() TierInformer { - return &tierInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - // Traceflows returns a TraceflowInformer. func (v *version) Traceflows() TraceflowInformer { return &traceflowInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/pkg/client/informers/externalversions/crd/v1alpha1/tier.go b/pkg/client/informers/externalversions/crd/v1alpha1/tier.go deleted file mode 100644 index 524c997636e..00000000000 --- a/pkg/client/informers/externalversions/crd/v1alpha1/tier.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2021 Antrea Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - crdv1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" - versioned "antrea.io/antrea/pkg/client/clientset/versioned" - internalinterfaces "antrea.io/antrea/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "antrea.io/antrea/pkg/client/listers/crd/v1alpha1" - 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" -) - -// TierInformer provides access to a shared informer and lister for -// Tiers. -type TierInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.TierLister -} - -type tierInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewTierInformer constructs a new informer for Tier 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 NewTierInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredTierInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredTierInformer constructs a new informer for Tier 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 NewFilteredTierInformer(client versioned.Interface, 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.CrdV1alpha1().Tiers().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CrdV1alpha1().Tiers().Watch(context.TODO(), options) - }, - }, - &crdv1alpha1.Tier{}, - resyncPeriod, - indexers, - ) -} - -func (f *tierInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredTierInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *tierInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&crdv1alpha1.Tier{}, f.defaultInformer) -} - -func (f *tierInformer) Lister() v1alpha1.TierLister { - return v1alpha1.NewTierLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index e3f7e903ce7..a5a77589478 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -62,8 +62,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha1().NetworkPolicies().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("supportbundlecollections"): return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha1().SupportBundleCollections().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("tiers"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha1().Tiers().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("traceflows"): return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha1().Traceflows().Informer()}, nil diff --git a/pkg/client/listers/crd/v1alpha1/expansion_generated.go b/pkg/client/listers/crd/v1alpha1/expansion_generated.go index 99f199fd8a1..1955030a256 100644 --- a/pkg/client/listers/crd/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/crd/v1alpha1/expansion_generated.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,10 +40,6 @@ type NetworkPolicyNamespaceListerExpansion interface{} // SupportBundleCollectionLister. type SupportBundleCollectionListerExpansion interface{} -// TierListerExpansion allows custom methods to be added to -// TierLister. -type TierListerExpansion interface{} - // TraceflowListerExpansion allows custom methods to be added to // TraceflowLister. type TraceflowListerExpansion interface{} diff --git a/pkg/client/listers/crd/v1alpha1/tier.go b/pkg/client/listers/crd/v1alpha1/tier.go deleted file mode 100644 index 7c921bea2e7..00000000000 --- a/pkg/client/listers/crd/v1alpha1/tier.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2021 Antrea Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// TierLister helps list Tiers. -// All objects returned here must be treated as read-only. -type TierLister interface { - // List lists all Tiers in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.Tier, err error) - // Get retrieves the Tier from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.Tier, error) - TierListerExpansion -} - -// tierLister implements the TierLister interface. -type tierLister struct { - indexer cache.Indexer -} - -// NewTierLister returns a new TierLister. -func NewTierLister(indexer cache.Indexer) TierLister { - return &tierLister{indexer: indexer} -} - -// List lists all Tiers in the indexer. -func (s *tierLister) List(selector labels.Selector) (ret []*v1alpha1.Tier, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Tier)) - }) - return ret, err -} - -// Get retrieves the Tier from the index for a given name. -func (s *tierLister) Get(name string) (*v1alpha1.Tier, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("tier"), name) - } - return obj.(*v1alpha1.Tier), nil -}