Skip to content

Commit

Permalink
fix: CRD for Rabbit Stalker Helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
achetronic committed Sep 1, 2023
1 parent 496ce84 commit d0ace90
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 29 deletions.
2 changes: 1 addition & 1 deletion charts/rabbit-stalker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v2
name: rabbit-stalker
type: application
description: A Helm chart for rabbit-stalker, a Kubernetes operator to restart workloads under some conditions coming from RabbitMQ
version: 0.1.0 # chart version
version: 0.1.1 # chart version
appVersion: "1.0.0" # rabbit-stalker version
kubeVersion: ">=1.22.0-0" # kubernetes version
home: https://github.com/prosimcorp/helm-charts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,34 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: rabbit-stalker
name: patches.rabbit-stalker.prosimcorp.com
name: workloadactions.rabbit-stalker.prosimcorp.com
spec:
group: rabbit-stalker.prosimcorp.com
names:
categories:
- patches
kind: Patch
listKind: PatchList
plural: patches
singular: patch
- workloadactions
kind: WorkloadAction
listKind: WorkloadActionList
plural: workloadactions
singular: workloadaction
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="ResourcePatched")].status
- jsonPath: .status.conditions[?(@.type=="WorkloadActionReady")].status
name: Ready
type: string
- jsonPath: .status.conditions[?(@.type=="ResourcePatched")].reason
- jsonPath: .status.conditions[?(@.type=="WorkloadActionReady")].reason
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
name: v1alpha1
schema:
openAPIV3Schema:
description: Patch is the Schema for the patches API
description: 'WorkloadAction is the Schema for the workloadactions API Ref: https://book.kubebuilder.io/reference/markers/crd-validation.html'
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'
Expand All @@ -43,12 +40,16 @@ spec:
metadata:
type: object
spec:
description: PatchSpec defines the desired state of Patch
description: WorkloadActionSpec defines the desired state of WorkloadAction
properties:
patchType:
description: Similarly to above, these are constants to support HTTP PATCH utilized by both the client and server that didn't make sense for a whole package to be dedicated to.
action:
description: Action represents what to do with the workload if the condition is met
enum:
- restart
- delete
type: string
sources:
additionalSources:
description: AdditionalSources represent references to Kubernetes resources that whill be available on condition.value
items:
description: "ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, \"must refer only to types A and B\" or \"UID not honored\" or \"name must be restricted\". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control. \n Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 ."
properties:
Expand Down Expand Up @@ -76,6 +77,85 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
condition:
description: Condition represent a key/value pair found in the JSON of the HTTP response
properties:
key:
description: Key represents the field, in GJSON dot notation, to reach some point of the JSON HTTP response
type: string
value:
description: Value represents a string that must be equal to the string found on the Key
type: string
required:
- key
- value
type: object
rabbitConnection:
description: RabbitConnection represents the connection settings to connect with RabbitMQ admin API
properties:
credentials:
description: RabbitConnectionCredentialsSpec represents the credentials required to connect to RabbitMQ
properties:
password:
description: RabbitConnectionCredentialsSecretReferenceSpec TODO
properties:
secretRef:
description: SecretKeyReferenceSpec represents a reference to a Secret resource in the same namespace
properties:
key:
description: Key in the Secret.
type: string
name:
description: Name of the Secret.
type: string
namespace:
description: Namespace of the Secret.
type: string
required:
- key
- name
type: object
required:
- secretRef
type: object
username:
description: RabbitConnectionCredentialsSecretReferenceSpec TODO
properties:
secretRef:
description: SecretKeyReferenceSpec represents a reference to a Secret resource in the same namespace
properties:
key:
description: Key in the Secret.
type: string
name:
description: Name of the Secret.
type: string
namespace:
description: Namespace of the Secret.
type: string
required:
- key
- name
type: object
required:
- secretRef
type: object
required:
- password
- username
type: object
queue:
type: string
url:
type: string
useRegex:
type: boolean
vhost:
type: string
required:
- queue
- url
type: object
synchronization:
description: SynchronizationSpec defines the behavior of synchronization
properties:
Expand All @@ -84,8 +164,8 @@ spec:
required:
- time
type: object
target:
description: "ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, \"must refer only to types A and B\" or \"UID not honored\" or \"name must be restricted\". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control. \n Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 ."
workloadRef:
description: 'WorkloadRef represents a workload resource: deployment, statefulset, daemonset'
properties:
apiVersion:
description: API version of the referent.
Expand All @@ -110,17 +190,15 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
template:
type: string
required:
- patchType
- sources
- action
- condition
- rabbitConnection
- synchronization
- target
- template
- workloadRef
type: object
status:
description: PatchStatus defines the observed state of Patch
description: WorkloadActionStatus defines the observed state of WorkloadAction
properties:
conditions:
description: Conditions represent the latest available observations of an object's state
Expand Down Expand Up @@ -174,4 +252,3 @@ spec:
storage: true
subresources:
status: {}

0 comments on commit d0ace90

Please sign in to comment.