Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Add CSV Markers allowing to generate x-descriptors (so that users can…
Browse files Browse the repository at this point in the history
… select a storage class from a list populated from the cluster)

As depicted in [1], this will display a list of
 storage classes from which the user can select a storage class.
This can be useful to reduce errors when using the Operator.

References
- Operator SDK documentation [2]
- OLM reference [3]

[1] https://www.redhat.com/en/blog/openshift-4-2-declarative-dynamic-ui-for-your-operator
[2] https://sdk.operatorframework.io/docs/building-operators/golang/references/markers/
[3] https://github.com/openshift/console/blob/master/frontend/packages/operator-lifecycle-manager/src/components/descriptors/reference/reference.md
  • Loading branch information
rm3l committed Jul 5, 2024
1 parent 345d1cc commit 6c45a3a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .rhdh/bundle/manifests/rhdh-operator.csv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ spec:
displayName: Red Hat Developer Hub
kind: Backstage
name: backstages.rhdh.redhat.com
specDescriptors:
- description: Name of the storage class to use for the Persistent Volumes requested
by the application. The default storage class name will be used if this
field is not specified.
displayName: Storage Class for Application volumes
path: application.storageClassName
x-descriptors:
- urn:alm:descriptor:io.kubernetes:StorageClass
- description: Name of the storage class to use for the database Persistent
Volumes. The default storage class name will be used if this field is not
specified.
displayName: Storage Class for database volumes
path: database.storageClassName
x-descriptors:
- urn:alm:descriptor:io.kubernetes:StorageClass
version: v1alpha1
description: |
Red Hat Developer Hub is an enterprise-grade platform for building developer portals, containing a supported and opinionated framework. By implementing a unified and open platform designed to maximize developer skills, ease onboarding, and increase development productivity, focus can be centered on what really matters: writing great code. Red Hat Developer Hub also offers Software Templates to simplify the development process, which can reduce friction and frustration for development teams, boosting their productivity and increasing an organization's competitive advantage.
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/backstage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type Database struct {
// Name of the storage class to use for the database Persistent Volumes.
// The default storage class name will be used if this field is not specified.
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Storage Class for database volumes",xDescriptors={"urn:alm:descriptor:io.kubernetes:StorageClass"}
StorageClassName *string `json:"storageClassName,omitempty"`
}

Expand Down Expand Up @@ -122,6 +123,7 @@ type Application struct {
// Name of the storage class to use for the Persistent Volumes requested by the application.
// The default storage class name will be used if this field is not specified.
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Storage Class for Application volumes",xDescriptors={"urn:alm:descriptor:io.kubernetes:StorageClass"}
StorageClassName *string `json:"storageClassName,omitempty"`
}

Expand Down
17 changes: 16 additions & 1 deletion bundle/manifests/backstage-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
}
]
capabilities: Seamless Upgrades
createdAt: "2024-07-04T10:22:58Z"
createdAt: "2024-07-05T09:05:48Z"
operatorframework.io/suggested-namespace: backstage-system
operators.operatorframework.io/builder: operator-sdk-v1.33.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand All @@ -36,6 +36,21 @@ spec:
displayName: Backstage
kind: Backstage
name: backstages.rhdh.redhat.com
specDescriptors:
- description: Name of the storage class to use for the Persistent Volumes requested
by the application. The default storage class name will be used if this
field is not specified.
displayName: Storage Class for Application volumes
path: application.storageClassName
x-descriptors:
- urn:alm:descriptor:io.kubernetes:StorageClass
- description: Name of the storage class to use for the database Persistent
Volumes. The default storage class name will be used if this field is not
specified.
displayName: Storage Class for database volumes
path: database.storageClassName
x-descriptors:
- urn:alm:descriptor:io.kubernetes:StorageClass
version: v1alpha1
description: |
Operator to deploy Backstage on Kubernetes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ spec:
displayName: Backstage
kind: Backstage
name: backstages.rhdh.redhat.com
specDescriptors:
- description: Name of the storage class to use for the Persistent Volumes requested
by the application. The default storage class name will be used if this
field is not specified.
displayName: Storage Class for Application volumes
path: application.storageClassName
x-descriptors:
- urn:alm:descriptor:io.kubernetes:StorageClass
- description: Name of the storage class to use for the database Persistent
Volumes. The default storage class name will be used if this field is not
specified.
displayName: Storage Class for database volumes
path: database.storageClassName
x-descriptors:
- urn:alm:descriptor:io.kubernetes:StorageClass
version: v1alpha1
description: |
Operator to deploy Backstage on Kubernetes
Expand Down

0 comments on commit 6c45a3a

Please sign in to comment.