-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: nil schema check for additional properties (#94)
* fix: nil schema check for additional properties * fix linting
- Loading branch information
Showing
6 changed files
with
163 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.9.2 | ||
creationTimestamp: null | ||
name: krokcommands.delivery.krok.app | ||
spec: | ||
group: delivery.krok.app | ||
names: | ||
kind: KrokCommand | ||
listKind: KrokCommandList | ||
plural: krokcommands | ||
singular: krokcommand | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: KrokCommand is the Schema for the krokcommands API | ||
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: KrokCommandSpec defines the desired state of KrokCommand | ||
properties: | ||
annotations: | ||
additionalProperties: true | ||
description: Annotations set to all Kubernetes components | ||
type: object | ||
commandHasOutputToWrite: | ||
description: CommandHasOutputToWrite if defined, it signals the underlying | ||
Job, to put its output into a generated and created secret. | ||
type: boolean | ||
dependencies: | ||
description: Dependencies defines a list of command names that this | ||
command depends on. | ||
items: | ||
type: string | ||
type: array | ||
enabled: | ||
description: Enabled defines if this command can be executed or not. | ||
type: boolean | ||
image: | ||
description: 'Image defines the image name and tag of the command | ||
example: krok-hook/slack-notification:v0.0.1' | ||
type: string | ||
platforms: | ||
description: Platforms holds all the platforms which this command | ||
supports. | ||
items: | ||
type: string | ||
type: array | ||
readInputFromSecret: | ||
description: ReadInputFromSecret if defined, the command will take | ||
a list of key/value pairs in a secret and apply them as arguments | ||
to the command. | ||
properties: | ||
name: | ||
type: string | ||
namespace: | ||
type: string | ||
required: | ||
- name | ||
- namespace | ||
type: object | ||
schedule: | ||
description: 'Schedule of the command. example: 0 * * * * // follows | ||
cron job syntax.' | ||
type: string | ||
required: | ||
- image | ||
type: object | ||
status: | ||
description: KrokCommandStatus defines the observed state of KrokCommand | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
15 changes: 15 additions & 0 deletions
15
pkg/testdata/sample_crd_with_additional_properties_golden.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: delivery.krok.app/v1alpha1 | ||
kind: KrokCommand | ||
metadata: {} | ||
spec: | ||
annotations: {} | ||
commandHasOutputToWrite: true | ||
dependencies: ["string"] | ||
enabled: true | ||
image: string | ||
platforms: ["string"] | ||
readInputFromSecret: | ||
name: string | ||
namespace: string | ||
schedule: string | ||
status: {} |