Skip to content
Merged
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
17 changes: 17 additions & 0 deletions pkg/operators/v1alpha1/clusterserviceversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,21 @@ type InstallModeSet map[InstallModeType]bool

// NamedInstallStrategy represents the block of an ClusterServiceVersion resource
// where the install strategy is specified.
// +k8s:openapi-gen=true
type NamedInstallStrategy struct {
StrategyName string `json:"strategy"`
StrategySpec StrategyDetailsDeployment `json:"spec,omitempty"`
}

// StrategyDeploymentPermissions describe the rbac rules and service account needed by the install strategy
// +k8s:openapi-gen=true
type StrategyDeploymentPermissions struct {
ServiceAccountName string `json:"serviceAccountName"`
Rules []rbac.PolicyRule `json:"rules"`
}

// StrategyDeploymentSpec contains the name, spec and labels for the deployment ALM should create
// +k8s:openapi-gen=true
type StrategyDeploymentSpec struct {
Name string `json:"name"`
Spec appsv1.DeploymentSpec `json:"spec"`
Expand All @@ -70,6 +73,7 @@ type StrategyDeploymentSpec struct {

// StrategyDetailsDeployment represents the parsed details of a Deployment
// InstallStrategy.
// +k8s:openapi-gen=true
type StrategyDetailsDeployment struct {
DeploymentSpecs []StrategyDeploymentSpec `json:"deployments"`
Permissions []StrategyDeploymentPermissions `json:"permissions,omitempty"`
Expand Down Expand Up @@ -265,6 +269,7 @@ type APIServiceDefinitions struct {

// ClusterServiceVersionSpec declarations tell OLM how to install an operator
// that can manage apps for a given version.
// +k8s:openapi-gen=true
type ClusterServiceVersionSpec struct {
InstallStrategy NamedInstallStrategy `json:"install"`
Version version.OperatorVersion `json:"version,omitempty"`
Expand Down Expand Up @@ -321,25 +326,30 @@ type ClusterServiceVersionSpec struct {
RelatedImages []RelatedImage `json:"relatedImages,omitempty"`
}

// +k8s:openapi-gen=true
type CleanupSpec struct {
Enabled bool `json:"enabled"`
}

// +k8s:openapi-gen=true
type Maintainer struct {
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
}

// +k8s:openapi-gen=true
type AppLink struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
}

// +k8s:openapi-gen=true
type Icon struct {
Data string `json:"base64data"`
MediaType string `json:"mediatype"`
}

// +k8s:openapi-gen=true
type RelatedImage struct {
Name string `json:"name"`
Image string `json:"image"`
Expand Down Expand Up @@ -418,6 +428,7 @@ func (c *ClusterServiceVersion) HasCAResources() bool {
}

// Conditions appear in the status as a record of state transitions on the ClusterServiceVersion
// +k8s:openapi-gen=true
type ClusterServiceVersionCondition struct {
// Condition of the ClusterServiceVersion
Phase ClusterServiceVersionPhase `json:"phase,omitempty"`
Expand Down Expand Up @@ -473,6 +484,7 @@ const (
)

// DependentStatus is the status for a dependent requirement (to prevent infinite nesting)
// +k8s:openapi-gen=true
type DependentStatus struct {
Group string `json:"group"`
Version string `json:"version"`
Expand All @@ -482,6 +494,7 @@ type DependentStatus struct {
Message string `json:"message,omitempty"`
}

// +k8s:openapi-gen=true
type RequirementStatus struct {
Group string `json:"group"`
Version string `json:"version"`
Expand All @@ -495,6 +508,7 @@ type RequirementStatus struct {

// ClusterServiceVersionStatus represents information about the status of a CSV. Status may trail the actual
// state of a system.
// +k8s:openapi-gen=true
type ClusterServiceVersionStatus struct {
// Current condition of the ClusterServiceVersion
Phase ClusterServiceVersionPhase `json:"phase,omitempty"`
Expand Down Expand Up @@ -527,6 +541,7 @@ type ClusterServiceVersionStatus struct {
}

// CleanupStatus represents information about the status of cleanup while a CSV is pending deletion
// +k8s:openapi-gen=true
type CleanupStatus struct {
// PendingDeletion is the list of custom resource objects that are pending deletion and blocked on finalizers.
// This indicates the progress of cleanup that is blocking CSV deletion or operator uninstall.
Expand All @@ -535,12 +550,14 @@ type CleanupStatus struct {
}

// ResourceList represents a list of resources which are of the same Group/Kind
// +k8s:openapi-gen=true
type ResourceList struct {
Group string `json:"group"`
Kind string `json:"kind"`
Instances []ResourceInstance `json:"instances"`
}

// +k8s:openapi-gen=true
type ResourceInstance struct {
Name string `json:"name"`
// Namespace can be empty for cluster-scoped resources
Expand Down