Skip to content

Commit

Permalink
Add Kubebuilder annotations (#911)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Oct 3, 2019
1 parent 0a499f1 commit 7f3b225
Show file tree
Hide file tree
Showing 26 changed files with 216 additions and 20 deletions.
19 changes: 18 additions & 1 deletion api/crds/stash.appscode.com_backupblueprints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,28 @@ metadata:
creationTimestamp: null
name: backupblueprints.stash.appscode.com
spec:
additionalPrinterColumns:
- JSONPath: .spec.task.name
name: Task
type: string
- JSONPath: .spec.schedule
name: Schedule
type: string
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: stash.appscode.com
names:
categories:
- stash
- appscode
kind: BackupBlueprint
plural: backupblueprints
scope: ""
shortNames:
- bb
singular: backupblueprint
scope: Namespaced
subresources: {}
validation:
openAPIV3Schema:
properties:
Expand Down
23 changes: 22 additions & 1 deletion api/crds/stash.appscode.com_backupconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,32 @@ metadata:
creationTimestamp: null
name: backupconfigurations.stash.appscode.com
spec:
additionalPrinterColumns:
- JSONPath: .spec.task.name
name: Task
type: string
- JSONPath: .spec.schedule
name: Schedule
type: string
- JSONPath: .spec.paused
name: Paused
type: boolean
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: stash.appscode.com
names:
categories:
- stash
- appscode
- all
kind: BackupConfiguration
plural: backupconfigurations
scope: ""
shortNames:
- bc
singular: backupconfiguration
scope: Namespaced
subresources: {}
validation:
openAPIV3Schema:
properties:
Expand Down
19 changes: 18 additions & 1 deletion api/crds/stash.appscode.com_backupsessions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,28 @@ metadata:
creationTimestamp: null
name: backupsessions.stash.appscode.com
spec:
additionalPrinterColumns:
- JSONPath: .spec.backupConfiguration.name
name: BackupConfiguration
type: string
- JSONPath: .status.phase
name: Phase
type: string
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: stash.appscode.com
names:
categories:
- stash
- appscode
- all
kind: BackupSession
plural: backupsessions
scope: ""
singular: backupsession
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
Expand Down
13 changes: 12 additions & 1 deletion api/crds/stash.appscode.com_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ metadata:
creationTimestamp: null
name: functions.stash.appscode.com
spec:
additionalPrinterColumns:
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: stash.appscode.com
names:
categories:
- stash
- appscode
kind: Function
plural: functions
scope: ""
shortNames:
- fn
singular: function
scope: Namespaced
subresources: {}
validation:
openAPIV3Schema:
properties:
Expand Down
5 changes: 4 additions & 1 deletion api/crds/stash.appscode.com_recoveries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ metadata:
spec:
additionalPrinterColumns:
- JSONPath: .spec.repository.namespace
name: Repository-Namespace
name: Repository-NS
type: string
- JSONPath: .spec.repository.name
name: Repository-Name
type: string
- JSONPath: .spec.snapshot
name: Snapshot
type: string
- JSONPath: .status.phase
name: Phase
type: string
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down
27 changes: 26 additions & 1 deletion api/crds/stash.appscode.com_repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,36 @@ metadata:
creationTimestamp: null
name: repositories.stash.appscode.com
spec:
additionalPrinterColumns:
- JSONPath: .status.integrity
name: Integrity
type: boolean
- JSONPath: .status.size
name: Size
type: string
- JSONPath: .status.snapshotCount
name: Snapshot-Count
type: integer
- JSONPath: .status.lastBackupTime
format: date-time
name: Last-Successful-Backup
type: date
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: stash.appscode.com
names:
categories:
- stash
- appscode
kind: Repository
plural: repositories
scope: ""
shortNames:
- repo
singular: repository
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
Expand Down
28 changes: 27 additions & 1 deletion api/crds/stash.appscode.com_restics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,37 @@ metadata:
creationTimestamp: null
name: restics.stash.appscode.com
spec:
additionalPrinterColumns:
- JSONPath: .spec.selector
name: Selector
type: string
- JSONPath: .spec.schedule
name: Schedule
type: string
- JSONPath: .spec.type
name: Backup-Type
priority: 10
type: string
- JSONPath: .spec.paused
name: Paused
type: boolean
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: stash.appscode.com
names:
categories:
- stash
- appscode
- all
kind: Restic
plural: restics
scope: ""
shortNames:
- rst
singular: restic
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
Expand Down
21 changes: 20 additions & 1 deletion api/crds/stash.appscode.com_restoresessions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,30 @@ metadata:
creationTimestamp: null
name: restoresessions.stash.appscode.com
spec:
additionalPrinterColumns:
- JSONPath: .spec.repository.name
name: Repository
type: string
- JSONPath: .status.phase
name: Phase
type: string
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: stash.appscode.com
names:
categories:
- stash
- appscode
- all
kind: RestoreSession
plural: restoresessions
scope: ""
shortNames:
- restore
singular: restoresession
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
Expand Down
13 changes: 12 additions & 1 deletion api/crds/stash.appscode.com_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ metadata:
creationTimestamp: null
name: tasks.stash.appscode.com
spec:
additionalPrinterColumns:
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: stash.appscode.com
names:
categories:
- stash
- appscode
kind: Task
plural: tasks
scope: ""
shortNames:
- task
singular: task
scope: Namespaced
subresources: {}
validation:
openAPIV3Schema:
properties:
Expand Down
4 changes: 2 additions & 2 deletions apis/stash/v1alpha1/recovery_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (c Recovery) CustomResourceDefinition() *apiextensions.CustomResourceDefini
Singular: ResourceSingularRecovery,
Kind: ResourceKindRecovery,
ShortNames: []string{"rec"},
Categories: []string{"storage", "appscode", "all"},
Categories: []string{"stash", "appscode", "all"},
ResourceScope: string(apiextensions.NamespaceScoped),
Versions: []apiextensions.CustomResourceDefinitionVersion{
{
Expand All @@ -31,7 +31,7 @@ func (c Recovery) CustomResourceDefinition() *apiextensions.CustomResourceDefini
EnableStatusSubresource: apis.EnableStatusSubresource,
AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{
{
Name: "Repository-Namespace",
Name: "Repository-NS",
Type: "string",
JSONPath: ".spec.repository.namespace",
},
Expand Down
3 changes: 2 additions & 1 deletion apis/stash/v1alpha1/recovery_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ const (
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=recoveries,singular=recovery,shortName=rec,categories={storage,appscode,all}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Repository-Namespace",type="string",JSONPath=".spec.repository.namespace"
// +kubebuilder:printcolumn:name="Repository-NS",type="string",JSONPath=".spec.repository.namespace"
// +kubebuilder:printcolumn:name="Repository-Name",type="string",JSONPath=".spec.repository.name"
// +kubebuilder:printcolumn:name="Snapshot",type="string",JSONPath=".spec.snapshot"
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
type Recovery struct {
metav1.TypeMeta `json:",inline,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/stash/v1alpha1/repository_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (c Repository) CustomResourceDefinition() *apiextensions.CustomResourceDefi
Singular: ResourceSingularRepository,
Kind: ResourceKindRepository,
ShortNames: []string{"repo"},
Categories: []string{"storage", "appscode", "stash"},
Categories: []string{"stash", "appscode"},
ResourceScope: string(apiextensions.NamespaceScoped),
Versions: []apiextensions.CustomResourceDefinitionVersion{
{
Expand Down
8 changes: 8 additions & 0 deletions apis/stash/v1alpha1/repository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ const (
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=repositories,singular=repository,shortName=repo,categories={stash,appscode}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Integrity",type="boolean",JSONPath=".status.integrity"
// +kubebuilder:printcolumn:name="Size",type="string",JSONPath=".status.size"
// +kubebuilder:printcolumn:name="Snapshot-Count",type="integer",JSONPath=".status.snapshotCount"
// +kubebuilder:printcolumn:name="Last-Successful-Backup",type="date",format="date-time",JSONPath=".status.lastBackupTime"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
type Repository struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/stash/v1alpha1/restic_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (c Restic) CustomResourceDefinition() *apiextensions.CustomResourceDefiniti
Singular: ResourceSingularRestic,
Kind: ResourceKindRestic,
ShortNames: []string{"rst"},
Categories: []string{"storage", "appscode", "all"},
Categories: []string{"stash", "appscode", "all"},
ResourceScope: string(apiextensions.NamespaceScoped),
Versions: []apiextensions.CustomResourceDefinitionVersion{
{
Expand Down
8 changes: 8 additions & 0 deletions apis/stash/v1alpha1/restic_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ const (
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=restics,singular=restic,shortName=rst,categories={stash,appscode,all}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Selector",type="string",JSONPath=".spec.selector"
// +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule"
// +kubebuilder:printcolumn:name="Backup-Type",type="string",JSONPath=".spec.type",priority=10
// +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".spec.paused"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
type Restic struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/stash/v1beta1/backup_blueprint_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (bb BackupBlueprint) CustomResourceDefinition() *apiextensions.CustomResour
Singular: ResourceSingularBackupBlueprint,
Kind: ResourceKindBackupBlueprint,
ShortNames: []string{"bb"},
Categories: []string{"stash", "appscode", "backup"},
Categories: []string{"stash", "appscode"},
ResourceScope: string(apiextensions.ClusterScoped),
Versions: []apiextensions.CustomResourceDefinitionVersion{
{
Expand Down
5 changes: 5 additions & 0 deletions apis/stash/v1beta1/backup_blueprint_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const (
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=backupblueprints,singular=backupblueprint,shortName=bb,categories={stash,appscode}
// +kubebuilder:printcolumn:name="Task",type="string",JSONPath=".spec.task.name"
// +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
type BackupBlueprint struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/stash/v1beta1/backup_configuration_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (b BackupConfiguration) CustomResourceDefinition() *apiextensions.CustomRes
Singular: ResourceSingularBackupConfiguration,
Kind: ResourceKindBackupConfiguration,
ShortNames: []string{"bc"},
Categories: []string{"stash", "appscode", "backup"},
Categories: []string{"stash", "appscode", "all"},
ResourceScope: string(apiextensions.NamespaceScoped),
Versions: []apiextensions.CustomResourceDefinitionVersion{
{
Expand Down
6 changes: 6 additions & 0 deletions apis/stash/v1beta1/backup_configuration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const (
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=backupconfigurations,singular=backupconfiguration,shortName=bc,categories={stash,appscode,all}
// +kubebuilder:printcolumn:name="Task",type="string",JSONPath=".spec.task.name"
// +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule"
// +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".spec.paused"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
type BackupConfiguration struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/stash/v1beta1/backup_session_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (bs BackupSession) CustomResourceDefinition() *apiextensions.CustomResource
Plural: ResourcePluralBackupSession,
Singular: ResourceSingularBackupSession,
Kind: ResourceKindBackupSession,
Categories: []string{"stash", "backup", "appscode"},
Categories: []string{"stash", "appscode", "all"},
ResourceScope: string(apiextensions.NamespaceScoped),
Versions: []apiextensions.CustomResourceDefinitionVersion{
{
Expand Down
Loading

0 comments on commit 7f3b225

Please sign in to comment.