Skip to content

Commit

Permalink
Fix zookeeperbackup
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Bumarskov <[email protected]>
  • Loading branch information
Ilya Bumarskov committed Apr 12, 2022
1 parent 06ac54c commit 6b1471c
Show file tree
Hide file tree
Showing 9 changed files with 3,248 additions and 5,124 deletions.
17 changes: 13 additions & 4 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
domain: zookeeper.pravega.io
layout:
- go.kubebuilder.io/v3
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: zookeeper-operator
repo: github.com/pravega/zookeeper-operator
resources:
- group: zookeeper.pravega.io
kind: ZookeeperCluster
version: v1beta1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: zookeeper.pravega.io
group: zookeeper.pravega.io
kind: ZookeeperBackup
path: github.com/pravega/zookeeper-operator/api/v1beta1
version: v1beta1
version: "3"
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: zookeeper-operator
15 changes: 0 additions & 15 deletions api/v1beta1/doc.go
Original file line number Diff line number Diff line change
@@ -1,15 +0,0 @@
/**
* Copyright (c) 2018 Dell Inc., or its subsidiaries. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*/

// Package v1beta1 contains API Schema definitions for the zookeeper v1beta1 API
// group
// +k8s:deepcopy-gen=package,register
// +groupName=zookeeper.pravega.io
package v1beta1
13 changes: 5 additions & 8 deletions api/v1beta1/zookeeperbackup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import (
// ZookeeperBackupSpec defines the desired state of ZookeeperBackup
type ZookeeperBackupSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
// Important: Run "make" to regenerate code after modifying this file

// Name of the ZookeeperCluster to backup
// +kubebuilder:validation:Required
Expand Down Expand Up @@ -72,15 +71,13 @@ func (s *ZookeeperBackupSpec) withDefaults() (changed bool) {
// ZookeeperBackupStatus defines the observed state of ZookeeperBackup
type ZookeeperBackupStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
// Important: Run "make" to regenerate code after modifying this file
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// ZookeeperBackup is the Schema for the zookeeperbackups API
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=zookeeperbackups,scope=Namespaced
type ZookeeperBackup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -93,7 +90,7 @@ func (z *ZookeeperBackup) WithDefaults() bool {
return z.Spec.withDefaults()
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
//+kubebuilder:object:root=true

// ZookeeperBackupList contains a list of ZookeeperBackup
type ZookeeperBackupList struct {
Expand Down
31 changes: 12 additions & 19 deletions config/crd/bases/zookeeper.pravega.io_zookeeperbackups.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand All @@ -20,63 +18,58 @@ spec:
schema:
openAPIV3Schema:
description: ZookeeperBackup is the Schema for the zookeeperbackups API
type: object
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ZookeeperBackupSpec defines the desired state of ZookeeperBackup
type: object
required:
- zookeeperCluster
properties:
backupsToKeep:
default: "7"
description: Number of backups to store
type: string
default: "7"
dataCapacity:
default: 1Gi
description: Data Storage Capacity
type: string
default: 1Gi
dataStorageClass:
description: Data Storage Class name
type: string
image:
description: Image for backup procedure
type: object
properties:
pullPolicy:
description: PullPolicy describes a policy for if/when to pull
a container image
description: PullPolicy describes a policy for if/when to pull a container image
type: string
enum:
- Always
- Never
- IfNotPresent
type: string
repository:
type: string
tag:
type: string
type: object
schedule:
default: 0 0 */1 * *
description: Schedule in Cron format
type: string
default: 0 0 */1 * *
zookeeperCluster:
description: Name of the ZookeeperCluster to backup
type: string
required:
- zookeeperCluster
type: object
status:
description: ZookeeperBackupStatus defines the observed state of ZookeeperBackup
type: object
type: object
served: true
storage: true
subresources:
Expand Down
Loading

0 comments on commit 6b1471c

Please sign in to comment.