Skip to content

Commit e6a4ad4

Browse files
authored
[Feature] [Analytics] Metadata (#1664)
1 parent 34acb21 commit e6a4ad4

File tree

7 files changed

+62
-83
lines changed

7 files changed

+62
-83
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- (Feature) (Analytics) GAE Integration
1616
- (Feature) (Analytics) Enable TLS and Service
1717
- (Feature) (ML) Unify Integration Sidecar
18+
- (Feature) (Analytics) Metadata
1819

1920
## [1.2.40](https://github.com/arangodb/kube-arangodb/tree/1.2.40) (2024-04-10)
2021
- (Feature) Add Core fields to the Scheduler Container Spec

docs/api/ArangoMLExtension.V1Beta1.md

+4-36
Original file line numberDiff line numberDiff line change
@@ -3154,54 +3154,22 @@ Conditions specific to the entire extension
31543154

31553155
***
31563156

3157-
### .status.metadataService.local.arangoMLFeatureStore
3157+
### .status.metadataService.arangoMLFeatureStore
31583158

3159-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_status_metadata_service.go#L38)</sup>
3159+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_status_metadata_service.go#L28)</sup>
31603160

31613161
ArangoMLFeatureStoreDatabase define Database name to be used as MetadataService Backend
31623162

31633163
***
31643164

3165-
### .status.metadataService.local.arangoPipe
3165+
### .status.metadataService.arangoPipe
31663166

3167-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_status_metadata_service.go#L35)</sup>
3167+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/ml/v1beta1/extension_status_metadata_service.go#L25)</sup>
31683168

31693169
ArangoPipeDatabase define Database name to be used as MetadataService Backend
31703170

31713171
***
31723172

3173-
### .status.metadataService.secret.checksum
3174-
3175-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L61)</sup>
3176-
3177-
UID keeps the information about object Checksum
3178-
3179-
***
3180-
3181-
### .status.metadataService.secret.name
3182-
3183-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L52)</sup>
3184-
3185-
Name of the object
3186-
3187-
***
3188-
3189-
### .status.metadataService.secret.namespace
3190-
3191-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L55)</sup>
3192-
3193-
Namespace of the object. Should default to the namespace of the parent object
3194-
3195-
***
3196-
3197-
### .status.metadataService.secret.uid
3198-
3199-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L58)</sup>
3200-
3201-
UID keeps the information about object UID
3202-
3203-
***
3204-
32053173
### .status.reconciliation.service.checksum
32063174

32073175
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.40/pkg/apis/shared/v1/object.go#L61)</sup>

pkg/apis/analytics/v1alpha1/conditions.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ package v1alpha1
2323
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
2424

2525
const (
26-
LicenseValidCondition api.ConditionType = "LicenseValid"
27-
DeploymentFoundCondition api.ConditionType = "DeploymentFound"
28-
ReadyCondition api.ConditionType = "Ready"
29-
SpecValidCondition api.ConditionType = "SpecValid"
30-
StatefulSetReadyCondition api.ConditionType = "StatefulSetReady"
31-
TLSEnabledCondition api.ConditionType = "TLSEnabled"
26+
LicenseValidCondition api.ConditionType = "LicenseValid"
27+
DeploymentFoundCondition api.ConditionType = "DeploymentFound"
28+
ReadyCondition api.ConditionType = "Ready"
29+
SpecValidCondition api.ConditionType = "SpecValid"
30+
StatefulSetReadyCondition api.ConditionType = "StatefulSetReady"
31+
TLSEnabledCondition api.ConditionType = "TLSEnabled"
32+
MetadataServiceValidCondition api.ConditionType = "MetadataServiceValid"
3233
)

pkg/apis/ml/v1beta1/extension_status_metadata_service.go

-10
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,7 @@
2020

2121
package v1beta1
2222

23-
import sharedApi "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1"
24-
2523
type ArangoMLExtensionStatusMetadataService struct {
26-
// Local define the Local ArangoDeployment Metadata Service configuration
27-
Local *ArangoMLExtensionStatusMetadataServiceLocal `json:"local,omitempty"`
28-
29-
// Secret define the Secret specification to store all the details
30-
Secret *sharedApi.Object `json:"secret,omitempty"`
31-
}
32-
33-
type ArangoMLExtensionStatusMetadataServiceLocal struct {
3424
// ArangoPipeDatabase define Database name to be used as MetadataService Backend
3525
ArangoPipeDatabase string `json:"arangoPipe"`
3626

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

+1-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/util/compare/k8s/secret.go

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2024 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 k8s
22+
23+
import (
24+
core "k8s.io/api/core/v1"
25+
26+
"github.com/arangodb/kube-arangodb/pkg/util"
27+
)
28+
29+
func CoreSecret(in *core.Secret) *core.Secret {
30+
return FilterP(in, func(in *core.Secret) *core.Secret {
31+
return &core.Secret{
32+
ObjectMeta: ObjectMetaFilter(in.ObjectMeta),
33+
Data: in.Data,
34+
}
35+
})
36+
}
37+
38+
func CoreSecretChecksum(in *core.Secret) (string, error) {
39+
return util.SHA256FromJSON(CoreSecret(in))
40+
}

pkg/util/k8sutil/events.go

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -41,12 +41,17 @@ type Event struct {
4141
Message string
4242
}
4343

44-
// APIObject helps to abstract an object from our custom API.
45-
type APIObject interface {
46-
runtime.Object
44+
type K8SObject interface {
4745
meta.Object
4846
// AsOwner creates an OwnerReference for the given deployment
4947
AsOwner() meta.OwnerReference
48+
}
49+
50+
// APIObject helps to abstract an object from our custom API.
51+
type APIObject interface {
52+
runtime.Object
53+
54+
K8SObject
5055

5156
OwnerOf(in meta.Object) bool
5257
}

0 commit comments

Comments
 (0)