8000 [Feature] Object Checksum · arangodb/kube-arangodb@b20e4b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit b20e4b7

Browse files
committed
[Feature] Object Checksum
1 parent d149964 commit b20e4b7

File tree

5 files changed

+46
-9
lines changed

5 files changed

+46
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- (Feature) Scheduler CronJob Integration Definition
1919
- (Feature) Scheduler BatchJob Integration Service
2020
- (Maintenance) Update Go to 1.22.2
21+
- (Feature) Object Checksum
2122

2223
## [1.2.39](https://github.com/arangodb/kube-arangodb/tree/1.2.39) (2024-03-11)
2324
- (Feature) Extract Scheduler API

pkg/apis/ml/v1alpha1/extension_status_reconciliation.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,23 @@
2020

2121
package v1alpha1
2222

23+
import sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
24+
2325
type ArangoMLExtensionStatusReconciliation struct {
24-
StatefulSetChecksum string `json:"statefulSetChecksum,omitempty"`
25-
ServiceChecksum string `json:"serviceChecksum,omitempty"`
26+
StatefulSet *sharedApi.Object `json:"statefulSet,omitempty"`
27+
Service *sharedApi.Object `json:"service,omitempty"`
2628
}
2729

28-
func (r *ArangoMLExtensionStatusReconciliation) GetStatefulSetChecksum() string {
30+
func (r *ArangoMLExtensionStatusReconciliation) GetStatefulSet() *sharedApi.Object {
2931
if r == nil {
30-
return ""
32+
return nil
3133
}
32-
return r.StatefulSetChecksum
34+
return r.StatefulSet
3335
}
3436

35-
func (r *ArangoMLExtensionStatusReconciliation) GetServiceChecksum() string {
37+
func (r *ArangoMLExtensionStatusReconciliation) GetService() *sharedApi.Object {
3638
if r == nil {
37-
return ""
39+
return nil
3840
}
39-
return r.ServiceChecksum
41+
return r.Service
4042
}

pkg/apis/ml/v1alpha1/zz_generated.deepcopy.go

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/shared/v1/object.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ import (
2828
"github.com/arangodb/kube-arangodb/pkg/util"
2929
)
3030

31+
func NewObjectWithChecksum(object meta.Object, checksum string) Object {
32+
obj := NewObject(object)
33+
obj.Checksum = util.NewType(checksum)
34+
return obj
35+
}
36+
3137
func NewObject(object meta.Object) Object {
3238
var n Object
3339

@@ -50,6 +56,9 @@ type Object struct {
5056

5157
// UID keeps the information about object UID
5258
UID *types.UID `json:"uid,omitempty"`
59+
60+
// UID keeps the information about object Checksum
61+
Checksum *string `json:"checksum,omitempty"`
5362
}
5463

5564
func (o *Object) IsEmpty() bool {
@@ -85,6 +94,16 @@ func (o *Object) GetUID() types.UID {
8594
return ""
8695
}
8796

97+
func (o *Object) GetChecksum() string {
98+
if o != nil {
99+
if n := o.Checksum; n != nil {
100+
return *n
101+
}
102+
}
103+
104+
return ""
105+
}
106+
88107
func (o *Object) Equals(obj meta.Object) bool {
89108
if o == nil {
90109
return false

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

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0