Skip to content

Commit

Permalink
Remove port from CRD validation, fix CRDs for k8s>=1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
AMecea committed Jul 2, 2020
1 parent 7adba90 commit ce3af26
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 91 deletions.
9 changes: 8 additions & 1 deletion config/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ resources:


patchesJson6902:
#https://github.com/kubernetes/kubernetes/issues/84880
# https://github.com/kubernetes/kubernetes/issues/84880
- target:
group: apiextensions.k8s.io
version: v1beta1
kind: CustomResourceDefinition
name: wordpresses.wordpress.presslabs.org
path: patches/volume.yaml

# https://github.com/kubernetes-sigs/controller-tools/issues/444
- target:
group: apiextensions.k8s.io
version: v1beta1
kind: CustomResourceDefinition
name: wordpresses.wordpress.presslabs.org
path: patches/x-kubernetes-list-map-keys.yaml
5 changes: 5 additions & 0 deletions config/patches/x-kubernetes-list-map-keys.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- op: remove
path: /spec/validation/openAPIV3Schema/properties/spec/properties/sidecars/items/properties/ports

- op: remove
path: /spec/validation/openAPIV3Schema/properties/spec/properties/initContainers/items/properties/ports
90 changes: 0 additions & 90 deletions deploy/charts/wordpress-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1870,51 +1870,6 @@ spec:
container in a pod must have a unique name (DNS_LABEL). Cannot
be updated.
type: string
ports:
description: List of ports to expose from the container. Exposing
a port here gives the system additional information about the
network connections a container uses, but is primarily informational.
Not specifying a port here DOES NOT prevent that port from being
exposed. Any port which is listening on the default "0.0.0.0"
address inside a container will be accessible from the network.
Cannot be updated.
items:
description: ContainerPort represents a network port in a single
container.
properties:
containerPort:
description: Number of port to expose on the pod's IP address.
This must be a valid port number, 0 < x < 65536.
format: int32
type: integer
hostIP:
description: What host IP to bind the external port to.
type: string
hostPort:
description: Number of port to expose on the host. If specified,
this must be a valid port number, 0 < x < 65536. If HostNetwork
is specified, this must match ContainerPort. Most containers
do not need this.
format: int32
type: integer
name:
description: If specified, this must be an IANA_SVC_NAME
and unique within the pod. Each named port in a pod must
have a unique name. Name for the port that can be referred
to by services.
type: string
protocol:
description: Protocol for port. Must be UDP, TCP, or SCTP.
Defaults to "TCP".
type: string
required:
- containerPort
type: object
type: array
x-kubernetes-list-map-keys:
- containerPort
- protocol
x-kubernetes-list-type: map
readinessProbe:
description: 'Periodic probe of container service readiness. Container
will be removed from service endpoints if the probe fails. Cannot
Expand Down Expand Up @@ -3422,51 +3377,6 @@ spec:
container in a pod must have a unique name (DNS_LABEL). Cannot
be updated.
type: string
ports:
description: List of ports to expose from the container. Exposing
a port here gives the system additional information about the
network connections a container uses, but is primarily informational.
Not specifying a port here DOES NOT prevent that port from being
exposed. Any port which is listening on the default "0.0.0.0"
address inside a container will be accessible from the network.
Cannot be updated.
items:
description: ContainerPort represents a network port in a single
container.
properties:
containerPort:
description: Number of port to expose on the pod's IP address.
This must be a valid port number, 0 < x < 65536.
format: int32
type: integer
hostIP:
description: What host IP to bind the external port to.
type: string
hostPort:
description: Number of port to expose on the host. If specified,
this must be a valid port number, 0 < x < 65536. If HostNetwork
is specified, this must match ContainerPort. Most containers
do not need this.
format: int32
type: integer
name:
description: If specified, this must be an IANA_SVC_NAME
and unique within the pod. Each named port in a pod must
have a unique name. Name for the port that can be referred
to by services.
type: string
protocol:
description: Protocol for port. Must be UDP, TCP, or SCTP.
Defaults to "TCP".
type: string
required:
- containerPort
type: object
type: array
x-kubernetes-list-map-keys:
- containerPort
- protocol
x-kubernetes-list-type: map
readinessProbe:
description: 'Periodic probe of container service readiness. Container
will be removed from service endpoints if the probe fails. Cannot
Expand Down

0 comments on commit ce3af26

Please sign in to comment.