-
Notifications
You must be signed in to change notification settings - Fork 127
[ISSUE 57] add rocketmq api #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| apiVersion: apiextensions.k8s.io/v1beta1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| name: rocketmqs.rocketmq.apache.org | ||
| spec: | ||
| group: rocketmq.apache.org | ||
| names: | ||
| kind: Rocketmq | ||
| listKind: RocketmqList | ||
| plural: rocketmqs | ||
| singular: rocketmq | ||
| scope: Namespaced | ||
| subresources: | ||
| status: {} | ||
| validation: | ||
| openAPIV3Schema: | ||
| 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/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/api-conventions.md#types-kinds' | ||
| type: string | ||
| metadata: | ||
| type: object | ||
| spec: | ||
| properties: | ||
| broker: | ||
| description: Broker defines rocketmq broker spec info | ||
| type: object | ||
| nameService: | ||
| description: NameService defines rocketmq name service spec info | ||
| type: object | ||
| console: | ||
| description: Console defines rocketmq console deployment info | ||
| type: object | ||
| status: | ||
| properties: | ||
| nameService: | ||
| description: 'INSERT ADDITIONAL STATUS FIELD - define observed state | ||
| of cluster Important: Run "operator-sdk generate k8s" to regenerate | ||
| code after modifying this file Add custom validation using kubebuilder | ||
| tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html | ||
| NameService is the name of name service' | ||
| type: string | ||
| broker: | ||
| description: 'INSERT ADDITIONAL STATUS FIELD - define observed state | ||
| of cluster Important: Run "operator-sdk generate k8s" to regenerate | ||
| code after modifying this file Add custom validation using kubebuilder | ||
| tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html | ||
| Brokers is the name of broker' | ||
| type: string | ||
| required: | ||
| - nameService | ||
| - broker | ||
| type: object | ||
| version: v1alpha1 | ||
| versions: | ||
| - name: v1alpha1 | ||
| served: true | ||
| storage: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ metadata: | |
| spec: | ||
| type: NodePort | ||
| selector: | ||
| name_service_cr: ${rocketmq-name}-name-service | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The selector |
||
| app: rocketmq-console | ||
| ports: | ||
| - port: 8080 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CRD validation schema defines
broker,nameService, andconsoleastype: objectwith no sub-properties. This provides zero validation for nested fields, meaning any malformed spec will be accepted by the API server. At minimum, required sub-fields should be enumerated, or the full nested schemas from the Broker/NameService/Console CRDs should be inlined.