-
Notifications
You must be signed in to change notification settings - Fork 404
feat: add validation to CRD #208
Changes from 3 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,76 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: externalsecrets.kubernetes-client.io | ||
spec: | ||
group: kubernetes-client.io | ||
version: v1 | ||
scope: Namespaced | ||
|
||
names: | ||
shortNames: | ||
- es | ||
kind: ExternalSecret | ||
plural: externalsecrets | ||
singular: externalsecret | ||
|
||
additionalPrinterColumns: | ||
- JSONPath: .status.lastSync | ||
name: Last Sync | ||
type: date | ||
- JSONPath: .status.status | ||
name: status | ||
type: string | ||
- JSONPath: .metadata.creationTimestamp | ||
name: Age | ||
type: date | ||
|
||
validation: | ||
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. do you know which version of Kubernetes introduced validation for CRDs? I think we should use validation, but we might need to explicitly call out the minimum version required. 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. Seems to be available in 1.12 which is as far back as the official hosted kubernetes docs go now 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. Heres the list I was looking for https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ CustomResourceSubresources requires 1.11+ 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. awesome |
||
openAPIV3Schema: | ||
properties: | ||
spec: | ||
type: object | ||
properties: | ||
template: | ||
description: Template which will be deep merged without mutating | ||
any existing fields. into generated secret, can be used to | ||
set for example annotations or type on the generated secret | ||
type: object | ||
backendType: | ||
type: string | ||
enum: | ||
- secretsManager | ||
- systemManager | ||
- vault | ||
dataFrom: | ||
type: array | ||
items: | ||
type: string | ||
data: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
key: | ||
description: Secret key in backend | ||
type: string | ||
name: | ||
description: Name set for this key in the generated secret | ||
type: string | ||
property: | ||
description: Property to extract if secret in backend is a JSON object | ||
required: | ||
- name | ||
- key | ||
roleArn: | ||
type: string | ||
required: | ||
- backendType | ||
anyOf: | ||
- required: | ||
- data | ||
- required: | ||
- dataFrom | ||
|
||
subresources: | ||
status: {} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: kubernetes-client.io/v1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: data-from-example | ||
spec: | ||
backendType: systemManager | ||
dataFrom: | ||
- /foo/name1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
apiVersion: kubernetes-client.io/v1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: dockerhub-secret | ||
name: dockerconfig-example | ||
spec: | ||
backendType: secretsManager | ||
type: kubernetes.io/dockerconfigjson | ||
template: | ||
type: kubernetes.io/dockerconfigjson | ||
data: | ||
- key: /development/dockerhub | ||
name: .dockerconfigjson |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
apiVersion: 'kubernetes-client.io/v1' | ||
apiVersion: kubernetes-client.io/v1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: hello-service | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
external-secret: 'Yes please!' | ||
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. 😄 |
||
backendType: secretsManager | ||
data: | ||
- key: hello-service/password | ||
name: password | ||
dataFrom: | ||
- hello-service/secret-envs |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
ah, nice.