Skip to content

Commit

Permalink
feat(openshift): Support extra labels/annotations for deployments and…
Browse files Browse the repository at this point in the history
… pods

Signed-off-by: Guillaume Doussin <[email protected]>
  • Loading branch information
OpenGuidou committed Sep 28, 2023
1 parent a85a750 commit 921b242
Show file tree
Hide file tree
Showing 17 changed files with 547 additions and 73 deletions.
26 changes: 26 additions & 0 deletions api/v1beta1/cryostat_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,32 @@ type CryostatSpec struct {
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Credentials Database Options"
JmxCredentialsDatabaseOptions *JmxCredentialsDatabaseOptions `json:"jmxCredentialsDatabaseOptions,omitempty"`
// Options to configure the Cryostat deployments and pods metadata
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Operand metadata"
OperandMetadata *OperandMetadata `json:"operandMetadata,omitempty"`
}

type OperandMetadata struct {
// Options to configure the Cryostat deployments metadata
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Deployments metadata"
DeploymentMetadata *ResourceMetadata `json:"deploymentMetadata,omitempty"`
// Options to configure the Cryostat pods metadata
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Pods metadata"
PodMetadata *ResourceMetadata `json:"podMetadata,omitempty"`
}

type ResourceMetadata struct {
// Annotations to add to the resources during its creation.
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
// Labels to add to the resources during its creation.
// The labels with keys "app" and "component" are reserved
// for use by the operator.
// +optional
Labels map[string]string `json:"labels,omitempty"`
}

type ResourceConfigList struct {
Expand Down
59 changes: 59 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion bundle/manifests/cryostat-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ metadata:
capabilities: Seamless Upgrades
categories: Monitoring, Developer Tools
containerImage: quay.io/cryostat/cryostat-operator:2.4.0-dev
createdAt: "2023-09-18T15:10:18Z"
createdAt: "2023-09-28T14:25:20Z"
description: JVM monitoring and profiling tool
operatorframework.io/initialization-resource: |-
{
Expand Down Expand Up @@ -256,6 +256,15 @@ spec:
label with key "app" is reserved for use by the operator.
displayName: Labels
path: networkOptions.grafanaConfig.labels
- description: Options to configure the Cryostat deployments and pods metadata
displayName: Operand metadata
path: operandMetadata
- description: Options to configure the Cryostat deployments metadata
displayName: Deployments metadata
path: operandMetadata.deploymentMetadata
- description: Options to configure the Cryostat pods metadata
displayName: Pods metadata
path: operandMetadata.podMetadata
- description: Options to configure Cryostat Automated Report Analysis.
displayName: Report Options
path: reportOptions
Expand Down Expand Up @@ -639,6 +648,15 @@ spec:
label with key "app" is reserved for use by the operator.
displayName: Labels
path: networkOptions.grafanaConfig.labels
- description: Options to configure the Cryostat deployments and pods metadata
displayName: Operand metadata
path: operandMetadata
- description: Options to configure the Cryostat deployments metadata
displayName: Deployments metadata
path: operandMetadata.deploymentMetadata
- description: Options to configure the Cryostat pods metadata
displayName: Pods metadata
path: operandMetadata.podMetadata
- description: Options to configure Cryostat Automated Report Analysis.
displayName: Report Options
path: reportOptions
Expand Down
39 changes: 39 additions & 0 deletions bundle/manifests/operator.cryostat.io_clustercryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,45 @@ spec:
type: object
type: object
type: object
operandMetadata:
description: Options to configure the Cryostat deployments and pods
metadata
properties:
deploymentMetadata:
description: Options to configure the Cryostat deployments metadata
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its
creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
The labels with keys "app" and "component" are reserved
for use by the operator.
type: object
type: object
podMetadata:
description: Options to configure the Cryostat pods metadata
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its
creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
The labels with keys "app" and "component" are reserved
for use by the operator.
type: object
type: object
type: object
reportOptions:
description: Options to configure Cryostat Automated Report Analysis.
properties:
Expand Down
39 changes: 39 additions & 0 deletions bundle/manifests/operator.cryostat.io_cryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,45 @@ spec:
type: object
type: object
type: object
operandMetadata:
description: Options to configure the Cryostat deployments and pods
metadata
properties:
deploymentMetadata:
description: Options to configure the Cryostat deployments metadata
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its
creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
The labels with keys "app" and "component" are reserved
for use by the operator.
type: object
type: object
podMetadata:
description: Options to configure the Cryostat pods metadata
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its
creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
The labels with keys "app" and "component" are reserved
for use by the operator.
type: object
type: object
type: object
reportOptions:
description: Options to configure Cryostat Automated Report Analysis.
properties:
Expand Down
39 changes: 39 additions & 0 deletions config/crd/bases/operator.cryostat.io_clustercryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,45 @@ spec:
type: object
type: object
type: object
operandMetadata:
description: Options to configure the Cryostat deployments and pods
metadata
properties:
deploymentMetadata:
description: Options to configure the Cryostat deployments metadata
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its
creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
The labels with keys "app" and "component" are reserved
for use by the operator.
type: object
type: object
podMetadata:
description: Options to configure the Cryostat pods metadata
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its
creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
The labels with keys "app" and "component" are reserved
for use by the operator.
type: object
type: object
type: object
reportOptions:
description: Options to configure Cryostat Automated Report Analysis.
properties:
Expand Down
39 changes: 39 additions & 0 deletions config/crd/bases/operator.cryostat.io_cryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,45 @@ spec:
type: object
type: object
type: object
operandMetadata:
description: Options to configure the Cryostat deployments and pods
metadata
properties:
deploymentMetadata:
description: Options to configure the Cryostat deployments metadata
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its
creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
The labels with keys "app" and "component" are reserved
for use by the operator.
type: object
type: object
podMetadata:
description: Options to configure the Cryostat pods metadata
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its
creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
The labels with keys "app" and "component" are reserved
for use by the operator.
type: object
type: object
type: object
reportOptions:
description: Options to configure Cryostat Automated Report Analysis.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@ spec:
label with key "app" is reserved for use by the operator.
displayName: Labels
path: networkOptions.grafanaConfig.labels
- description: Options to configure the Cryostat deployments and pods metadata
displayName: Operand metadata
path: operandMetadata
- description: Options to configure the Cryostat deployments metadata
displayName: Deployments metadata
path: operandMetadata.deploymentMetadata
- description: Options to configure the Cryostat pods metadata
displayName: Pods metadata
path: operandMetadata.podMetadata
- description: Options to configure Cryostat Automated Report Analysis.
displayName: Report Options
path: reportOptions
Expand Down Expand Up @@ -577,6 +586,15 @@ spec:
label with key "app" is reserved for use by the operator.
displayName: Labels
path: networkOptions.grafanaConfig.labels
- description: Options to configure the Cryostat deployments and pods metadata
displayName: Operand metadata
path: operandMetadata
- description: Options to configure the Cryostat deployments metadata
displayName: Deployments metadata
path: operandMetadata.deploymentMetadata
- description: Options to configure the Cryostat pods metadata
displayName: Pods metadata
path: operandMetadata.podMetadata
- description: Options to configure Cryostat Automated Report Analysis.
displayName: Report Options
path: reportOptions
Expand Down
Loading

0 comments on commit 921b242

Please sign in to comment.