Skip to content

Commit d98262d

Browse files
Ilya Bumarskovibumarskov
Ilya Bumarskov
authored andcommitted
Fix zookeeperbackup
Signed-off-by: Ilya Bumarskov <[email protected]>
1 parent 246658f commit d98262d

9 files changed

+3248
-5124
lines changed

PROJECT

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
domain: zookeeper.pravega.io
22
layout:
33
- go.kubebuilder.io/v3
4+
plugins:
5+
manifests.sdk.operatorframework.io/v2: {}
6+
scorecard.sdk.operatorframework.io/v2: {}
7+
projectName: zookeeper-operator
48
repo: github.com/pravega/zookeeper-operator
59
resources:
610
- group: zookeeper.pravega.io
711
kind: ZookeeperCluster
812
version: v1beta1
13+
- api:
14+
crdVersion: v1
15+
namespaced: true
16+
controller: true
17+
domain: zookeeper.pravega.io
18+
group: zookeeper.pravega.io
19+
kind: ZookeeperBackup
20+
path: github.com/pravega/zookeeper-operator/api/v1beta1
21+
version: v1beta1
922
version: "3"
10-
plugins:
11-
manifests.sdk.operatorframework.io/v2: {}
12-
scorecard.sdk.operatorframework.io/v2: {}
13-
projectName: zookeeper-operator

api/v1beta1/doc.go

-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +0,0 @@
1-
/**
2-
* Copyright (c) 2018 Dell Inc., or its subsidiaries. All Rights Reserved.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*/
10-
11-
// Package v1beta1 contains API Schema definitions for the zookeeper v1beta1 API
12-
// group
13-
// +k8s:deepcopy-gen=package,register
14-
// +groupName=zookeeper.pravega.io
15-
package v1beta1

api/v1beta1/zookeeperbackup_types.go

+5-8
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ import (
2020
// ZookeeperBackupSpec defines the desired state of ZookeeperBackup
2121
type ZookeeperBackupSpec struct {
2222
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
23-
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
24-
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
23+
// Important: Run "make" to regenerate code after modifying this file
2524

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

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

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

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

9895
// ZookeeperBackupList contains a list of ZookeeperBackup
9996
type ZookeeperBackupList struct {

config/crd/bases/zookeeper.pravega.io_zookeeperbackups.yaml

+12-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
---
31
apiVersion: apiextensions.k8s.io/v1
42
kind: CustomResourceDefinition
53
metadata:
@@ -20,63 +18,58 @@ spec:
2018
schema:
2119
openAPIV3Schema:
2220
description: ZookeeperBackup is the Schema for the zookeeperbackups API
21+
type: object
2322
properties:
2423
apiVersion:
25-
description: 'APIVersion defines the versioned schema of this representation
26-
of an object. Servers should convert recognized schemas to the latest
27-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
24+
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'
2825
type: string
2926
kind:
30-
description: 'Kind is a string value representing the REST resource this
31-
object represents. Servers may infer this from the endpoint the client
32-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
27+
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'
3328
type: string
3429
metadata:
3530
type: object
3631
spec:
3732
description: ZookeeperBackupSpec defines the desired state of ZookeeperBackup
33+
type: object
34+
required:
35+
- zookeeperCluster
3836
properties:
3937
backupsToKeep:
40-
default: "7"
4138
description: Number of backups to store
4239
type: string
40+
default: "7"
4341
dataCapacity:
44-
default: 1Gi
4542
description: Data Storage Capacity
4643
type: string
44+
default: 1Gi
4745
dataStorageClass:
4846
description: Data Storage Class name
4947
type: string
5048
image:
5149
description: Image for backup procedure
50+
type: object
5251
properties:
5352
pullPolicy:
54-
description: PullPolicy describes a policy for if/when to pull
55-
a container image
53+
description: PullPolicy describes a policy for if/when to pull a container image
54+
type: string
5655
enum:
5756
- Always
5857
- Never
5958
- IfNotPresent
60-
type: string
6159
repository:
6260
type: string
6361
tag:
6462
type: string
65-
type: object
6663
schedule:
67-
default: 0 0 */1 * *
6864
description: Schedule in Cron format
6965
type: string
66+
default: 0 0 */1 * *
7067
zookeeperCluster:
7168
description: Name of the ZookeeperCluster to backup
7269
type: string
73-
required:
74-
- zookeeperCluster
75-
type: object
7670
status:
7771
description: ZookeeperBackupStatus defines the observed state of ZookeeperBackup
7872
type: object
79-
type: object
8073
served: true
8174
storage: true
8275
subresources:

0 commit comments

Comments
 (0)