diff --git a/build/charts/antrea/crds/clustergroup.yaml b/build/charts/antrea/crds/clustergroup.yaml index 4ff7eaf5b9d..c66f54b0564 100644 --- a/build/charts/antrea/crds/clustergroup.yaml +++ b/build/charts/antrea/crds/clustergroup.yaml @@ -7,123 +7,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true diff --git a/build/charts/antrea/crds/egress.yaml b/build/charts/antrea/crds/egress.yaml index 9953be258d4..6bf1d3eb99c 100644 --- a/build/charts/antrea/crds/egress.yaml +++ b/build/charts/antrea/crds/egress.yaml @@ -7,137 +7,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - appliedTo - oneOf: - - anyOf: - - required: - - egressIP - - required: - - externalIPPool - - anyOf: - - required: - - egressIPs - - required: - - externalIPPools - properties: - appliedTo: - type: object - properties: - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - egressIP: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - egressIPs: - type: array - items: - type: string - oneOf: - - maxLength: 0 - - format: ipv4 - - format: ipv6 - externalIPPool: - type: string - externalIPPools: - type: array - items: - type: string - status: - type: object - properties: - egressNode: - type: string - egressIP: - type: string - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - reason: - type: string - message: - type: string - additionalPrinterColumns: - - description: The effective SNAT IP address for the selected workloads. - jsonPath: .status.egressIP - name: EgressIP - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: The Owner Node of egress IP - jsonPath: .status.egressNode - name: Node - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true diff --git a/build/charts/antrea/crds/externalippool.yaml b/build/charts/antrea/crds/externalippool.yaml index ac17a519c1b..3917679232c 100644 --- a/build/charts/antrea/crds/externalippool.yaml +++ b/build/charts/antrea/crds/externalippool.yaml @@ -7,93 +7,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - ipRanges - - nodeSelector - properties: - ipRanges: - type: array - items: - type: object - oneOf: - - required: - - cidr - - required: - - start - - end - properties: - cidr: - type: string - format: cidr - start: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - end: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - nodeSelector: - type: object - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - type: array - type: object - type: array - matchLabels: - x-kubernetes-preserve-unknown-fields: true - status: - type: object - properties: - usage: - type: object - properties: - total: - type: integer - used: - type: integer - additionalPrinterColumns: - - description: The number of total IPs - jsonPath: .status.usage.total - name: Total - type: integer - - description: The number of allocated IPs - jsonPath: .status.usage.used - name: Used - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - subresources: - status: {} - name: v1beta1 served: true storage: true diff --git a/build/charts/antrea/crds/group.yaml b/build/charts/antrea/crds/group.yaml index a39783a7b57..22c6b43d2a7 100644 --- a/build/charts/antrea/crds/group.yaml +++ b/build/charts/antrea/crds/group.yaml @@ -5,120 +5,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - 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 e950602bd6b..f01e702eefb 100644 --- a/build/charts/antrea/templates/webhooks/validating/crdvalidator.yaml +++ b/build/charts/antrea/templates/webhooks/validating/crdvalidator.yaml @@ -133,7 +133,7 @@ webhooks: rules: - operations: ["CREATE", "UPDATE"] apiGroups: ["crd.antrea.io"] - apiVersions: ["v1alpha2"] + apiVersions: ["v1beta1"] resources: ["egresses"] scope: "Cluster" admissionReviewVersions: ["v1", "v1beta1"] diff --git a/build/yamls/antrea-aks.yml b/build/yamls/antrea-aks.yml index a00ed056fb8..59157fcb6d5 100644 --- a/build/yamls/antrea-aks.yml +++ b/build/yamls/antrea-aks.yml @@ -311,123 +311,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1359,137 +1242,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - appliedTo - oneOf: - - anyOf: - - required: - - egressIP - - required: - - externalIPPool - - anyOf: - - required: - - egressIPs - - required: - - externalIPPools - properties: - appliedTo: - type: object - properties: - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - egressIP: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - egressIPs: - type: array - items: - type: string - oneOf: - - maxLength: 0 - - format: ipv4 - - format: ipv6 - externalIPPool: - type: string - externalIPPools: - type: array - items: - type: string - status: - type: object - properties: - egressNode: - type: string - egressIP: - type: string - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - reason: - type: string - message: - type: string - additionalPrinterColumns: - - description: The effective SNAT IP address for the selected workloads. - jsonPath: .status.egressIP - name: EgressIP - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: The Owner Node of egress IP - jsonPath: .status.egressNode - name: Node - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1711,93 +1463,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - ipRanges - - nodeSelector - properties: - ipRanges: - type: array - items: - type: object - oneOf: - - required: - - cidr - - required: - - start - - end - properties: - cidr: - type: string - format: cidr - start: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - end: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - nodeSelector: - type: object - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - type: array - type: object - type: array - matchLabels: - x-kubernetes-preserve-unknown-fields: true - status: - type: object - properties: - usage: - type: object - properties: - total: - type: integer - used: - type: integer - additionalPrinterColumns: - - description: The number of total IPs - jsonPath: .status.usage.total - name: Total - type: integer - - description: The number of allocated IPs - jsonPath: .status.usage.used - name: Used - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1976,120 +1641,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -5812,7 +5363,7 @@ webhooks: rules: - operations: ["CREATE", "UPDATE"] apiGroups: ["crd.antrea.io"] - apiVersions: ["v1alpha2"] + apiVersions: ["v1beta1"] resources: ["egresses"] scope: "Cluster" admissionReviewVersions: ["v1", "v1beta1"] diff --git a/build/yamls/antrea-crds.yml b/build/yamls/antrea-crds.yml index 3859614369a..c57d4446e6b 100644 --- a/build/yamls/antrea-crds.yml +++ b/build/yamls/antrea-crds.yml @@ -306,123 +306,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1350,137 +1233,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - appliedTo - oneOf: - - anyOf: - - required: - - egressIP - - required: - - externalIPPool - - anyOf: - - required: - - egressIPs - - required: - - externalIPPools - properties: - appliedTo: - type: object - properties: - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - egressIP: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - egressIPs: - type: array - items: - type: string - oneOf: - - maxLength: 0 - - format: ipv4 - - format: ipv6 - externalIPPool: - type: string - externalIPPools: - type: array - items: - type: string - status: - type: object - properties: - egressNode: - type: string - egressIP: - type: string - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - reason: - type: string - message: - type: string - additionalPrinterColumns: - - description: The effective SNAT IP address for the selected workloads. - jsonPath: .status.egressIP - name: EgressIP - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: The Owner Node of egress IP - jsonPath: .status.egressNode - name: Node - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1698,93 +1450,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - ipRanges - - nodeSelector - properties: - ipRanges: - type: array - items: - type: object - oneOf: - - required: - - cidr - - required: - - start - - end - properties: - cidr: - type: string - format: cidr - start: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - end: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - nodeSelector: - type: object - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - type: array - type: object - type: array - matchLabels: - x-kubernetes-preserve-unknown-fields: true - status: - type: object - properties: - usage: - type: object - properties: - total: - type: integer - used: - type: integer - additionalPrinterColumns: - - description: The number of total IPs - jsonPath: .status.usage.total - name: Total - type: integer - - description: The number of allocated IPs - jsonPath: .status.usage.used - name: Used - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1959,120 +1624,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true diff --git a/build/yamls/antrea-eks.yml b/build/yamls/antrea-eks.yml index f80dcc1a2bf..a1d650c23c4 100644 --- a/build/yamls/antrea-eks.yml +++ b/build/yamls/antrea-eks.yml @@ -311,123 +311,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1359,137 +1242,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - appliedTo - oneOf: - - anyOf: - - required: - - egressIP - - required: - - externalIPPool - - anyOf: - - required: - - egressIPs - - required: - - externalIPPools - properties: - appliedTo: - type: object - properties: - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - egressIP: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - egressIPs: - type: array - items: - type: string - oneOf: - - maxLength: 0 - - format: ipv4 - - format: ipv6 - externalIPPool: - type: string - externalIPPools: - type: array - items: - type: string - status: - type: object - properties: - egressNode: - type: string - egressIP: - type: string - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - reason: - type: string - message: - type: string - additionalPrinterColumns: - - description: The effective SNAT IP address for the selected workloads. - jsonPath: .status.egressIP - name: EgressIP - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: The Owner Node of egress IP - jsonPath: .status.egressNode - name: Node - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1711,93 +1463,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - ipRanges - - nodeSelector - properties: - ipRanges: - type: array - items: - type: object - oneOf: - - required: - - cidr - - required: - - start - - end - properties: - cidr: - type: string - format: cidr - start: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - end: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - nodeSelector: - type: object - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - type: array - type: object - type: array - matchLabels: - x-kubernetes-preserve-unknown-fields: true - status: - type: object - properties: - usage: - type: object - properties: - total: - type: integer - used: - type: integer - additionalPrinterColumns: - - description: The number of total IPs - jsonPath: .status.usage.total - name: Total - type: integer - - description: The number of allocated IPs - jsonPath: .status.usage.used - name: Used - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1976,120 +1641,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -5813,7 +5364,7 @@ webhooks: rules: - operations: ["CREATE", "UPDATE"] apiGroups: ["crd.antrea.io"] - apiVersions: ["v1alpha2"] + apiVersions: ["v1beta1"] resources: ["egresses"] scope: "Cluster" admissionReviewVersions: ["v1", "v1beta1"] diff --git a/build/yamls/antrea-gke.yml b/build/yamls/antrea-gke.yml index 868bb683fd9..a327292d4d6 100644 --- a/build/yamls/antrea-gke.yml +++ b/build/yamls/antrea-gke.yml @@ -311,123 +311,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1359,137 +1242,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - appliedTo - oneOf: - - anyOf: - - required: - - egressIP - - required: - - externalIPPool - - anyOf: - - required: - - egressIPs - - required: - - externalIPPools - properties: - appliedTo: - type: object - properties: - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - egressIP: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - egressIPs: - type: array - items: - type: string - oneOf: - - maxLength: 0 - - format: ipv4 - - format: ipv6 - externalIPPool: - type: string - externalIPPools: - type: array - items: - type: string - status: - type: object - properties: - egressNode: - type: string - egressIP: - type: string - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - reason: - type: string - message: - type: string - additionalPrinterColumns: - - description: The effective SNAT IP address for the selected workloads. - jsonPath: .status.egressIP - name: EgressIP - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: The Owner Node of egress IP - jsonPath: .status.egressNode - name: Node - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1711,93 +1463,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - ipRanges - - nodeSelector - properties: - ipRanges: - type: array - items: - type: object - oneOf: - - required: - - cidr - - required: - - start - - end - properties: - cidr: - type: string - format: cidr - start: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - end: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - nodeSelector: - type: object - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - type: array - type: object - type: array - matchLabels: - x-kubernetes-preserve-unknown-fields: true - status: - type: object - properties: - usage: - type: object - properties: - total: - type: integer - used: - type: integer - additionalPrinterColumns: - - description: The number of total IPs - jsonPath: .status.usage.total - name: Total - type: integer - - description: The number of allocated IPs - jsonPath: .status.usage.used - name: Used - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1976,120 +1641,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -5810,7 +5361,7 @@ webhooks: rules: - operations: ["CREATE", "UPDATE"] apiGroups: ["crd.antrea.io"] - apiVersions: ["v1alpha2"] + apiVersions: ["v1beta1"] resources: ["egresses"] scope: "Cluster" admissionReviewVersions: ["v1", "v1beta1"] diff --git a/build/yamls/antrea-ipsec.yml b/build/yamls/antrea-ipsec.yml index b3343af3a8c..91c70a3868c 100644 --- a/build/yamls/antrea-ipsec.yml +++ b/build/yamls/antrea-ipsec.yml @@ -311,123 +311,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1359,137 +1242,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - appliedTo - oneOf: - - anyOf: - - required: - - egressIP - - required: - - externalIPPool - - anyOf: - - required: - - egressIPs - - required: - - externalIPPools - properties: - appliedTo: - type: object - properties: - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - egressIP: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - egressIPs: - type: array - items: - type: string - oneOf: - - maxLength: 0 - - format: ipv4 - - format: ipv6 - externalIPPool: - type: string - externalIPPools: - type: array - items: - type: string - status: - type: object - properties: - egressNode: - type: string - egressIP: - type: string - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - reason: - type: string - message: - type: string - additionalPrinterColumns: - - description: The effective SNAT IP address for the selected workloads. - jsonPath: .status.egressIP - name: EgressIP - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: The Owner Node of egress IP - jsonPath: .status.egressNode - name: Node - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1711,93 +1463,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - ipRanges - - nodeSelector - properties: - ipRanges: - type: array - items: - type: object - oneOf: - - required: - - cidr - - required: - - start - - end - properties: - cidr: - type: string - format: cidr - start: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - end: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - nodeSelector: - type: object - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - type: array - type: object - type: array - matchLabels: - x-kubernetes-preserve-unknown-fields: true - status: - type: object - properties: - usage: - type: object - properties: - total: - type: integer - used: - type: integer - additionalPrinterColumns: - - description: The number of total IPs - jsonPath: .status.usage.total - name: Total - type: integer - - description: The number of allocated IPs - jsonPath: .status.usage.used - name: Used - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1976,120 +1641,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -5869,7 +5420,7 @@ webhooks: rules: - operations: ["CREATE", "UPDATE"] apiGroups: ["crd.antrea.io"] - apiVersions: ["v1alpha2"] + apiVersions: ["v1beta1"] resources: ["egresses"] scope: "Cluster" admissionReviewVersions: ["v1", "v1beta1"] diff --git a/build/yamls/antrea.yml b/build/yamls/antrea.yml index 9398dc29a58..f166e30f9f1 100644 --- a/build/yamls/antrea.yml +++ b/build/yamls/antrea.yml @@ -311,123 +311,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1359,137 +1242,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - appliedTo - oneOf: - - anyOf: - - required: - - egressIP - - required: - - externalIPPool - - anyOf: - - required: - - egressIPs - - required: - - externalIPPools - properties: - appliedTo: - type: object - properties: - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - matchLabels: - x-kubernetes-preserve-unknown-fields: true - egressIP: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - egressIPs: - type: array - items: - type: string - oneOf: - - maxLength: 0 - - format: ipv4 - - format: ipv6 - externalIPPool: - type: string - externalIPPools: - type: array - items: - type: string - status: - type: object - properties: - egressNode: - type: string - egressIP: - type: string - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - reason: - type: string - message: - type: string - additionalPrinterColumns: - - description: The effective SNAT IP address for the selected workloads. - jsonPath: .status.egressIP - name: EgressIP - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: The Owner Node of egress IP - jsonPath: .status.egressNode - name: Node - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1711,93 +1463,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha2 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - required: - - spec - properties: - spec: - type: object - required: - - ipRanges - - nodeSelector - properties: - ipRanges: - type: array - items: - type: object - oneOf: - - required: - - cidr - - required: - - start - - end - properties: - cidr: - type: string - format: cidr - start: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - end: - type: string - oneOf: - - format: ipv4 - - format: ipv6 - nodeSelector: - type: object - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - items: - type: string - pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$" - type: array - type: object - type: array - matchLabels: - x-kubernetes-preserve-unknown-fields: true - status: - type: object - properties: - usage: - type: object - properties: - total: - type: integer - used: - type: integer - additionalPrinterColumns: - - description: The number of total IPs - jsonPath: .status.usage.total - name: Total - type: integer - - description: The number of allocated IPs - jsonPath: .status.usage.used - name: Used - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -1976,120 +1641,6 @@ metadata: spec: group: crd.antrea.io versions: - - name: v1alpha3 - served: true - storage: false - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - childGroups: - type: array - items: - type: string - podSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - namespaceSelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - externalEntitySelector: - type: object - properties: - matchExpressions: - type: array - items: - type: object - properties: - key: - type: string - operator: - enum: - - In - - NotIn - - Exists - - DoesNotExist - type: string - values: - type: array - items: - type: string - matchLabels: - x-kubernetes-preserve-unknown-fields: true - ipBlocks: - type: array - items: - type: object - properties: - cidr: - type: string - format: cidr - serviceReference: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - type: array - items: - type: object - properties: - type: - type: string - status: - type: string - lastTransitionTime: - type: string - subresources: - status: {} - name: v1beta1 served: true storage: true @@ -5810,7 +5361,7 @@ webhooks: rules: - operations: ["CREATE", "UPDATE"] apiGroups: ["crd.antrea.io"] - apiVersions: ["v1alpha2"] + apiVersions: ["v1beta1"] resources: ["egresses"] scope: "Cluster" admissionReviewVersions: ["v1", "v1beta1"] diff --git a/docs/api.md b/docs/api.md index b963f389927..fc71aab4723 100644 --- a/docs/api.md +++ b/docs/api.md @@ -28,17 +28,13 @@ These are the CRDs currently available in `crd.antrea.io`. |---|---|---|---|---| | `AntreaAgentInfo` | v1beta1 | v1.0.0 | N/A | N/A | | `AntreaControllerInfo` | v1beta1 | v1.0.0 | N/A | N/A | -| `ClusterGroup` | v1alpha3 | v1.1.0 | v1.13.0 | N/A | | `ClusterGroup` | v1beta1 | v1.13.0 | N/A | N/A | | `ClusterNetworkPolicy` | v1beta1 | v1.13.0 | N/A | N/A | -| `Egress` | v1alpha2 | v1.0.0 | N/A | N/A | | `Egress` | v1beta1 | v1.13.0 | N/A | N/A | | `ExternalEntity` | v1alpha2 | v1.0.0 | N/A | N/A | -| `ExternalIPPool` | v1alpha2 | v1.2.0 | v1.13.0 | N/A | | `ExternalIPPool` | v1beta1 | v1.13.0 | N/A | N/A | | `ExternalNode` | v1alpha1 | v1.8.0 | N/A | N/A | | `IPPool`| v1alpha2 | v1.4.0 | N/A | N/A | -| `Group` | v1alpha3 | v1.8.0 | v1.13.0 | N/A | | `Group` | v1beta1 | v1.13.0 | N/A | N/A | | `NetworkPolicy` | v1beta1 | v1.13.0 | N/A | N/A | | `SupportBundleCollection` | v1alpha1 | v1.10.0 | N/A | N/A | @@ -78,8 +74,12 @@ 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 | +| `ClusterGroup` | v1alpha3 | v1.1.0 | v1.13.0 | v2.0.0 | | `ClusterNetworkPolicy` | v1alpha1 | v1.0.0 | v1.13.0 | v2.0.0 | +| `Egress` | v1alpha2 | v1.0.0 | v1.13.0 | v2.0.0 | | `ExternalEntity` | v1alpha1 | v0.10.0 | v0.11.0 | v2.0.0 | +| `ExternalIPPool` | v1alpha2 | v1.2.0 | v1.13.0 | v2.0.0 | +| `Group` | v1alpha3 | v1.8.0 | v1.13.0 | v2.0.0 | | `NetworkPolicy` | v1alpha1 | v1.0.0 | v1.13.0 | v2.0.0 | | `Tier` | v1alpha1 | v1.0.0 | v1.13.0 | v2.0.0 | | `Traceflow` | v1alpha1 | v1.0.0 | v1.13.0 | v2.0.0 | diff --git a/hack/update-codegen-dockerized.sh b/hack/update-codegen-dockerized.sh index 0ae6569eef0..204a5201325 100755 --- a/hack/update-codegen-dockerized.sh +++ b/hack/update-codegen-dockerized.sh @@ -95,7 +95,6 @@ function generate_antrea_client_code { --input "system/v1beta1" \ --input "crd/v1alpha1" \ --input "crd/v1alpha2" \ - --input "crd/v1alpha3" \ --input "crd/v1beta1" \ --input "stats/v1alpha1" \ --output-package "${ANTREA_PKG}/pkg/client/clientset" \ @@ -110,7 +109,6 @@ function generate_antrea_client_code { $GOPATH/bin/lister-gen \ --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1alpha1" \ --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1alpha2" \ - --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1alpha3" \ --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1beta1" \ --output-package "${ANTREA_PKG}/pkg/client/listers" \ --go-header-file hack/boilerplate/license_header.go.txt @@ -119,7 +117,6 @@ function generate_antrea_client_code { $GOPATH/bin/informer-gen \ --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1alpha1" \ --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1alpha2" \ - --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1alpha3" \ --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1beta1" \ --versioned-clientset-package "${ANTREA_PKG}/pkg/client/clientset/versioned" \ --listers-package "${ANTREA_PKG}/pkg/client/listers" \ @@ -132,7 +129,6 @@ function generate_antrea_client_code { --input-dirs "${ANTREA_PKG}/pkg/apis/system/v1beta1" \ --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1alpha1" \ --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1alpha2" \ - --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1alpha3" \ --input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1beta1" \ --input-dirs "${ANTREA_PKG}/pkg/apis/stats" \ --input-dirs "${ANTREA_PKG}/pkg/apis/stats/v1alpha1" \ diff --git a/pkg/apis/crd/v1alpha2/register.go b/pkg/apis/crd/v1alpha2/register.go index 56e0777d2f7..0f47477115e 100644 --- a/pkg/apis/crd/v1alpha2/register.go +++ b/pkg/apis/crd/v1alpha2/register.go @@ -46,10 +46,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &ExternalEntity{}, &ExternalEntityList{}, - &Egress{}, - &EgressList{}, - &ExternalIPPool{}, - &ExternalIPPoolList{}, &IPPool{}, &IPPoolList{}, &TrafficControl{}, diff --git a/pkg/apis/crd/v1alpha2/types.go b/pkg/apis/crd/v1alpha2/types.go index ad67d8004bd..37578504ded 100644 --- a/pkg/apis/crd/v1alpha2/types.go +++ b/pkg/apis/crd/v1alpha2/types.go @@ -96,136 +96,6 @@ type AppliedTo struct { // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// Egress defines which egress (SNAT) IP the traffic from the selected Pods to -// the external network should use. -type Egress struct { - metav1.TypeMeta `json:",inline"` - // Standard metadata of the object. - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Specification of the desired behavior of Egress. - Spec EgressSpec `json:"spec"` - - // EgressStatus represents the current status of an Egress. - Status EgressStatus `json:"status"` -} - -// EgressStatus represents the current status of an Egress. -type EgressStatus struct { - // The name of the Node that holds the Egress IP. - EgressNode string `json:"egressNode"` - // EgressIP indicates the effective Egress IP for the selected workloads. It could be empty if the Egress IP in spec - // is not assigned to any Node. It's also useful when there are more than one Egress IP specified in spec. - EgressIP string `json:"egressIP"` - - Conditions []EgressCondition `json:"conditions,omitempty"` -} - -type EgressConditionType string - -const ( - // IPAllocated means at least one IP has been allocated to the Egress from ExternalIPPool. - // It is not applicable for Egresses with empty ExternalIPPool. - IPAllocated EgressConditionType = "IPAllocated" - // IPAssigned means the Egress has been assigned to a Node. - // It is not applicable for Egresses with empty ExternalIPPool. - IPAssigned EgressConditionType = "IPAssigned" -) - -type EgressCondition struct { - Type EgressConditionType `json:"type"` - Status v1.ConditionStatus `json:"status"` - LastTransitionTime metav1.Time `json:"lastTransitionTime"` - Reason string `json:"reason,omitempty"` - Message string `json:"message,omitempty"` -} - -// EgressSpec defines the desired state for Egress. -type EgressSpec struct { - // AppliedTo selects Pods to which the Egress will be applied. - AppliedTo AppliedTo `json:"appliedTo"` - // EgressIP specifies the SNAT IP address for the selected workloads. - // If ExternalIPPool is empty, it must be specified manually. - // If ExternalIPPool is non-empty, it can be empty and will be assigned by Antrea automatically. - // If both ExternalIPPool and EgressIP are non-empty, the IP must be in the pool. - EgressIP string `json:"egressIP,omitempty"` - // EgressIPs specifies multiple SNAT IP addresses for the selected workloads. - // Cannot be set with EgressIP. - EgressIPs []string `json:"egressIPs,omitempty"` - // ExternalIPPool specifies the IP Pool that the EgressIP should be allocated from. - // If it is empty, the specified EgressIP must be assigned to a Node manually. - // If it is non-empty, the EgressIP will be assigned to a Node specified by the pool automatically and will failover - // to a different Node when the Node becomes unreachable. - ExternalIPPool string `json:"externalIPPool,omitempty"` - // ExternalIPPools specifies multiple unique IP Pools that the EgressIPs should be allocated from. Entries with the - // same index in EgressIPs and ExternalIPPools are correlated. - // Cannot be set with ExternalIPPool. - ExternalIPPools []string `json:"externalIPPools,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type EgressList struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - Items []Egress `json:"items"` -} - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ExternalIPPool defines one or multiple IP sets that can be used in the external network. For instance, the IPs can be -// allocated to the Egress resources as the Egress IPs. -type ExternalIPPool struct { - metav1.TypeMeta `json:",inline"` - // Standard metadata of the object. - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Specification of the ExternalIPPool. - Spec ExternalIPPoolSpec `json:"spec"` - - // The current status of the ExternalIPPool. - Status ExternalIPPoolStatus `json:"status"` -} - -type ExternalIPPoolSpec struct { - // The IP ranges of this IP pool, e.g. 10.10.0.0/24, 10.10.10.2-10.10.10.20, 10.10.10.30-10.10.10.30. - IPRanges []IPRange `json:"ipRanges"` - // The Nodes that the external IPs can be assigned to. If empty, it means all Nodes. - NodeSelector metav1.LabelSelector `json:"nodeSelector"` -} - -// IPRange is a set of contiguous IP addresses, represented by a CIDR or a pair of start and end IPs. -type IPRange struct { - // The CIDR of this range, e.g. 10.10.10.0/24. - CIDR string `json:"cidr,omitempty"` - // The start IP of the range, e.g. 10.10.20.5, inclusive. - Start string `json:"start,omitempty"` - // The end IP of the range, e.g. 10.10.20.20, inclusive. - End string `json:"end,omitempty"` -} - -type ExternalIPPoolStatus struct { - Usage IPPoolUsage `json:"usage,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type ExternalIPPoolList struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - Items []ExternalIPPool `json:"items"` -} - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - // IPPool defines one or multiple IP sets that can be used for flexible IPAM feature. For instance, the IPs can be // allocated to Pods according to IP pool specified in Deployment annotation. type IPPool struct { @@ -247,6 +117,16 @@ const ( IPv6 = IPVersion(6) ) +// IPRange is a set of contiguous IP addresses, represented by a CIDR or a pair of start and end IPs. +type IPRange struct { + // The CIDR of this range, e.g. 10.10.10.0/24. + CIDR string `json:"cidr,omitempty"` + // The start IP of the range, e.g. 10.10.20.5, inclusive. + Start string `json:"start,omitempty"` + // The end IP of the range, e.g. 10.10.20.20, inclusive. + End string `json:"end,omitempty"` +} + type IPPoolSpec struct { // IP Version for this IP pool - either 4 or 6 IPVersion IPVersion `json:"ipVersion"` diff --git a/pkg/apis/crd/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/crd/v1alpha2/zz_generated.deepcopy.go index faacef4a4f1..9ba6d61b486 100644 --- a/pkg/apis/crd/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/crd/v1alpha2/zz_generated.deepcopy.go @@ -91,134 +91,6 @@ func (in *ERSPANTunnel) DeepCopy() *ERSPANTunnel { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Egress) DeepCopyInto(out *Egress) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Egress. -func (in *Egress) DeepCopy() *Egress { - if in == nil { - return nil - } - out := new(Egress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Egress) 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 *EgressCondition) DeepCopyInto(out *EgressCondition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EgressCondition. -func (in *EgressCondition) DeepCopy() *EgressCondition { - if in == nil { - return nil - } - out := new(EgressCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EgressList) DeepCopyInto(out *EgressList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Egress, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EgressList. -func (in *EgressList) DeepCopy() *EgressList { - if in == nil { - return nil - } - out := new(EgressList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *EgressList) 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 *EgressSpec) DeepCopyInto(out *EgressSpec) { - *out = *in - in.AppliedTo.DeepCopyInto(&out.AppliedTo) - if in.EgressIPs != nil { - in, out := &in.EgressIPs, &out.EgressIPs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ExternalIPPools != nil { - in, out := &in.ExternalIPPools, &out.ExternalIPPools - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EgressSpec. -func (in *EgressSpec) DeepCopy() *EgressSpec { - if in == nil { - return nil - } - out := new(EgressSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EgressStatus) DeepCopyInto(out *EgressStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]EgressCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EgressStatus. -func (in *EgressStatus) DeepCopy() *EgressStatus { - if in == nil { - return nil - } - out := new(EgressStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = *in @@ -321,106 +193,6 @@ func (in *ExternalEntitySpec) DeepCopy() *ExternalEntitySpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalIPPool) DeepCopyInto(out *ExternalIPPool) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalIPPool. -func (in *ExternalIPPool) DeepCopy() *ExternalIPPool { - if in == nil { - return nil - } - out := new(ExternalIPPool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ExternalIPPool) 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 *ExternalIPPoolList) DeepCopyInto(out *ExternalIPPoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ExternalIPPool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalIPPoolList. -func (in *ExternalIPPoolList) DeepCopy() *ExternalIPPoolList { - if in == nil { - return nil - } - out := new(ExternalIPPoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ExternalIPPoolList) 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 *ExternalIPPoolSpec) DeepCopyInto(out *ExternalIPPoolSpec) { - *out = *in - if in.IPRanges != nil { - in, out := &in.IPRanges, &out.IPRanges - *out = make([]IPRange, len(*in)) - copy(*out, *in) - } - in.NodeSelector.DeepCopyInto(&out.NodeSelector) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalIPPoolSpec. -func (in *ExternalIPPoolSpec) DeepCopy() *ExternalIPPoolSpec { - if in == nil { - return nil - } - out := new(ExternalIPPoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalIPPoolStatus) DeepCopyInto(out *ExternalIPPoolStatus) { - *out = *in - out.Usage = in.Usage - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalIPPoolStatus. -func (in *ExternalIPPoolStatus) DeepCopy() *ExternalIPPoolStatus { - if in == nil { - return nil - } - out := new(ExternalIPPoolStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GRETunnel) DeepCopyInto(out *GRETunnel) { *out = *in diff --git a/pkg/apis/crd/v1alpha3/doc.go b/pkg/apis/crd/v1alpha3/doc.go deleted file mode 100644 index 42fa8ee6b46..00000000000 --- a/pkg/apis/crd/v1alpha3/doc.go +++ /dev/null @@ -1,18 +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. - -// +k8s:deepcopy-gen=package -// +groupName=crd.antrea.io - -package v1alpha3 // import "antrea.io/antrea/pkg/apis/crd/v1alpha3" diff --git a/pkg/apis/crd/v1alpha3/register.go b/pkg/apis/crd/v1alpha3/register.go deleted file mode 100644 index a163d967408..00000000000 --- a/pkg/apis/crd/v1alpha3/register.go +++ /dev/null @@ -1,55 +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. - -package v1alpha3 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name used in this package. -const GroupName = "crd.antrea.io" - -// SchemeGroupVersion is group version used to register these objects. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha3"} - -// 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 = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &ClusterGroup{}, - &ClusterGroupList{}, - &Group{}, - &GroupList{}, - ) - - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/pkg/apis/crd/v1alpha3/types.go b/pkg/apis/crd/v1alpha3/types.go deleted file mode 100644 index e6c73f8253b..00000000000 --- a/pkg/apis/crd/v1alpha3/types.go +++ /dev/null @@ -1,128 +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. - -package v1alpha3 - -import ( - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "antrea.io/antrea/pkg/apis/crd/v1alpha1" -) - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type ClusterGroup struct { - metav1.TypeMeta `json:",inline"` - // Standard metadata of the object. - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Desired state of the group. - Spec GroupSpec `json:"spec"` - // Most recently observed status of the group. - Status GroupStatus `json:"status"` -} - -type GroupSpec struct { - // Select Pods matching the labels set in the PodSelector in - // AppliedTo/To/From fields. If set with NamespaceSelector, Pods are - // matched from Namespaces matched by the NamespaceSelector. - // Cannot be set with any other selector except NamespaceSelector. - // +optional - PodSelector *metav1.LabelSelector `json:"podSelector,omitempty"` - // Select all Pods from Namespaces matched by this selector, as - // workloads in AppliedTo/To/From fields. If set with PodSelector, - // Pods are matched from Namespaces matched by the NamespaceSelector. - // Cannot be set with any other selector except PodSelector. - // +optional - NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` - // IPBlocks describe the IPAddresses/IPBlocks that are matched in to/from. - // IPBlocks cannot be set as part of the AppliedTo field. - // Cannot be set with any other selector or ServiceReference. - // +optional - IPBlocks []v1alpha1.IPBlock `json:"ipBlocks,omitempty"` - // Select backend Pods of the referred Service. - // Cannot be set with any other selector or ipBlock. - // +optional - ServiceReference *v1alpha1.NamespacedName `json:"serviceReference,omitempty"` - // Select ExternalEntities from all Namespaces as workloads - // in AppliedTo/To/From fields. If set with NamespaceSelector, - // ExternalEntities are matched from Namespaces matched by the - // NamespaceSelector. - // Cannot be set with any other selector except NamespaceSelector. - // +optional - ExternalEntitySelector *metav1.LabelSelector `json:"externalEntitySelector,omitempty"` - // Select other ClusterGroups by name. The ClusterGroups must already - // exist and must not contain ChildGroups themselves. - // Cannot be set with any selector/IPBlock/ServiceReference. - // +optional - ChildGroups []ClusterGroupReference `json:"childGroups,omitempty"` -} - -type GroupConditionType string - -const GroupMembersComputed GroupConditionType = "GroupMembersComputed" - -type GroupCondition struct { - Type GroupConditionType `json:"type"` - Status v1.ConditionStatus `json:"status"` - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` -} - -// GroupStatus represents information about the status of a Group. -type GroupStatus struct { - Conditions []GroupCondition `json:"conditions,omitempty"` -} - -// ClusterGroupReference represent reference to a ClusterGroup. -type ClusterGroupReference string - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type ClusterGroupList struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - Items []ClusterGroup `json:"items,omitempty"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Group can be used in AntreaNetworkPolicies. When used with AppliedTo, it cannot include NamespaceSelector, -// otherwise, Antrea will not realize the NetworkPolicy or rule, but will just update the NetworkPolicy -// Status as "Unrealizable". -type Group struct { - metav1.TypeMeta `json:",inline"` - // Standard metadata of the object. - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Desired state of the group. - Spec GroupSpec `json:"spec"` - // Most recently observed status of the group. - Status GroupStatus `json:"status"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type GroupList struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - Items []Group `json:"items,omitempty"` -} diff --git a/pkg/apis/crd/v1alpha3/zz_generated.deepcopy.go b/pkg/apis/crd/v1alpha3/zz_generated.deepcopy.go deleted file mode 100644 index 6b37b1db00a..00000000000 --- a/pkg/apis/crd/v1alpha3/zz_generated.deepcopy.go +++ /dev/null @@ -1,234 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Copyright 2022 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 deepcopy-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterGroup) DeepCopyInto(out *ClusterGroup) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterGroup. -func (in *ClusterGroup) DeepCopy() *ClusterGroup { - if in == nil { - return nil - } - out := new(ClusterGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterGroup) 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 *ClusterGroupList) DeepCopyInto(out *ClusterGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterGroupList. -func (in *ClusterGroupList) DeepCopy() *ClusterGroupList { - if in == nil { - return nil - } - out := new(ClusterGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterGroupList) 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 *Group) DeepCopyInto(out *Group) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Group. -func (in *Group) DeepCopy() *Group { - if in == nil { - return nil - } - out := new(Group) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Group) 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 *GroupCondition) DeepCopyInto(out *GroupCondition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupCondition. -func (in *GroupCondition) DeepCopy() *GroupCondition { - if in == nil { - return nil - } - out := new(GroupCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GroupList) DeepCopyInto(out *GroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Group, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupList. -func (in *GroupList) DeepCopy() *GroupList { - if in == nil { - return nil - } - out := new(GroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GroupList) 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 *GroupSpec) DeepCopyInto(out *GroupSpec) { - *out = *in - if in.PodSelector != nil { - in, out := &in.PodSelector, &out.PodSelector - *out = new(v1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.NamespaceSelector != nil { - in, out := &in.NamespaceSelector, &out.NamespaceSelector - *out = new(v1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.IPBlocks != nil { - in, out := &in.IPBlocks, &out.IPBlocks - *out = make([]v1alpha1.IPBlock, len(*in)) - copy(*out, *in) - } - if in.ServiceReference != nil { - in, out := &in.ServiceReference, &out.ServiceReference - *out = new(v1alpha1.NamespacedName) - **out = **in - } - if in.ExternalEntitySelector != nil { - in, out := &in.ExternalEntitySelector, &out.ExternalEntitySelector - *out = new(v1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.ChildGroups != nil { - in, out := &in.ChildGroups, &out.ChildGroups - *out = make([]ClusterGroupReference, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupSpec. -func (in *GroupSpec) DeepCopy() *GroupSpec { - if in == nil { - return nil - } - out := new(GroupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GroupStatus) DeepCopyInto(out *GroupStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]GroupCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupStatus. -func (in *GroupStatus) DeepCopy() *GroupStatus { - if in == nil { - return nil - } - out := new(GroupStatus) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index f1ce57ca0f3..5c546c32190 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -1,4 +1,4 @@ -// 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. @@ -23,7 +23,6 @@ import ( controlplanev1beta2 "antrea.io/antrea/pkg/client/clientset/versioned/typed/controlplane/v1beta2" crdv1alpha1 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1alpha1" crdv1alpha2 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1alpha2" - crdv1alpha3 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1alpha3" crdv1beta1 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1beta1" statsv1alpha1 "antrea.io/antrea/pkg/client/clientset/versioned/typed/stats/v1alpha1" systemv1beta1 "antrea.io/antrea/pkg/client/clientset/versioned/typed/system/v1beta1" @@ -37,7 +36,6 @@ type Interface interface { ControlplaneV1beta2() controlplanev1beta2.ControlplaneV1beta2Interface CrdV1alpha1() crdv1alpha1.CrdV1alpha1Interface CrdV1alpha2() crdv1alpha2.CrdV1alpha2Interface - CrdV1alpha3() crdv1alpha3.CrdV1alpha3Interface CrdV1beta1() crdv1beta1.CrdV1beta1Interface StatsV1alpha1() statsv1alpha1.StatsV1alpha1Interface SystemV1beta1() systemv1beta1.SystemV1beta1Interface @@ -49,7 +47,6 @@ type Clientset struct { controlplaneV1beta2 *controlplanev1beta2.ControlplaneV1beta2Client crdV1alpha1 *crdv1alpha1.CrdV1alpha1Client crdV1alpha2 *crdv1alpha2.CrdV1alpha2Client - crdV1alpha3 *crdv1alpha3.CrdV1alpha3Client crdV1beta1 *crdv1beta1.CrdV1beta1Client statsV1alpha1 *statsv1alpha1.StatsV1alpha1Client systemV1beta1 *systemv1beta1.SystemV1beta1Client @@ -70,11 +67,6 @@ func (c *Clientset) CrdV1alpha2() crdv1alpha2.CrdV1alpha2Interface { return c.crdV1alpha2 } -// CrdV1alpha3 retrieves the CrdV1alpha3Client -func (c *Clientset) CrdV1alpha3() crdv1alpha3.CrdV1alpha3Interface { - return c.crdV1alpha3 -} - // CrdV1beta1 retrieves the CrdV1beta1Client func (c *Clientset) CrdV1beta1() crdv1beta1.CrdV1beta1Interface { return c.crdV1beta1 @@ -146,10 +138,6 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.crdV1alpha3, err = crdv1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } cs.crdV1beta1, err = crdv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -186,7 +174,6 @@ func New(c rest.Interface) *Clientset { cs.controlplaneV1beta2 = controlplanev1beta2.New(c) cs.crdV1alpha1 = crdv1alpha1.New(c) cs.crdV1alpha2 = crdv1alpha2.New(c) - cs.crdV1alpha3 = crdv1alpha3.New(c) cs.crdV1beta1 = crdv1beta1.New(c) cs.statsV1alpha1 = statsv1alpha1.New(c) cs.systemV1beta1 = systemv1beta1.New(c) diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 65a7f173715..8a845283643 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_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. @@ -24,8 +24,6 @@ import ( fakecrdv1alpha1 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake" crdv1alpha2 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1alpha2" fakecrdv1alpha2 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake" - crdv1alpha3 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1alpha3" - fakecrdv1alpha3 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake" crdv1beta1 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1beta1" fakecrdv1beta1 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1beta1/fake" statsv1alpha1 "antrea.io/antrea/pkg/client/clientset/versioned/typed/stats/v1alpha1" @@ -104,11 +102,6 @@ func (c *Clientset) CrdV1alpha2() crdv1alpha2.CrdV1alpha2Interface { return &fakecrdv1alpha2.FakeCrdV1alpha2{Fake: &c.Fake} } -// CrdV1alpha3 retrieves the CrdV1alpha3Client -func (c *Clientset) CrdV1alpha3() crdv1alpha3.CrdV1alpha3Interface { - return &fakecrdv1alpha3.FakeCrdV1alpha3{Fake: &c.Fake} -} - // CrdV1beta1 retrieves the CrdV1beta1Client func (c *Clientset) CrdV1beta1() crdv1beta1.CrdV1beta1Interface { return &fakecrdv1beta1.FakeCrdV1beta1{Fake: &c.Fake} diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 354fb746729..d18a4f56630 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.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. @@ -20,7 +20,6 @@ import ( controlplanev1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" crdv1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" crdv1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - crdv1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" crdv1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" statsv1alpha1 "antrea.io/antrea/pkg/apis/stats/v1alpha1" systemv1beta1 "antrea.io/antrea/pkg/apis/system/v1beta1" @@ -38,7 +37,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ controlplanev1beta2.AddToScheme, crdv1alpha1.AddToScheme, crdv1alpha2.AddToScheme, - crdv1alpha3.AddToScheme, crdv1beta1.AddToScheme, statsv1alpha1.AddToScheme, systemv1beta1.AddToScheme, diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 5781d53645c..214d60fd5ac 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.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. @@ -20,7 +20,6 @@ import ( controlplanev1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" crdv1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" crdv1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - crdv1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" crdv1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" statsv1alpha1 "antrea.io/antrea/pkg/apis/stats/v1alpha1" systemv1beta1 "antrea.io/antrea/pkg/apis/system/v1beta1" @@ -38,7 +37,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ controlplanev1beta2.AddToScheme, crdv1alpha1.AddToScheme, crdv1alpha2.AddToScheme, - crdv1alpha3.AddToScheme, crdv1beta1.AddToScheme, statsv1alpha1.AddToScheme, systemv1beta1.AddToScheme, diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/crd_client.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/crd_client.go index a688d2d2816..210fe1702c1 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/crd_client.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha2/crd_client.go @@ -26,9 +26,7 @@ import ( type CrdV1alpha2Interface interface { RESTClient() rest.Interface - EgressesGetter ExternalEntitiesGetter - ExternalIPPoolsGetter IPPoolsGetter TrafficControlsGetter } @@ -38,18 +36,10 @@ type CrdV1alpha2Client struct { restClient rest.Interface } -func (c *CrdV1alpha2Client) Egresses() EgressInterface { - return newEgresses(c) -} - func (c *CrdV1alpha2Client) ExternalEntities(namespace string) ExternalEntityInterface { return newExternalEntities(c, namespace) } -func (c *CrdV1alpha2Client) ExternalIPPools() ExternalIPPoolInterface { - return newExternalIPPools(c) -} - func (c *CrdV1alpha2Client) IPPools() IPPoolInterface { return newIPPools(c) } diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/egress.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/egress.go deleted file mode 100644 index 52326a2f0ce..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/egress.go +++ /dev/null @@ -1,182 +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 v1alpha2 - -import ( - "context" - "time" - - v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - 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" -) - -// EgressesGetter has a method to return a EgressInterface. -// A group's client should implement this interface. -type EgressesGetter interface { - Egresses() EgressInterface -} - -// EgressInterface has methods to work with Egress resources. -type EgressInterface interface { - Create(ctx context.Context, egress *v1alpha2.Egress, opts v1.CreateOptions) (*v1alpha2.Egress, error) - Update(ctx context.Context, egress *v1alpha2.Egress, opts v1.UpdateOptions) (*v1alpha2.Egress, error) - UpdateStatus(ctx context.Context, egress *v1alpha2.Egress, opts v1.UpdateOptions) (*v1alpha2.Egress, 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) (*v1alpha2.Egress, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.EgressList, 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 *v1alpha2.Egress, err error) - EgressExpansion -} - -// egresses implements EgressInterface -type egresses struct { - client rest.Interface -} - -// newEgresses returns a Egresses -func newEgresses(c *CrdV1alpha2Client) *egresses { - return &egresses{ - client: c.RESTClient(), - } -} - -// Get takes name of the egress, and returns the corresponding egress object, and an error if there is any. -func (c *egresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.Egress, err error) { - result = &v1alpha2.Egress{} - err = c.client.Get(). - Resource("egresses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Egresses that match those selectors. -func (c *egresses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.EgressList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.EgressList{} - err = c.client.Get(). - Resource("egresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested egresses. -func (c *egresses) 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("egresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a egress and creates it. Returns the server's representation of the egress, and an error, if there is any. -func (c *egresses) Create(ctx context.Context, egress *v1alpha2.Egress, opts v1.CreateOptions) (result *v1alpha2.Egress, err error) { - result = &v1alpha2.Egress{} - err = c.client.Post(). - Resource("egresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(egress). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a egress and updates it. Returns the server's representation of the egress, and an error, if there is any. -func (c *egresses) Update(ctx context.Context, egress *v1alpha2.Egress, opts v1.UpdateOptions) (result *v1alpha2.Egress, err error) { - result = &v1alpha2.Egress{} - err = c.client.Put(). - Resource("egresses"). - Name(egress.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(egress). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *egresses) UpdateStatus(ctx context.Context, egress *v1alpha2.Egress, opts v1.UpdateOptions) (result *v1alpha2.Egress, err error) { - result = &v1alpha2.Egress{} - err = c.client.Put(). - Resource("egresses"). - Name(egress.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(egress). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the egress and deletes it. Returns an error if one occurs. -func (c *egresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("egresses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *egresses) 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("egresses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched egress. -func (c *egresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.Egress, err error) { - result = &v1alpha2.Egress{} - err = c.client.Patch(pt). - Resource("egresses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/externalippool.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/externalippool.go deleted file mode 100644 index 3717dbdb6a6..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/externalippool.go +++ /dev/null @@ -1,182 +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 v1alpha2 - -import ( - "context" - "time" - - v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - 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" -) - -// ExternalIPPoolsGetter has a method to return a ExternalIPPoolInterface. -// A group's client should implement this interface. -type ExternalIPPoolsGetter interface { - ExternalIPPools() ExternalIPPoolInterface -} - -// ExternalIPPoolInterface has methods to work with ExternalIPPool resources. -type ExternalIPPoolInterface interface { - Create(ctx context.Context, externalIPPool *v1alpha2.ExternalIPPool, opts v1.CreateOptions) (*v1alpha2.ExternalIPPool, error) - Update(ctx context.Context, externalIPPool *v1alpha2.ExternalIPPool, opts v1.UpdateOptions) (*v1alpha2.ExternalIPPool, error) - UpdateStatus(ctx context.Context, externalIPPool *v1alpha2.ExternalIPPool, opts v1.UpdateOptions) (*v1alpha2.ExternalIPPool, 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) (*v1alpha2.ExternalIPPool, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ExternalIPPoolList, 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 *v1alpha2.ExternalIPPool, err error) - ExternalIPPoolExpansion -} - -// externalIPPools implements ExternalIPPoolInterface -type externalIPPools struct { - client rest.Interface -} - -// newExternalIPPools returns a ExternalIPPools -func newExternalIPPools(c *CrdV1alpha2Client) *externalIPPools { - return &externalIPPools{ - client: c.RESTClient(), - } -} - -// Get takes name of the externalIPPool, and returns the corresponding externalIPPool object, and an error if there is any. -func (c *externalIPPools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ExternalIPPool, err error) { - result = &v1alpha2.ExternalIPPool{} - err = c.client.Get(). - Resource("externalippools"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ExternalIPPools that match those selectors. -func (c *externalIPPools) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ExternalIPPoolList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ExternalIPPoolList{} - err = c.client.Get(). - Resource("externalippools"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested externalIPPools. -func (c *externalIPPools) 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("externalippools"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a externalIPPool and creates it. Returns the server's representation of the externalIPPool, and an error, if there is any. -func (c *externalIPPools) Create(ctx context.Context, externalIPPool *v1alpha2.ExternalIPPool, opts v1.CreateOptions) (result *v1alpha2.ExternalIPPool, err error) { - result = &v1alpha2.ExternalIPPool{} - err = c.client.Post(). - Resource("externalippools"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(externalIPPool). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a externalIPPool and updates it. Returns the server's representation of the externalIPPool, and an error, if there is any. -func (c *externalIPPools) Update(ctx context.Context, externalIPPool *v1alpha2.ExternalIPPool, opts v1.UpdateOptions) (result *v1alpha2.ExternalIPPool, err error) { - result = &v1alpha2.ExternalIPPool{} - err = c.client.Put(). - Resource("externalippools"). - Name(externalIPPool.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(externalIPPool). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *externalIPPools) UpdateStatus(ctx context.Context, externalIPPool *v1alpha2.ExternalIPPool, opts v1.UpdateOptions) (result *v1alpha2.ExternalIPPool, err error) { - result = &v1alpha2.ExternalIPPool{} - err = c.client.Put(). - Resource("externalippools"). - Name(externalIPPool.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(externalIPPool). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the externalIPPool and deletes it. Returns an error if one occurs. -func (c *externalIPPools) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("externalippools"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *externalIPPools) 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("externalippools"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched externalIPPool. -func (c *externalIPPools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ExternalIPPool, err error) { - result = &v1alpha2.ExternalIPPool{} - err = c.client.Patch(pt). - Resource("externalippools"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_crd_client.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_crd_client.go index 37c4d039032..9066478c12a 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_crd_client.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_crd_client.go @@ -26,18 +26,10 @@ type FakeCrdV1alpha2 struct { *testing.Fake } -func (c *FakeCrdV1alpha2) Egresses() v1alpha2.EgressInterface { - return &FakeEgresses{c} -} - func (c *FakeCrdV1alpha2) ExternalEntities(namespace string) v1alpha2.ExternalEntityInterface { return &FakeExternalEntities{c, namespace} } -func (c *FakeCrdV1alpha2) ExternalIPPools() v1alpha2.ExternalIPPoolInterface { - return &FakeExternalIPPools{c} -} - func (c *FakeCrdV1alpha2) IPPools() v1alpha2.IPPoolInterface { return &FakeIPPools{c} } diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_egress.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_egress.go deleted file mode 100644 index d860fcf738f..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_egress.go +++ /dev/null @@ -1,130 +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" - - v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - 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" -) - -// FakeEgresses implements EgressInterface -type FakeEgresses struct { - Fake *FakeCrdV1alpha2 -} - -var egressesResource = v1alpha2.SchemeGroupVersion.WithResource("egresses") - -var egressesKind = v1alpha2.SchemeGroupVersion.WithKind("Egress") - -// Get takes name of the egress, and returns the corresponding egress object, and an error if there is any. -func (c *FakeEgresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.Egress, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(egressesResource, name), &v1alpha2.Egress{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Egress), err -} - -// List takes label and field selectors, and returns the list of Egresses that match those selectors. -func (c *FakeEgresses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.EgressList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(egressesResource, egressesKind, opts), &v1alpha2.EgressList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.EgressList{ListMeta: obj.(*v1alpha2.EgressList).ListMeta} - for _, item := range obj.(*v1alpha2.EgressList).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 egresses. -func (c *FakeEgresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(egressesResource, opts)) -} - -// Create takes the representation of a egress and creates it. Returns the server's representation of the egress, and an error, if there is any. -func (c *FakeEgresses) Create(ctx context.Context, egress *v1alpha2.Egress, opts v1.CreateOptions) (result *v1alpha2.Egress, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(egressesResource, egress), &v1alpha2.Egress{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Egress), err -} - -// Update takes the representation of a egress and updates it. Returns the server's representation of the egress, and an error, if there is any. -func (c *FakeEgresses) Update(ctx context.Context, egress *v1alpha2.Egress, opts v1.UpdateOptions) (result *v1alpha2.Egress, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(egressesResource, egress), &v1alpha2.Egress{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Egress), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeEgresses) UpdateStatus(ctx context.Context, egress *v1alpha2.Egress, opts v1.UpdateOptions) (*v1alpha2.Egress, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(egressesResource, "status", egress), &v1alpha2.Egress{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Egress), err -} - -// Delete takes name of the egress and deletes it. Returns an error if one occurs. -func (c *FakeEgresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(egressesResource, name, opts), &v1alpha2.Egress{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeEgresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(egressesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.EgressList{}) - return err -} - -// Patch applies the patch and returns the patched egress. -func (c *FakeEgresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.Egress, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(egressesResource, name, pt, data, subresources...), &v1alpha2.Egress{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Egress), err -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalippool.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalippool.go deleted file mode 100644 index c4c59f79043..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalippool.go +++ /dev/null @@ -1,130 +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" - - v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - 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" -) - -// FakeExternalIPPools implements ExternalIPPoolInterface -type FakeExternalIPPools struct { - Fake *FakeCrdV1alpha2 -} - -var externalippoolsResource = v1alpha2.SchemeGroupVersion.WithResource("externalippools") - -var externalippoolsKind = v1alpha2.SchemeGroupVersion.WithKind("ExternalIPPool") - -// Get takes name of the externalIPPool, and returns the corresponding externalIPPool object, and an error if there is any. -func (c *FakeExternalIPPools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ExternalIPPool, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(externalippoolsResource, name), &v1alpha2.ExternalIPPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.ExternalIPPool), err -} - -// List takes label and field selectors, and returns the list of ExternalIPPools that match those selectors. -func (c *FakeExternalIPPools) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ExternalIPPoolList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(externalippoolsResource, externalippoolsKind, opts), &v1alpha2.ExternalIPPoolList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.ExternalIPPoolList{ListMeta: obj.(*v1alpha2.ExternalIPPoolList).ListMeta} - for _, item := range obj.(*v1alpha2.ExternalIPPoolList).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 externalIPPools. -func (c *FakeExternalIPPools) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(externalippoolsResource, opts)) -} - -// Create takes the representation of a externalIPPool and creates it. Returns the server's representation of the externalIPPool, and an error, if there is any. -func (c *FakeExternalIPPools) Create(ctx context.Context, externalIPPool *v1alpha2.ExternalIPPool, opts v1.CreateOptions) (result *v1alpha2.ExternalIPPool, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(externalippoolsResource, externalIPPool), &v1alpha2.ExternalIPPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.ExternalIPPool), err -} - -// Update takes the representation of a externalIPPool and updates it. Returns the server's representation of the externalIPPool, and an error, if there is any. -func (c *FakeExternalIPPools) Update(ctx context.Context, externalIPPool *v1alpha2.ExternalIPPool, opts v1.UpdateOptions) (result *v1alpha2.ExternalIPPool, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(externalippoolsResource, externalIPPool), &v1alpha2.ExternalIPPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.ExternalIPPool), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeExternalIPPools) UpdateStatus(ctx context.Context, externalIPPool *v1alpha2.ExternalIPPool, opts v1.UpdateOptions) (*v1alpha2.ExternalIPPool, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(externalippoolsResource, "status", externalIPPool), &v1alpha2.ExternalIPPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.ExternalIPPool), err -} - -// Delete takes name of the externalIPPool and deletes it. Returns an error if one occurs. -func (c *FakeExternalIPPools) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(externalippoolsResource, name, opts), &v1alpha2.ExternalIPPool{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeExternalIPPools) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(externalippoolsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.ExternalIPPoolList{}) - return err -} - -// Patch applies the patch and returns the patched externalIPPool. -func (c *FakeExternalIPPools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ExternalIPPool, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(externalippoolsResource, name, pt, data, subresources...), &v1alpha2.ExternalIPPool{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.ExternalIPPool), err -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/generated_expansion.go index fab8277a83c..f69d4f9709c 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha2/generated_expansion.go @@ -16,12 +16,8 @@ package v1alpha2 -type EgressExpansion interface{} - type ExternalEntityExpansion interface{} -type ExternalIPPoolExpansion interface{} - type IPPoolExpansion interface{} type TrafficControlExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/clustergroup.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/clustergroup.go deleted file mode 100644 index 66fc7ce49dd..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/clustergroup.go +++ /dev/null @@ -1,182 +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 v1alpha3 - -import ( - "context" - "time" - - v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" - 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" -) - -// ClusterGroupsGetter has a method to return a ClusterGroupInterface. -// A group's client should implement this interface. -type ClusterGroupsGetter interface { - ClusterGroups() ClusterGroupInterface -} - -// ClusterGroupInterface has methods to work with ClusterGroup resources. -type ClusterGroupInterface interface { - Create(ctx context.Context, clusterGroup *v1alpha3.ClusterGroup, opts v1.CreateOptions) (*v1alpha3.ClusterGroup, error) - Update(ctx context.Context, clusterGroup *v1alpha3.ClusterGroup, opts v1.UpdateOptions) (*v1alpha3.ClusterGroup, error) - UpdateStatus(ctx context.Context, clusterGroup *v1alpha3.ClusterGroup, opts v1.UpdateOptions) (*v1alpha3.ClusterGroup, 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) (*v1alpha3.ClusterGroup, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ClusterGroupList, 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 *v1alpha3.ClusterGroup, err error) - ClusterGroupExpansion -} - -// clusterGroups implements ClusterGroupInterface -type clusterGroups struct { - client rest.Interface -} - -// newClusterGroups returns a ClusterGroups -func newClusterGroups(c *CrdV1alpha3Client) *clusterGroups { - return &clusterGroups{ - client: c.RESTClient(), - } -} - -// Get takes name of the clusterGroup, and returns the corresponding clusterGroup object, and an error if there is any. -func (c *clusterGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ClusterGroup, err error) { - result = &v1alpha3.ClusterGroup{} - err = c.client.Get(). - Resource("clustergroups"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterGroups that match those selectors. -func (c *clusterGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ClusterGroupList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha3.ClusterGroupList{} - err = c.client.Get(). - Resource("clustergroups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterGroups. -func (c *clusterGroups) 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("clustergroups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterGroup and creates it. Returns the server's representation of the clusterGroup, and an error, if there is any. -func (c *clusterGroups) Create(ctx context.Context, clusterGroup *v1alpha3.ClusterGroup, opts v1.CreateOptions) (result *v1alpha3.ClusterGroup, err error) { - result = &v1alpha3.ClusterGroup{} - err = c.client.Post(). - Resource("clustergroups"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterGroup). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterGroup and updates it. Returns the server's representation of the clusterGroup, and an error, if there is any. -func (c *clusterGroups) Update(ctx context.Context, clusterGroup *v1alpha3.ClusterGroup, opts v1.UpdateOptions) (result *v1alpha3.ClusterGroup, err error) { - result = &v1alpha3.ClusterGroup{} - err = c.client.Put(). - Resource("clustergroups"). - Name(clusterGroup.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterGroup). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusterGroups) UpdateStatus(ctx context.Context, clusterGroup *v1alpha3.ClusterGroup, opts v1.UpdateOptions) (result *v1alpha3.ClusterGroup, err error) { - result = &v1alpha3.ClusterGroup{} - err = c.client.Put(). - Resource("clustergroups"). - Name(clusterGroup.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterGroup). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterGroup and deletes it. Returns an error if one occurs. -func (c *clusterGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clustergroups"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterGroups) 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("clustergroups"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterGroup. -func (c *clusterGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ClusterGroup, err error) { - result = &v1alpha3.ClusterGroup{} - err = c.client.Patch(pt). - Resource("clustergroups"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/crd_client.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/crd_client.go deleted file mode 100644 index 5819e722649..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/crd_client.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2022 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 v1alpha3 - -import ( - "net/http" - - v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" - "antrea.io/antrea/pkg/client/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -type CrdV1alpha3Interface interface { - RESTClient() rest.Interface - ClusterGroupsGetter - GroupsGetter -} - -// CrdV1alpha3Client is used to interact with features provided by the crd.antrea.io group. -type CrdV1alpha3Client struct { - restClient rest.Interface -} - -func (c *CrdV1alpha3Client) ClusterGroups() ClusterGroupInterface { - return newClusterGroups(c) -} - -func (c *CrdV1alpha3Client) Groups(namespace string) GroupInterface { - return newGroups(c, namespace) -} - -// NewForConfig creates a new CrdV1alpha3Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*CrdV1alpha3Client, 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 CrdV1alpha3Client 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) (*CrdV1alpha3Client, 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 &CrdV1alpha3Client{client}, nil -} - -// NewForConfigOrDie creates a new CrdV1alpha3Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CrdV1alpha3Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new CrdV1alpha3Client for the given RESTClient. -func New(c rest.Interface) *CrdV1alpha3Client { - return &CrdV1alpha3Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha3.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 *CrdV1alpha3Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/doc.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/doc.go deleted file mode 100644 index 7ef94bbb3fa..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/doc.go +++ /dev/null @@ -1,18 +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. - -// This package has the automatically generated typed clients. -package v1alpha3 diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/doc.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/doc.go deleted file mode 100644 index 5807b680f75..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/doc.go +++ /dev/null @@ -1,18 +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 fake has the automatically generated clients. -package fake diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_clustergroup.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_clustergroup.go deleted file mode 100644 index 7a2f9c174e2..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_clustergroup.go +++ /dev/null @@ -1,130 +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" - - v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" - 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" -) - -// FakeClusterGroups implements ClusterGroupInterface -type FakeClusterGroups struct { - Fake *FakeCrdV1alpha3 -} - -var clustergroupsResource = v1alpha3.SchemeGroupVersion.WithResource("clustergroups") - -var clustergroupsKind = v1alpha3.SchemeGroupVersion.WithKind("ClusterGroup") - -// Get takes name of the clusterGroup, and returns the corresponding clusterGroup object, and an error if there is any. -func (c *FakeClusterGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ClusterGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustergroupsResource, name), &v1alpha3.ClusterGroup{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.ClusterGroup), err -} - -// List takes label and field selectors, and returns the list of ClusterGroups that match those selectors. -func (c *FakeClusterGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ClusterGroupList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustergroupsResource, clustergroupsKind, opts), &v1alpha3.ClusterGroupList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.ClusterGroupList{ListMeta: obj.(*v1alpha3.ClusterGroupList).ListMeta} - for _, item := range obj.(*v1alpha3.ClusterGroupList).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 clusterGroups. -func (c *FakeClusterGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clustergroupsResource, opts)) -} - -// Create takes the representation of a clusterGroup and creates it. Returns the server's representation of the clusterGroup, and an error, if there is any. -func (c *FakeClusterGroups) Create(ctx context.Context, clusterGroup *v1alpha3.ClusterGroup, opts v1.CreateOptions) (result *v1alpha3.ClusterGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustergroupsResource, clusterGroup), &v1alpha3.ClusterGroup{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.ClusterGroup), err -} - -// Update takes the representation of a clusterGroup and updates it. Returns the server's representation of the clusterGroup, and an error, if there is any. -func (c *FakeClusterGroups) Update(ctx context.Context, clusterGroup *v1alpha3.ClusterGroup, opts v1.UpdateOptions) (result *v1alpha3.ClusterGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustergroupsResource, clusterGroup), &v1alpha3.ClusterGroup{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.ClusterGroup), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterGroups) UpdateStatus(ctx context.Context, clusterGroup *v1alpha3.ClusterGroup, opts v1.UpdateOptions) (*v1alpha3.ClusterGroup, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clustergroupsResource, "status", clusterGroup), &v1alpha3.ClusterGroup{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.ClusterGroup), err -} - -// Delete takes name of the clusterGroup and deletes it. Returns an error if one occurs. -func (c *FakeClusterGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clustergroupsResource, name, opts), &v1alpha3.ClusterGroup{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustergroupsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.ClusterGroupList{}) - return err -} - -// Patch applies the patch and returns the patched clusterGroup. -func (c *FakeClusterGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ClusterGroup, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustergroupsResource, name, pt, data, subresources...), &v1alpha3.ClusterGroup{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.ClusterGroup), err -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_crd_client.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_crd_client.go deleted file mode 100644 index 5f2f3c9e3aa..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_crd_client.go +++ /dev/null @@ -1,42 +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 fake - -import ( - v1alpha3 "antrea.io/antrea/pkg/client/clientset/versioned/typed/crd/v1alpha3" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeCrdV1alpha3 struct { - *testing.Fake -} - -func (c *FakeCrdV1alpha3) ClusterGroups() v1alpha3.ClusterGroupInterface { - return &FakeClusterGroups{c} -} - -func (c *FakeCrdV1alpha3) Groups(namespace string) v1alpha3.GroupInterface { - return &FakeGroups{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCrdV1alpha3) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_group.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_group.go deleted file mode 100644 index 433ad34dbb2..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_group.go +++ /dev/null @@ -1,139 +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" - - v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" - 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" -) - -// FakeGroups implements GroupInterface -type FakeGroups struct { - Fake *FakeCrdV1alpha3 - ns string -} - -var groupsResource = v1alpha3.SchemeGroupVersion.WithResource("groups") - -var groupsKind = v1alpha3.SchemeGroupVersion.WithKind("Group") - -// Get takes name of the group, and returns the corresponding group object, and an error if there is any. -func (c *FakeGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.Group, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(groupsResource, c.ns, name), &v1alpha3.Group{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.Group), err -} - -// List takes label and field selectors, and returns the list of Groups that match those selectors. -func (c *FakeGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.GroupList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(groupsResource, groupsKind, c.ns, opts), &v1alpha3.GroupList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.GroupList{ListMeta: obj.(*v1alpha3.GroupList).ListMeta} - for _, item := range obj.(*v1alpha3.GroupList).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 groups. -func (c *FakeGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(groupsResource, c.ns, opts)) - -} - -// Create takes the representation of a group and creates it. Returns the server's representation of the group, and an error, if there is any. -func (c *FakeGroups) Create(ctx context.Context, group *v1alpha3.Group, opts v1.CreateOptions) (result *v1alpha3.Group, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(groupsResource, c.ns, group), &v1alpha3.Group{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.Group), err -} - -// Update takes the representation of a group and updates it. Returns the server's representation of the group, and an error, if there is any. -func (c *FakeGroups) Update(ctx context.Context, group *v1alpha3.Group, opts v1.UpdateOptions) (result *v1alpha3.Group, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(groupsResource, c.ns, group), &v1alpha3.Group{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.Group), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGroups) UpdateStatus(ctx context.Context, group *v1alpha3.Group, opts v1.UpdateOptions) (*v1alpha3.Group, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(groupsResource, "status", c.ns, group), &v1alpha3.Group{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.Group), err -} - -// Delete takes name of the group and deletes it. Returns an error if one occurs. -func (c *FakeGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(groupsResource, c.ns, name, opts), &v1alpha3.Group{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(groupsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.GroupList{}) - return err -} - -// Patch applies the patch and returns the patched group. -func (c *FakeGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.Group, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(groupsResource, c.ns, name, pt, data, subresources...), &v1alpha3.Group{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha3.Group), err -} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/generated_expansion.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/generated_expansion.go deleted file mode 100644 index 45cd1122756..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/generated_expansion.go +++ /dev/null @@ -1,21 +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 v1alpha3 - -type ClusterGroupExpansion interface{} - -type GroupExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/group.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/group.go deleted file mode 100644 index dbf44ea4ba0..00000000000 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/group.go +++ /dev/null @@ -1,193 +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 v1alpha3 - -import ( - "context" - "time" - - v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" - 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" -) - -// GroupsGetter has a method to return a GroupInterface. -// A group's client should implement this interface. -type GroupsGetter interface { - Groups(namespace string) GroupInterface -} - -// GroupInterface has methods to work with Group resources. -type GroupInterface interface { - Create(ctx context.Context, group *v1alpha3.Group, opts v1.CreateOptions) (*v1alpha3.Group, error) - Update(ctx context.Context, group *v1alpha3.Group, opts v1.UpdateOptions) (*v1alpha3.Group, error) - UpdateStatus(ctx context.Context, group *v1alpha3.Group, opts v1.UpdateOptions) (*v1alpha3.Group, 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) (*v1alpha3.Group, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.GroupList, 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 *v1alpha3.Group, err error) - GroupExpansion -} - -// groups implements GroupInterface -type groups struct { - client rest.Interface - ns string -} - -// newGroups returns a Groups -func newGroups(c *CrdV1alpha3Client, namespace string) *groups { - return &groups{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the group, and returns the corresponding group object, and an error if there is any. -func (c *groups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.Group, err error) { - result = &v1alpha3.Group{} - err = c.client.Get(). - Namespace(c.ns). - Resource("groups"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Groups that match those selectors. -func (c *groups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.GroupList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha3.GroupList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("groups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested groups. -func (c *groups) 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("groups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a group and creates it. Returns the server's representation of the group, and an error, if there is any. -func (c *groups) Create(ctx context.Context, group *v1alpha3.Group, opts v1.CreateOptions) (result *v1alpha3.Group, err error) { - result = &v1alpha3.Group{} - err = c.client.Post(). - Namespace(c.ns). - Resource("groups"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(group). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a group and updates it. Returns the server's representation of the group, and an error, if there is any. -func (c *groups) Update(ctx context.Context, group *v1alpha3.Group, opts v1.UpdateOptions) (result *v1alpha3.Group, err error) { - result = &v1alpha3.Group{} - err = c.client.Put(). - Namespace(c.ns). - Resource("groups"). - Name(group.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(group). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *groups) UpdateStatus(ctx context.Context, group *v1alpha3.Group, opts v1.UpdateOptions) (result *v1alpha3.Group, err error) { - result = &v1alpha3.Group{} - err = c.client.Put(). - Namespace(c.ns). - Resource("groups"). - Name(group.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(group). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the group and deletes it. Returns an error if one occurs. -func (c *groups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("groups"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *groups) 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("groups"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched group. -func (c *groups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.Group, err error) { - result = &v1alpha3.Group{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("groups"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/informers/externalversions/crd/interface.go b/pkg/client/informers/externalversions/crd/interface.go index 35f21f51d74..54cf7dd55e1 100644 --- a/pkg/client/informers/externalversions/crd/interface.go +++ b/pkg/client/informers/externalversions/crd/interface.go @@ -1,4 +1,4 @@ -// Copyright 2021 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. @@ -19,7 +19,6 @@ package crd import ( v1alpha1 "antrea.io/antrea/pkg/client/informers/externalversions/crd/v1alpha1" v1alpha2 "antrea.io/antrea/pkg/client/informers/externalversions/crd/v1alpha2" - v1alpha3 "antrea.io/antrea/pkg/client/informers/externalversions/crd/v1alpha3" v1beta1 "antrea.io/antrea/pkg/client/informers/externalversions/crd/v1beta1" internalinterfaces "antrea.io/antrea/pkg/client/informers/externalversions/internalinterfaces" ) @@ -30,8 +29,6 @@ type Interface interface { V1alpha1() v1alpha1.Interface // V1alpha2 provides access to shared informers for resources in V1alpha2. V1alpha2() v1alpha2.Interface - // V1alpha3 provides access to shared informers for resources in V1alpha3. - V1alpha3() v1alpha3.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } @@ -57,11 +54,6 @@ func (g *group) V1alpha2() v1alpha2.Interface { return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) } -// V1alpha3 returns a new v1alpha3.Interface. -func (g *group) V1alpha3() v1alpha3.Interface { - return v1alpha3.New(g.factory, g.namespace, g.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/pkg/client/informers/externalversions/crd/v1alpha2/egress.go b/pkg/client/informers/externalversions/crd/v1alpha2/egress.go deleted file mode 100644 index 36cb1d1c4f8..00000000000 --- a/pkg/client/informers/externalversions/crd/v1alpha2/egress.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 v1alpha2 - -import ( - "context" - time "time" - - crdv1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - versioned "antrea.io/antrea/pkg/client/clientset/versioned" - internalinterfaces "antrea.io/antrea/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "antrea.io/antrea/pkg/client/listers/crd/v1alpha2" - 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" -) - -// EgressInformer provides access to a shared informer and lister for -// Egresses. -type EgressInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha2.EgressLister -} - -type egressInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewEgressInformer constructs a new informer for Egress 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 NewEgressInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredEgressInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredEgressInformer constructs a new informer for Egress 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 NewFilteredEgressInformer(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.CrdV1alpha2().Egresses().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CrdV1alpha2().Egresses().Watch(context.TODO(), options) - }, - }, - &crdv1alpha2.Egress{}, - resyncPeriod, - indexers, - ) -} - -func (f *egressInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredEgressInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *egressInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&crdv1alpha2.Egress{}, f.defaultInformer) -} - -func (f *egressInformer) Lister() v1alpha2.EgressLister { - return v1alpha2.NewEgressLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/crd/v1alpha2/externalippool.go b/pkg/client/informers/externalversions/crd/v1alpha2/externalippool.go deleted file mode 100644 index faa0fd0a7be..00000000000 --- a/pkg/client/informers/externalversions/crd/v1alpha2/externalippool.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 v1alpha2 - -import ( - "context" - time "time" - - crdv1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - versioned "antrea.io/antrea/pkg/client/clientset/versioned" - internalinterfaces "antrea.io/antrea/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "antrea.io/antrea/pkg/client/listers/crd/v1alpha2" - 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" -) - -// ExternalIPPoolInformer provides access to a shared informer and lister for -// ExternalIPPools. -type ExternalIPPoolInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha2.ExternalIPPoolLister -} - -type externalIPPoolInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewExternalIPPoolInformer constructs a new informer for ExternalIPPool 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 NewExternalIPPoolInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredExternalIPPoolInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredExternalIPPoolInformer constructs a new informer for ExternalIPPool 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 NewFilteredExternalIPPoolInformer(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.CrdV1alpha2().ExternalIPPools().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CrdV1alpha2().ExternalIPPools().Watch(context.TODO(), options) - }, - }, - &crdv1alpha2.ExternalIPPool{}, - resyncPeriod, - indexers, - ) -} - -func (f *externalIPPoolInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredExternalIPPoolInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *externalIPPoolInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&crdv1alpha2.ExternalIPPool{}, f.defaultInformer) -} - -func (f *externalIPPoolInformer) Lister() v1alpha2.ExternalIPPoolLister { - return v1alpha2.NewExternalIPPoolLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/crd/v1alpha2/interface.go b/pkg/client/informers/externalversions/crd/v1alpha2/interface.go index 9422cd985f1..97f8f4dbd1c 100644 --- a/pkg/client/informers/externalversions/crd/v1alpha2/interface.go +++ b/pkg/client/informers/externalversions/crd/v1alpha2/interface.go @@ -22,12 +22,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // Egresses returns a EgressInformer. - Egresses() EgressInformer // ExternalEntities returns a ExternalEntityInformer. ExternalEntities() ExternalEntityInformer - // ExternalIPPools returns a ExternalIPPoolInformer. - ExternalIPPools() ExternalIPPoolInformer // IPPools returns a IPPoolInformer. IPPools() IPPoolInformer // TrafficControls returns a TrafficControlInformer. @@ -45,21 +41,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// Egresses returns a EgressInformer. -func (v *version) Egresses() EgressInformer { - return &egressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - // ExternalEntities returns a ExternalEntityInformer. func (v *version) ExternalEntities() ExternalEntityInformer { return &externalEntityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ExternalIPPools returns a ExternalIPPoolInformer. -func (v *version) ExternalIPPools() ExternalIPPoolInformer { - return &externalIPPoolInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - // IPPools returns a IPPoolInformer. func (v *version) IPPools() IPPoolInformer { return &iPPoolInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/pkg/client/informers/externalversions/crd/v1alpha3/clustergroup.go b/pkg/client/informers/externalversions/crd/v1alpha3/clustergroup.go deleted file mode 100644 index d8f4545cc37..00000000000 --- a/pkg/client/informers/externalversions/crd/v1alpha3/clustergroup.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 v1alpha3 - -import ( - "context" - time "time" - - crdv1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" - versioned "antrea.io/antrea/pkg/client/clientset/versioned" - internalinterfaces "antrea.io/antrea/pkg/client/informers/externalversions/internalinterfaces" - v1alpha3 "antrea.io/antrea/pkg/client/listers/crd/v1alpha3" - 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" -) - -// ClusterGroupInformer provides access to a shared informer and lister for -// ClusterGroups. -type ClusterGroupInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha3.ClusterGroupLister -} - -type clusterGroupInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewClusterGroupInformer constructs a new informer for ClusterGroup 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 NewClusterGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredClusterGroupInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredClusterGroupInformer constructs a new informer for ClusterGroup 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 NewFilteredClusterGroupInformer(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.CrdV1alpha3().ClusterGroups().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CrdV1alpha3().ClusterGroups().Watch(context.TODO(), options) - }, - }, - &crdv1alpha3.ClusterGroup{}, - resyncPeriod, - indexers, - ) -} - -func (f *clusterGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredClusterGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *clusterGroupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&crdv1alpha3.ClusterGroup{}, f.defaultInformer) -} - -func (f *clusterGroupInformer) Lister() v1alpha3.ClusterGroupLister { - return v1alpha3.NewClusterGroupLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/crd/v1alpha3/group.go b/pkg/client/informers/externalversions/crd/v1alpha3/group.go deleted file mode 100644 index 408eb68b96f..00000000000 --- a/pkg/client/informers/externalversions/crd/v1alpha3/group.go +++ /dev/null @@ -1,88 +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 v1alpha3 - -import ( - "context" - time "time" - - crdv1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" - versioned "antrea.io/antrea/pkg/client/clientset/versioned" - internalinterfaces "antrea.io/antrea/pkg/client/informers/externalversions/internalinterfaces" - v1alpha3 "antrea.io/antrea/pkg/client/listers/crd/v1alpha3" - 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" -) - -// GroupInformer provides access to a shared informer and lister for -// Groups. -type GroupInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha3.GroupLister -} - -type groupInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewGroupInformer constructs a new informer for Group 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 NewGroupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredGroupInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredGroupInformer constructs a new informer for Group 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 NewFilteredGroupInformer(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.CrdV1alpha3().Groups(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CrdV1alpha3().Groups(namespace).Watch(context.TODO(), options) - }, - }, - &crdv1alpha3.Group{}, - resyncPeriod, - indexers, - ) -} - -func (f *groupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredGroupInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *groupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&crdv1alpha3.Group{}, f.defaultInformer) -} - -func (f *groupInformer) Lister() v1alpha3.GroupLister { - return v1alpha3.NewGroupLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/crd/v1alpha3/interface.go b/pkg/client/informers/externalversions/crd/v1alpha3/interface.go deleted file mode 100644 index df7fd513356..00000000000 --- a/pkg/client/informers/externalversions/crd/v1alpha3/interface.go +++ /dev/null @@ -1,50 +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 v1alpha3 - -import ( - internalinterfaces "antrea.io/antrea/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // ClusterGroups returns a ClusterGroupInformer. - ClusterGroups() ClusterGroupInformer - // Groups returns a GroupInformer. - Groups() GroupInformer -} - -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} -} - -// ClusterGroups returns a ClusterGroupInformer. -func (v *version) ClusterGroups() ClusterGroupInformer { - return &clusterGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// Groups returns a GroupInformer. -func (v *version) Groups() GroupInformer { - return &groupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 2539e5233c2..ef3f63d1380 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -21,7 +21,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" @@ -60,23 +59,13 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha1().SupportBundleCollections().Informer()}, nil // Group=crd.antrea.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithResource("egresses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha2().Egresses().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("externalentities"): return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha2().ExternalEntities().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("externalippools"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha2().ExternalIPPools().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("ippools"): return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha2().IPPools().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("trafficcontrols"): return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha2().TrafficControls().Informer()}, nil - // Group=crd.antrea.io, Version=v1alpha3 - case v1alpha3.SchemeGroupVersion.WithResource("clustergroups"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha3().ClusterGroups().Informer()}, nil - case v1alpha3.SchemeGroupVersion.WithResource("groups"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha3().Groups().Informer()}, nil - // Group=crd.antrea.io, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithResource("antreaagentinfos"): return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1beta1().AntreaAgentInfos().Informer()}, nil diff --git a/pkg/client/listers/crd/v1alpha2/egress.go b/pkg/client/listers/crd/v1alpha2/egress.go deleted file mode 100644 index 4d91310ad65..00000000000 --- a/pkg/client/listers/crd/v1alpha2/egress.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 v1alpha2 - -import ( - v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// EgressLister helps list Egresses. -// All objects returned here must be treated as read-only. -type EgressLister interface { - // List lists all Egresses in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.Egress, err error) - // Get retrieves the Egress from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.Egress, error) - EgressListerExpansion -} - -// egressLister implements the EgressLister interface. -type egressLister struct { - indexer cache.Indexer -} - -// NewEgressLister returns a new EgressLister. -func NewEgressLister(indexer cache.Indexer) EgressLister { - return &egressLister{indexer: indexer} -} - -// List lists all Egresses in the indexer. -func (s *egressLister) List(selector labels.Selector) (ret []*v1alpha2.Egress, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.Egress)) - }) - return ret, err -} - -// Get retrieves the Egress from the index for a given name. -func (s *egressLister) Get(name string) (*v1alpha2.Egress, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("egress"), name) - } - return obj.(*v1alpha2.Egress), nil -} diff --git a/pkg/client/listers/crd/v1alpha2/expansion_generated.go b/pkg/client/listers/crd/v1alpha2/expansion_generated.go index be752c2fa33..9137c36d992 100644 --- a/pkg/client/listers/crd/v1alpha2/expansion_generated.go +++ b/pkg/client/listers/crd/v1alpha2/expansion_generated.go @@ -16,10 +16,6 @@ package v1alpha2 -// EgressListerExpansion allows custom methods to be added to -// EgressLister. -type EgressListerExpansion interface{} - // ExternalEntityListerExpansion allows custom methods to be added to // ExternalEntityLister. type ExternalEntityListerExpansion interface{} @@ -28,10 +24,6 @@ type ExternalEntityListerExpansion interface{} // ExternalEntityNamespaceLister. type ExternalEntityNamespaceListerExpansion interface{} -// ExternalIPPoolListerExpansion allows custom methods to be added to -// ExternalIPPoolLister. -type ExternalIPPoolListerExpansion interface{} - // IPPoolListerExpansion allows custom methods to be added to // IPPoolLister. type IPPoolListerExpansion interface{} diff --git a/pkg/client/listers/crd/v1alpha2/externalippool.go b/pkg/client/listers/crd/v1alpha2/externalippool.go deleted file mode 100644 index c3d8ef31b7c..00000000000 --- a/pkg/client/listers/crd/v1alpha2/externalippool.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 v1alpha2 - -import ( - v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ExternalIPPoolLister helps list ExternalIPPools. -// All objects returned here must be treated as read-only. -type ExternalIPPoolLister interface { - // List lists all ExternalIPPools in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ExternalIPPool, err error) - // Get retrieves the ExternalIPPool from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ExternalIPPool, error) - ExternalIPPoolListerExpansion -} - -// externalIPPoolLister implements the ExternalIPPoolLister interface. -type externalIPPoolLister struct { - indexer cache.Indexer -} - -// NewExternalIPPoolLister returns a new ExternalIPPoolLister. -func NewExternalIPPoolLister(indexer cache.Indexer) ExternalIPPoolLister { - return &externalIPPoolLister{indexer: indexer} -} - -// List lists all ExternalIPPools in the indexer. -func (s *externalIPPoolLister) List(selector labels.Selector) (ret []*v1alpha2.ExternalIPPool, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ExternalIPPool)) - }) - return ret, err -} - -// Get retrieves the ExternalIPPool from the index for a given name. -func (s *externalIPPoolLister) Get(name string) (*v1alpha2.ExternalIPPool, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("externalippool"), name) - } - return obj.(*v1alpha2.ExternalIPPool), nil -} diff --git a/pkg/client/listers/crd/v1alpha3/clustergroup.go b/pkg/client/listers/crd/v1alpha3/clustergroup.go deleted file mode 100644 index ac569ec96c9..00000000000 --- a/pkg/client/listers/crd/v1alpha3/clustergroup.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 v1alpha3 - -import ( - v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ClusterGroupLister helps list ClusterGroups. -// All objects returned here must be treated as read-only. -type ClusterGroupLister interface { - // List lists all ClusterGroups in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha3.ClusterGroup, err error) - // Get retrieves the ClusterGroup from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha3.ClusterGroup, error) - ClusterGroupListerExpansion -} - -// clusterGroupLister implements the ClusterGroupLister interface. -type clusterGroupLister struct { - indexer cache.Indexer -} - -// NewClusterGroupLister returns a new ClusterGroupLister. -func NewClusterGroupLister(indexer cache.Indexer) ClusterGroupLister { - return &clusterGroupLister{indexer: indexer} -} - -// List lists all ClusterGroups in the indexer. -func (s *clusterGroupLister) List(selector labels.Selector) (ret []*v1alpha3.ClusterGroup, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.ClusterGroup)) - }) - return ret, err -} - -// Get retrieves the ClusterGroup from the index for a given name. -func (s *clusterGroupLister) Get(name string) (*v1alpha3.ClusterGroup, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha3.Resource("clustergroup"), name) - } - return obj.(*v1alpha3.ClusterGroup), nil -} diff --git a/pkg/client/listers/crd/v1alpha3/expansion_generated.go b/pkg/client/listers/crd/v1alpha3/expansion_generated.go deleted file mode 100644 index 78a61a92d26..00000000000 --- a/pkg/client/listers/crd/v1alpha3/expansion_generated.go +++ /dev/null @@ -1,29 +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 v1alpha3 - -// ClusterGroupListerExpansion allows custom methods to be added to -// ClusterGroupLister. -type ClusterGroupListerExpansion interface{} - -// GroupListerExpansion allows custom methods to be added to -// GroupLister. -type GroupListerExpansion interface{} - -// GroupNamespaceListerExpansion allows custom methods to be added to -// GroupNamespaceLister. -type GroupNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/crd/v1alpha3/group.go b/pkg/client/listers/crd/v1alpha3/group.go deleted file mode 100644 index 45539b7b46a..00000000000 --- a/pkg/client/listers/crd/v1alpha3/group.go +++ /dev/null @@ -1,97 +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 v1alpha3 - -import ( - v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// GroupLister helps list Groups. -// All objects returned here must be treated as read-only. -type GroupLister interface { - // List lists all Groups in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha3.Group, err error) - // Groups returns an object that can list and get Groups. - Groups(namespace string) GroupNamespaceLister - GroupListerExpansion -} - -// groupLister implements the GroupLister interface. -type groupLister struct { - indexer cache.Indexer -} - -// NewGroupLister returns a new GroupLister. -func NewGroupLister(indexer cache.Indexer) GroupLister { - return &groupLister{indexer: indexer} -} - -// List lists all Groups in the indexer. -func (s *groupLister) List(selector labels.Selector) (ret []*v1alpha3.Group, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.Group)) - }) - return ret, err -} - -// Groups returns an object that can list and get Groups. -func (s *groupLister) Groups(namespace string) GroupNamespaceLister { - return groupNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// GroupNamespaceLister helps list and get Groups. -// All objects returned here must be treated as read-only. -type GroupNamespaceLister interface { - // List lists all Groups in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha3.Group, err error) - // Get retrieves the Group from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha3.Group, error) - GroupNamespaceListerExpansion -} - -// groupNamespaceLister implements the GroupNamespaceLister -// interface. -type groupNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Groups in the indexer for a given namespace. -func (s groupNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.Group, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.Group)) - }) - return ret, err -} - -// Get retrieves the Group from the indexer for a given namespace and name. -func (s groupNamespaceLister) Get(name string) (*v1alpha3.Group, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha3.Resource("group"), name) - } - return obj.(*v1alpha3.Group), nil -} diff --git a/test/e2e/service_externalip_test.go b/test/e2e/service_externalip_test.go index 76f29bfc08f..be6303380c3 100644 --- a/test/e2e/service_externalip_test.go +++ b/test/e2e/service_externalip_test.go @@ -207,7 +207,7 @@ func testServiceExternalTrafficPolicyLocal(t *testing.T, data *TestData) { var service *v1.Service var eps *v1.Endpoints ipPool := data.createExternalIPPool(t, "test-service-pool-", tt.ipRange, nil, tt.nodeSelector.MatchExpressions, tt.nodeSelector.MatchLabels) - defer data.crdClient.CrdV1alpha2().ExternalIPPools().Delete(context.TODO(), ipPool.Name, metav1.DeleteOptions{}) + defer data.crdClient.CrdV1beta1().ExternalIPPools().Delete(context.TODO(), ipPool.Name, metav1.DeleteOptions{}) annotation := map[string]string{ antreaagenttypes.ServiceExternalIPPoolAnnotationKey: ipPool.Name, @@ -324,7 +324,7 @@ func testServiceWithExternalIPCRUD(t *testing.T, data *TestData) { var err error var service *v1.Service ipPool := data.createExternalIPPool(t, "crud-pool-", tt.ipRange, nil, tt.nodeSelector.MatchExpressions, tt.nodeSelector.MatchLabels) - defer data.crdClient.CrdV1alpha2().ExternalIPPools().Delete(context.TODO(), ipPool.Name, metav1.DeleteOptions{}) + defer data.crdClient.CrdV1beta1().ExternalIPPools().Delete(context.TODO(), ipPool.Name, metav1.DeleteOptions{}) annotation := map[string]string{ antreaagenttypes.ServiceExternalIPPoolAnnotationKey: ipPool.Name, @@ -345,7 +345,7 @@ func testServiceWithExternalIPCRUD(t *testing.T, data *TestData) { var gotUsed, gotTotal int err := wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, 2*time.Second, true, func(ctx context.Context) (done bool, err error) { - pool, err := data.crdClient.CrdV1alpha2().ExternalIPPools().Get(context.TODO(), ipPool.Name, metav1.GetOptions{}) + pool, err := data.crdClient.CrdV1beta1().ExternalIPPools().Get(context.TODO(), ipPool.Name, metav1.GetOptions{}) if err != nil { return false, fmt.Errorf("failed to get ExternalIPPool: %v", err) } @@ -415,9 +415,9 @@ func testServiceUpdateExternalIP(t *testing.T, data *TestData) { } originalPool := data.createExternalIPPool(t, "originalpool-", tt.originalIPRange, nil, nil, map[string]string{v1.LabelHostname: tt.originalNode}) - defer data.crdClient.CrdV1alpha2().ExternalIPPools().Delete(context.TODO(), originalPool.Name, metav1.DeleteOptions{}) + defer data.crdClient.CrdV1beta1().ExternalIPPools().Delete(context.TODO(), originalPool.Name, metav1.DeleteOptions{}) newPool := data.createExternalIPPool(t, "newpool-", tt.newIPRange, nil, nil, map[string]string{v1.LabelHostname: tt.newNode}) - defer data.crdClient.CrdV1alpha2().ExternalIPPools().Delete(context.TODO(), newPool.Name, metav1.DeleteOptions{}) + defer data.crdClient.CrdV1beta1().ExternalIPPools().Delete(context.TODO(), newPool.Name, metav1.DeleteOptions{}) annotation := map[string]string{ antreaagenttypes.ServiceExternalIPPoolAnnotationKey: originalPool.Name, @@ -500,7 +500,7 @@ func testServiceNodeFailure(t *testing.T, data *TestData) { }, } externalIPPoolTwoNodes := data.createExternalIPPool(t, "pool-with-two-nodes-", tt.ipRange, nil, matchExpressions, nil) - defer data.crdClient.CrdV1alpha2().ExternalIPPools().Delete(context.TODO(), externalIPPoolTwoNodes.Name, metav1.DeleteOptions{}) + defer data.crdClient.CrdV1beta1().ExternalIPPools().Delete(context.TODO(), externalIPPoolTwoNodes.Name, metav1.DeleteOptions{}) annotation := map[string]string{ antreaagenttypes.ServiceExternalIPPoolAnnotationKey: externalIPPoolTwoNodes.Name, } @@ -574,7 +574,7 @@ func testExternalIPAccess(t *testing.T, data *TestData) { nodes := []string{nodeName(0), nodeName(1)} ipRange := v1beta1.IPRange{CIDR: tt.externalIPCIDR} ipPool := data.createExternalIPPool(t, "ippool-", ipRange, nil, nil, nil) - defer data.crdClient.CrdV1alpha2().ExternalIPPools().Delete(context.TODO(), ipPool.Name, metav1.DeleteOptions{}) + defer data.crdClient.CrdV1beta1().ExternalIPPools().Delete(context.TODO(), ipPool.Name, metav1.DeleteOptions{}) agnhosts := []string{"agnhost-0", "agnhost-1"} // Create agnhost Pods on each Node. for idx, node := range nodes {