Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Descriptors #426

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions deploy/chart/templates/03-clusterserviceversion.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,33 @@ spec:
value:
type: object
description: If present, the value of this spec is the same for all instances of the CRD and can be found here instead of on the CR.
actionDescriptors:
type: array
items:
type: object
description: A spec for actions that can be performed on instances of the CRD
required:
- path
- displayName
- description
properties:
path:
type: string
description: A jsonpath indexing into the spec object on the CR where the the spec value can be found.
displayName:
type: string
description: A human-readable name for the action.
description:
type: string
description: A description of the action.
x-descriptors:
type: array
description: A list of descriptors for the action that indicate the meaning of the action.
items:
type: string
value:
type: object
description: If present, the value of this action is the same for all instances of the CRD and can be found here instead of on the CR.
required:
type: array
description: What resources this operator is responsible for managing. No two running operators should manage the same resource.
Expand Down
10 changes: 10 additions & 0 deletions pkg/api/apis/operators/v1alpha1/clusterserviceversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ type SpecDescriptor struct {
Value *json.RawMessage `json:"value,omitempty"`
}

// ActionDescriptor describes a declarative action that can be performed on a custom resource instance
type ActionDescriptor struct {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses the same schema as both SpecDescriptor and StatusDescriptor.

Path string `json:"path"`
DisplayName string `json:"displayName,omitempty"`
Description string `json:"description,omitempty"`
XDescriptors []string `json:"x-descriptors,omitempty"`
Value *json.RawMessage `json:"value,omitempty"`
}

// CRDDescription provides details to ALM about the CRDs
type CRDDescription struct {
Name string `json:"name"`
Expand All @@ -51,6 +60,7 @@ type CRDDescription struct {
Resources []CRDResourceReference `json:"resources,omitempty"`
StatusDescriptors []StatusDescriptor `json:"statusDescriptors,omitempty"`
SpecDescriptors []SpecDescriptor `json:"specDescriptors,omitempty"`
ActionDescriptor []ActionDescriptor `json:"actionDescriptors,omitempty"`
}

// CRDResourceReference is a Kubernetes resource type used by a custom resource
Expand Down
41 changes: 41 additions & 0 deletions pkg/api/apis/operators/v1alpha1/zz_generated.deepcopy.go

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