Skip to content

Commit 9a00f40

Browse files
authored
[Feature] ArangoClusterSynchronization model (#872)
1 parent b5e707e commit 9a00f40

29 files changed

+1547
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Add endpoint into member status
99
- Add debug mode (Golang DLV)
1010
- License V2 for ArangoDB 3.9.0+
11+
- Add ArangoClusterSynchronization v1 API
1112

1213
## [1.2.6](https://github.com/arangodb/kube-arangodb/tree/1.2.6) (2021-12-15)
1314
- Add ArangoBackup backoff functionality

pkg/apis/deployment/definitions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ const (
3131
ArangoMemberResourceKind = "ArangoMember"
3232
ArangoMemberResourcePlural = "arangomembers"
3333

34+
ArangoClusterSynchronizationCRDName = ArangoClusterSynchronizationResourcePlural + "." + ArangoDeploymentGroupName
35+
ArangoClusterSynchronizationResourceKind = "ArangoClusterSynchronization"
36+
ArangoClusterSynchronizationResourcePlural = "arangoclustersynchronizations"
37+
3438
ArangoDeploymentGroupName = "database.arangodb.com"
3539
)
3640

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2016-2021 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+
21+
package v1
22+
23+
import (
24+
"github.com/arangodb/kube-arangodb/pkg/apis/deployment"
25+
26+
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
27+
)
28+
29+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
30+
31+
// ArangoClusterSynchronizationList is a list of ArangoDB jobs.
32+
type ArangoClusterSynchronizationList struct {
33+
meta.TypeMeta `json:",inline"`
34+
meta.ListMeta `json:"metadata,omitempty"`
35+
36+
Items []ArangoClusterSynchronization `json:"items"`
37+
}
38+
39+
// +genclient
40+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
41+
42+
// ArangoClusterSynchronization contains definition and status of the ArangoDB type Job.
43+
type ArangoClusterSynchronization struct {
44+
meta.TypeMeta `json:",inline"`
45+
meta.ObjectMeta `json:"metadata,omitempty"`
46+
Spec ArangoClusterSynchronizationSpec `json:"spec,omitempty"`
47+
Status ArangoClusterSynchronizationStatus `json:"status,omitempty"`
48+
}
49+
50+
// AsOwner creates an OwnerReference for the given job
51+
func (a *ArangoClusterSynchronization) AsOwner() meta.OwnerReference {
52+
trueVar := true
53+
return meta.OwnerReference{
54+
APIVersion: SchemeGroupVersion.String(),
55+
Kind: deployment.ArangoClusterSynchronizationResourceKind,
56+
Name: a.Name,
57+
UID: a.UID,
58+
Controller: &trueVar,
59+
}
60+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2016-2021 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+
21+
package v1
22+
23+
type ArangoClusterSynchronizationSpec struct {
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2016-2021 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+
21+
package v1
22+
23+
type ArangoClusterSynchronizationStatus struct {
24+
}

pkg/apis/deployment/v1/zz_generated.deepcopy.go

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2016-2021 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+
21+
package v2alpha1
22+
23+
import (
24+
"github.com/arangodb/kube-arangodb/pkg/apis/deployment"
25+
26+
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
27+
)
28+
29+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
30+
31+
// ArangoClusterSynchronizationList is a list of ArangoDB jobs.
32+
type ArangoClusterSynchronizationList struct {
33+
meta.TypeMeta `json:",inline"`
34+
meta.ListMeta `json:"metadata,omitempty"`
35+
36+
Items []ArangoClusterSynchronization `json:"items"`
37+
}
38+
39+
// +genclient
40+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
41+
42+
// ArangoClusterSynchronization contains definition and status of the ArangoDB type Job.
43+
type ArangoClusterSynchronization struct {
44+
meta.TypeMeta `json:",inline"`
45+
meta.ObjectMeta `json:"metadata,omitempty"`
46+
Spec ArangoClusterSynchronizationSpec `json:"spec,omitempty"`
47+
Status ArangoClusterSynchronizationStatus `json:"status,omitempty"`
48+
}
49+
50+
// AsOwner creates an OwnerReference for the given job
51+
func (a *ArangoClusterSynchronization) AsOwner() meta.OwnerReference {
52+
trueVar := true
53+
return meta.OwnerReference{
54+
APIVersion: SchemeGroupVersion.String(),
55+
Kind: deployment.ArangoClusterSynchronizationResourceKind,
56+
Name: a.Name,
57+
UID: a.UID,
58+
Controller: &trueVar,
59+
}
60+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2016-2021 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+
21+
package v2alpha1
22+
23+
type ArangoClusterSynchronizationSpec struct {
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2016-2021 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+
21+
package v2alpha1
22+
23+
type ArangoClusterSynchronizationStatus struct {
24+
}

0 commit comments

Comments
 (0)