Skip to content

Commit 30c09d0

Browse files
authored
Change version to V1 (#490)
1 parent a9ab517 commit 30c09d0

File tree

289 files changed

+12681
-421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+12681
-421
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ update-generated:
196196
"all" \
197197
"github.com/arangodb/kube-arangodb/pkg/generated" \
198198
"github.com/arangodb/kube-arangodb/pkg/apis" \
199-
"deployment:v1alpha replication:v1alpha storage:v1alpha backup:v1alpha" \
199+
"deployment:v1alpha deployment:v1 replication:v1alpha replication:v1 storage:v1alpha backup:v1alpha backup:v1" \
200200
--go-header-file "./tools/codegen/boilerplate.go.txt" \
201201
$(VERIFYARGS)
202202

@@ -316,10 +316,10 @@ manifests: helm manifests-crd manifests-operator manifests-test chart-crd chart-
316316
.PHONY: run-unit-tests
317317
run-unit-tests: $(SOURCES)
318318
go test $(TESTVERBOSEOPTIONS) \
319-
$(REPOPATH)/pkg/apis/backup/v1alpha \
320-
$(REPOPATH)/pkg/apis/deployment/v1alpha \
321-
$(REPOPATH)/pkg/apis/replication/v1alpha \
322-
$(REPOPATH)/pkg/apis/storage/v1alpha \
319+
$(REPOPATH)/pkg/apis/backup/... \
320+
$(REPOPATH)/pkg/apis/deployment/... \
321+
$(REPOPATH)/pkg/apis/replication/... \
322+
$(REPOPATH)/pkg/apis/storage/... \
323323
$(REPOPATH)/pkg/deployment/... \
324324
$(REPOPATH)/pkg/storage \
325325
$(REPOPATH)/pkg/util/k8sutil \

chart/kube-arangodb-crd/templates/backup-policy.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ spec:
3333
- arangobp
3434
singular: arangobackuppolicy
3535
scope: Namespaced
36-
version: v1alpha
3736
subresources:
3837
status: {}
38+
version: v1
39+
versions:
40+
- name: v1
41+
served: true
42+
storage: true
43+
- name: v1alpha
44+
served: true
45+
storage: false

chart/kube-arangodb-crd/templates/backup.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ spec:
5353
- arangobackup
5454
singular: arangobackup
5555
scope: Namespaced
56-
version: v1alpha
5756
subresources:
58-
status: {}
57+
status: {}
58+
version: v1
59+
versions:
60+
- name: v1
61+
served: true
62+
storage: true
63+
- name: v1alpha
64+
served: true
65+
storage: false

chart/kube-arangodb-crd/templates/deployment-replications.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,11 @@ spec:
1818
- arangorepl
1919
singular: arangodeploymentreplication
2020
scope: Namespaced
21-
version: v1alpha
21+
version: v1
22+
versions:
23+
- name: v1
24+
served: true
25+
storage: true
26+
- name: v1alpha
27+
served: true
28+
storage: false

chart/kube-arangodb-crd/templates/deployment.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ spec:
1919
- arango
2020
singular: arangodeployment
2121
scope: Namespaced
22-
version: v1alpha
22+
version: v1
23+
versions:
24+
- name: v1
25+
served: true
26+
storage: true
27+
- name: v1alpha
28+
served: true
29+
storage: false

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ replace (
99
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8
1010
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d
1111
k8s.io/code-generator => ./deps/k8s.io/code-generator
12-
1312
)
1413

1514
require (
@@ -61,6 +60,7 @@ require (
6160
github.com/jonboulle/clockwork v0.1.0 // indirect
6261
github.com/juju/errgo v0.0.0-20140925100237-08cceb5d0b53 // indirect
6362
github.com/julienschmidt/httprouter v1.2.0
63+
github.com/magiconair/properties v1.8.0
6464
github.com/manucorporat/stats v0.0.0-20180402194714-3ba42d56d227 // indirect
6565
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
6666
github.com/mattn/go-colorable v0.1.1 // indirect

pkg/apis/backup/definitions.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
// Author Adam Janikowski
21+
//
22+
23+
package backup
24+
25+
const (
26+
ArangoBackupCRDName = ArangoBackupResourcePlural + "." + ArangoBackupGroupName
27+
ArangoBackupResourceKind = "ArangoBackup"
28+
ArangoBackupResourcePlural = "arangobackups"
29+
30+
ArangoBackupPolicyCRDName = ArangoBackupPolicyResourcePlural + "." + ArangoBackupGroupName
31+
ArangoBackupPolicyResourceKind = "ArangoBackupPolicy"
32+
ArangoBackupPolicyResourcePlural = "arangobackuppolicies"
33+
34+
ArangoBackupGroupName = "backup.arangodb.com"
35+
)
36+
37+
var (
38+
ArangoBackupShortNames = []string{"arangobackup"}
39+
40+
ArangoBackupPolicyShortNames = []string{"arangobackuppolicy"}
41+
)

pkg/apis/backup/v1/backup.go

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
// Author Adam Janikowski
21+
//
22+
23+
package v1
24+
25+
import (
26+
"github.com/arangodb/kube-arangodb/pkg/apis/backup"
27+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
28+
)
29+
30+
const (
31+
FinalizerArangoBackup = backup.ArangoBackupCRDName + "/cleanup"
32+
)
33+
34+
var (
35+
FinalizersArangoBackup = []string{
36+
FinalizerArangoBackup,
37+
}
38+
)
39+
40+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
41+
42+
// ArangoBackupList is a list of ArangoDB backups.
43+
type ArangoBackupList struct {
44+
metav1.TypeMeta `json:",inline"`
45+
metav1.ListMeta `json:"metadata,omitempty"`
46+
47+
Items []ArangoBackup `json:"items"`
48+
}
49+
50+
// +genclient
51+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
52+
53+
// ArangoBackup contains definition and status of the ArangoDB Backup.
54+
type ArangoBackup struct {
55+
metav1.TypeMeta `json:",inline"`
56+
metav1.ObjectMeta `json:"metadata,omitempty"`
57+
58+
Spec ArangoBackupSpec `json:"spec"`
59+
Status ArangoBackupStatus `json:"status"`
60+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
// Author Adam Janikowski
21+
//
22+
23+
package v1
24+
25+
import (
26+
"fmt"
27+
28+
deployment "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
29+
30+
"github.com/arangodb/kube-arangodb/pkg/backup/utils"
31+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
32+
)
33+
34+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
35+
36+
// ArangoBackupPolicyList is a list of ArangoDB backup policy.
37+
type ArangoBackupPolicyList struct {
38+
metav1.TypeMeta `json:",inline"`
39+
metav1.ListMeta `json:"metadata,omitempty"`
40+
41+
Items []ArangoBackupPolicy `json:"items"`
42+
}
43+
44+
// +genclient
45+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
46+
47+
// ArangoBackupPolicy contains definition and status of the ArangoDB Backup Policy.
48+
type ArangoBackupPolicy struct {
49+
metav1.TypeMeta `json:",inline"`
50+
metav1.ObjectMeta `json:"metadata,omitempty"`
51+
52+
Spec ArangoBackupPolicySpec `json:"spec"`
53+
Status ArangoBackupPolicyStatus `json:"status"`
54+
}
55+
56+
func (a *ArangoBackupPolicy) NewBackup(d *deployment.ArangoDeployment) *ArangoBackup {
57+
policyName := a.Name
58+
59+
spec := &ArangoBackupSpec{
60+
Deployment: ArangoBackupSpecDeployment{
61+
Name: d.Name,
62+
},
63+
Upload: a.Spec.BackupTemplate.Upload.DeepCopy(),
64+
Options: a.Spec.BackupTemplate.Options.DeepCopy(),
65+
PolicyName: &policyName,
66+
}
67+
68+
return &ArangoBackup{
69+
ObjectMeta: metav1.ObjectMeta{
70+
Name: fmt.Sprintf("%s-%s", d.Name, utils.RandomString(8)),
71+
Namespace: a.Namespace,
72+
73+
Labels: d.Labels,
74+
75+
Finalizers: []string{
76+
FinalizerArangoBackup,
77+
},
78+
},
79+
Spec: *spec,
80+
}
81+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
// Author Adam Janikowski
21+
//
22+
23+
package v1
24+
25+
import (
26+
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
27+
)
28+
29+
type ArangoBackupPolicySpec struct {
30+
Schedule string `json:"schedule"`
31+
32+
DeploymentSelector *meta.LabelSelector `json:"selector,omitempty"`
33+
34+
BackupTemplate ArangoBackupTemplate `json:"template"`
35+
}
36+
37+
type ArangoBackupTemplate struct {
38+
Options *ArangoBackupSpecOptions `json:"options,omitempty"`
39+
40+
Upload *ArangoBackupSpecOperation `json:"upload,omitempty"`
41+
}

0 commit comments

Comments
 (0)