Skip to content

Commit

Permalink
CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-avery committed Sep 3, 2020
1 parent 7049157 commit 394a465
Show file tree
Hide file tree
Showing 7 changed files with 7,014 additions and 23 deletions.
13 changes: 7 additions & 6 deletions build/generate-manifests.sh
Expand Up @@ -44,11 +44,17 @@ function checkDependencies() {
}

function generateCRDs() {
#go run -mod=vendor github.com/operator-framework/operator-sdk/cmd/operator-sdk generate crds --crd-version v1
go run -mod=vendor sigs.k8s.io/controller-tools/cmd/controller-gen crd \
paths=./pkg/apis/maistra/... \
crd:maxDescLen=0,preserveUnknownFields=false,crdVersions=v1beta1 \
output:crd:dir=./deploy/crds
# workaround for https://github.com/kubernetes-sigs/controller-tools/issues/457
#sed -i -e "s/\( *\)\(description\: The IP protocol for this port\)/\1default: TCP\n\1\2/" \
# deploy/crds/maistra.io_servicemeshcontrolplanes.yaml
sed -i -e '/x-kubernetes-list-map-keys:/,/x-kubernetes-list-type: map/ { /- protocol/d }' deploy/crds/maistra.io_servicemeshcontrolplanes.yaml

# The data generated by the OLM tooling adds a number of dashes to the top that don't parse properly. This fixes it.
sed -i -e '/---/d' deploy/crds/*

mv deploy/crds/maistra.io_servicemeshcontrolplanes.yaml ${BUNDLE_DIR}/servicemeshcontrolplanes.crd.yaml
mv deploy/crds/maistra.io_servicemeshmemberrolls.yaml ${BUNDLE_DIR}/servicemeshmemberrolls.crd.yaml
Expand All @@ -62,11 +68,6 @@ function generateCRDs() {
echo -e "\n---\n" >>deploy/src/crd.yaml
cat ${BUNDLE_DIR}/servicemeshmembers.crd.yaml >>deploy/src/crd.yaml

currentDir=$(pwd)
cd ${BUNDLE_DIR}
sed -i -e '/x-kubernetes-list-map-keys:/,/x-kubernetes-list-type: map/ { /- protocol/d }' *.crd.yaml
sed -i -e '/---/d' *.crd.yaml
cd ${currentDir}
}

function generateDeploymentFile() {
Expand Down
6,715 changes: 6,715 additions & 0 deletions config/maistra.io_servicemeshcontrolplanes.yaml

Large diffs are not rendered by default.

148 changes: 148 additions & 0 deletions config/maistra.io_servicemeshmemberrolls.yaml
@@ -0,0 +1,148 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: servicemeshmemberrolls.maistra.io
spec:
additionalPrinterColumns:
- JSONPath: .status.annotations.configuredMemberCount
description: How many of the total number of member namespaces are configured
name: Ready
type: string
- JSONPath: .status.conditions[?(@.type=="Ready")].reason
description: Whether all member namespaces have been configured or why that's
not the case
name: Status
type: string
- JSONPath: .metadata.creationTimestamp
description: The age of the object
name: Age
type: date
- JSONPath: .spec.members
description: Namespaces that are members of this Control Plane
name: Members
priority: 1
type: string
group: maistra.io
names:
categories:
- maistra-io
kind: ServiceMeshMemberRoll
listKind: ServiceMeshMemberRollList
plural: servicemeshmemberrolls
shortNames:
- smmr
singular: servicemeshmemberroll
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: The ServiceMeshMemberRoll object configures which namespaces belong
to a service mesh. Only namespaces listed in the ServiceMeshMemberRoll will
be affected by the control plane. Any number of namespaces can be added, but
a namespace may not exist in more than one service mesh. The ServiceMeshMemberRoll
object must be created in the same namespace as the ServiceMeshControlPlane
object and must be named "default".
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Specification of the desired list of members of the service
mesh.
properties:
members:
description: ' List of namespaces that should be members of the service
mesh.'
items:
type: string
nullable: true
type: array
type: object
status:
description: The current status of this ServiceMeshMemberRoll. This data
may be out of date by some window of time.
properties:
annotations:
additionalProperties:
type: string
description: Annotations is an unstructured key value map used to store
additional, usually redundant status information, such as the number
of components deployed by the ServiceMeshControlPlane (number is redundant
because you could just as easily count the elements in the ComponentStatus
array). The reason to add this redundant information is to make it
available to kubectl, which does not yet allow counting objects in
JSONPath expressions.
type: object
conditions:
description: Represents the latest available observations of this ServiceMeshMemberRoll's
current state.
items:
description: Condition represents a specific condition on a resource
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
description: 'ServiceMeshMemberRollConditionType represents the
type of the condition. Condition types are: Reconciled, NamespaceConfigured'
type: string
type: object
nullable: true
type: array
configuredMembers:
description: List of namespaces that are configured as members of the
service mesh.
items:
type: string
nullable: true
type: array
meshGeneration:
description: The generation of the ServiceMeshControlPlane object observed
by the controller during the most recent reconciliation of this ServiceMeshMemberRoll.
format: int64
type: integer
meshReconciledVersion:
description: The reconciled version of the ServiceMeshControlPlane object
observed by the controller during the most recent reconciliation of
this ServiceMeshMemberRoll.
type: string
observedGeneration:
description: The generation observed by the controller during the most
recent reconciliation. The information in the status pertains to this
particular generation of the object.
format: int64
type: integer
type: object
type: object
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
143 changes: 143 additions & 0 deletions config/maistra.io_servicemeshmembers.yaml
@@ -0,0 +1,143 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: servicemeshmembers.maistra.io
spec:
additionalPrinterColumns:
- JSONPath: .status.annotations.controlPlaneRef
description: The ServiceMeshControlPlane this namespace belongs to
name: Control Plane
type: string
- JSONPath: .status.conditions[?(@.type=="Ready")].status
description: Whether or not namespace is configured as a member of the mesh.
name: Ready
type: string
- JSONPath: .metadata.creationTimestamp
description: The age of the object
name: Age
type: date
group: maistra.io
names:
categories:
- maistra-io
kind: ServiceMeshMember
listKind: ServiceMeshMemberList
plural: servicemeshmembers
shortNames:
- smm
singular: servicemeshmember
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: "A ServiceMeshMember object marks the namespace in which it lives
as a member of the Service Mesh Control Plane referenced in the object. The
ServiceMeshMember object should be created in each application namespace that
must be part of the service mesh and must be named \"default\". \n When the
ServiceMeshMember object is created, it causes the namespace to be added to
the ServiceMeshMemberRoll within the namespace of the ServiceMeshControlPlane
object the ServiceMeshMember references. \n To reference a ServiceMeshControlPlane,
the user creating the ServiceMeshMember object must have the \"use\" permission
on the referenced ServiceMeshControlPlane object. This permission is given
via the mesh-users RoleBinding (and mesh-user Role) in the namespace of the
referenced ServiceMeshControlPlane object."
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: The desired state of this ServiceMeshMember.
properties:
controlPlaneRef:
description: A reference to the ServiceMeshControlPlane object.
properties:
name:
description: The name of the referenced ServiceMeshControlPlane
object.
type: string
namespace:
description: The namespace of the referenced ServiceMeshControlPlane
object.
type: string
required:
- name
- namespace
type: object
required:
- controlPlaneRef
type: object
status:
description: The current status of this ServiceMeshMember. This data may
be out of date by some window of time.
properties:
annotations:
additionalProperties:
type: string
description: Annotations is an unstructured key value map used to store
additional, usually redundant status information, such as the number
of components deployed by the ServiceMeshControlPlane (number is redundant
because you could just as easily count the elements in the ComponentStatus
array). The reason to add this redundant information is to make it
available to kubectl, which does not yet allow counting objects in
JSONPath expressions.
type: object
conditions:
description: Represents the latest available observations of a ServiceMeshMember's
current state.
items:
description: Condition represents a specific condition on a resource
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
description: 'ServiceMeshMemberConditionType represents the type
of the condition. Condition types are: Reconciled, NamespaceConfigured'
type: string
type: object
type: array
observedGeneration:
description: The generation observed by the controller during the most
recent reconciliation. The information in the status pertains to this
particular generation of the object.
format: int64
type: integer
required:
- conditions
- observedGeneration
type: object
required:
- spec
type: object
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
8 changes: 0 additions & 8 deletions deploy/servicemesh-operator.yaml
@@ -1,6 +1,5 @@
# Autogenerated from files in deploy/src by generate-manifests.sh

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -707,7 +706,6 @@ spec:
type: array
x-kubernetes-list-map-keys:
- port
- protocol
x-kubernetes-list-type: map
publishNotReadyAddresses:
type: boolean
Expand Down Expand Up @@ -1074,7 +1072,6 @@ spec:
type: array
x-kubernetes-list-map-keys:
- port
- protocol
x-kubernetes-list-type: map
publishNotReadyAddresses:
type: boolean
Expand Down Expand Up @@ -1443,7 +1440,6 @@ spec:
type: array
x-kubernetes-list-map-keys:
- port
- protocol
x-kubernetes-list-type: map
publishNotReadyAddresses:
type: boolean
Expand Down Expand Up @@ -1773,7 +1769,6 @@ spec:
type: array
x-kubernetes-list-map-keys:
- port
- protocol
x-kubernetes-list-type: map
publishNotReadyAddresses:
type: boolean
Expand Down Expand Up @@ -2168,7 +2163,6 @@ spec:
type: array
x-kubernetes-list-map-keys:
- port
- protocol
x-kubernetes-list-type: map
publishNotReadyAddresses:
type: boolean
Expand Down Expand Up @@ -3026,7 +3020,6 @@ status:
---


---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -3138,7 +3131,6 @@ status:
---


---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down

0 comments on commit 394a465

Please sign in to comment.