Skip to content

Commit 9106367

Browse files
authored
Add openapi markers for csv (#141)
1 parent d7d2792 commit 9106367

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pkg/operators/v1alpha1/clusterserviceversion_types.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,21 @@ type InstallModeSet map[InstallModeType]bool
5050

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

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

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

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

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

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

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

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

346+
// +k8s:openapi-gen=true
338347
type Icon struct {
339348
Data string `json:"base64data"`
340349
MediaType string `json:"mediatype"`
341350
}
342351

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

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

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

497+
// +k8s:openapi-gen=true
485498
type RequirementStatus struct {
486499
Group string `json:"group"`
487500
Version string `json:"version"`
@@ -495,6 +508,7 @@ type RequirementStatus struct {
495508

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

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

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

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

0 commit comments

Comments
 (0)