1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Feature] [ML] Introduce basic Conditions to types (#1505)

This commit is contained in:
Adam Janikowski 2023-11-24 09:18:21 +01:00 committed by GitHub
parent 30d47ae1d7
commit 2c528fb2ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 139 additions and 3 deletions

View file

@ -19,6 +19,7 @@
- (Maintenance) yamlfmt as CI Step
- (Maintenance) Expose Context in OperatorV2 Item Handler
- (Feature) Improve K8S Mock for UT
- (Feature) (ML) Introduce basic Conditions
## [1.2.35](https://github.com/arangodb/kube-arangodb/tree/1.2.35) (2023-11-06)
- (Maintenance) Update go-driver to v1.6.0, update IsNotFound() checks

View file

@ -4,3 +4,9 @@
## Status
### .status.conditions
Type: `api.Conditions` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/ml/v1alpha1/batchjob_status.go#L28)</sup>
Conditions specific to the entire batch job

View file

@ -4,3 +4,9 @@
## Status
### .status.conditions
Type: `api.Conditions` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/ml/v1alpha1/cronjob_status.go#L28)</sup>
Conditions specific to the entire cron job

View file

@ -70,3 +70,9 @@ Default Value: `""`
## Status
### .status.conditions
Type: `api.Conditions` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/ml/v1alpha1/storage_status.go#L28)</sup>
Conditions specific to the entire storage

View file

@ -45,3 +45,11 @@ type ArangoMLBatchJob struct {
Spec ArangoMLBatchJobSpec `json:"spec"`
Status ArangoMLBatchJobStatus `json:"status"`
}
func (a *ArangoMLBatchJob) GetStatus() ArangoMLBatchJobStatus {
return a.Status
}
func (a *ArangoMLBatchJob) SetStatus(status ArangoMLBatchJobStatus) {
a.Status = status
}

View file

@ -20,5 +20,11 @@
package v1alpha1
import "github.com/arangodb/kube-arangodb/pkg/apis/shared"
type ArangoMLBatchJobSpec struct {
}
func (a *ArangoMLBatchJobSpec) Validate() error {
return shared.WithErrors(shared.PrefixResourceErrors("spec"))
}

View file

@ -20,5 +20,10 @@
package v1alpha1
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
type ArangoMLBatchJobStatus struct {
// Conditions specific to the entire batch job
// +doc/type: api.Conditions
Conditions api.ConditionList `json:"conditions,omitempty"`
}

View file

@ -0,0 +1,27 @@
//
// DISCLAIMER
//
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package v1alpha1
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
const (
SpecValidCondition api.ConditionType = "SpecValid"
)

View file

@ -45,3 +45,11 @@ type ArangoMLCronJob struct {
Spec ArangoMLCronJobSpec `json:"spec"`
Status ArangoMLCronJobStatus `json:"status"`
}
func (a *ArangoMLCronJob) GetStatus() ArangoMLCronJobStatus {
return a.Status
}
func (a *ArangoMLCronJob) SetStatus(status ArangoMLCronJobStatus) {
a.Status = status
}

View file

@ -20,5 +20,11 @@
package v1alpha1
import "github.com/arangodb/kube-arangodb/pkg/apis/shared"
type ArangoMLCronJobSpec struct {
}
func (a *ArangoMLCronJobSpec) Validate() error {
return shared.WithErrors(shared.PrefixResourceErrors("spec"))
}

View file

@ -20,5 +20,10 @@
package v1alpha1
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
type ArangoMLCronJobStatus struct {
// Conditions specific to the entire cron job
// +doc/type: api.Conditions
Conditions api.ConditionList `json:"conditions,omitempty"`
}

View file

@ -20,5 +20,11 @@
package v1alpha1
import "github.com/arangodb/kube-arangodb/pkg/apis/shared"
type ArangoMLExtensionSpec struct {
}
func (a *ArangoMLExtensionSpec) Validate() error {
return shared.WithErrors(shared.PrefixResourceErrors("spec"))
}

View file

@ -45,3 +45,11 @@ type ArangoMLStorage struct {
Spec ArangoMLStorageSpec `json:"spec"`
Status ArangoMLStorageStatus `json:"status"`
}
func (a *ArangoMLStorage) GetStatus() ArangoMLStorageStatus {
return a.Status
}
func (a *ArangoMLStorage) SetStatus(status ArangoMLStorageStatus) {
a.Status = status
}

View file

@ -20,5 +20,10 @@
package v1alpha1
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
type ArangoMLStorageStatus struct {
// Conditions specific to the entire storage
// +doc/type: api.Conditions
Conditions api.ConditionList `json:"conditions,omitempty"`
}

View file

@ -36,7 +36,7 @@ func (in *ArangoMLBatchJob) DeepCopyInto(out *ArangoMLBatchJob) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
in.Status.DeepCopyInto(&out.Status)
return
}
@ -110,6 +110,13 @@ func (in *ArangoMLBatchJobSpec) DeepCopy() *ArangoMLBatchJobSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoMLBatchJobStatus) DeepCopyInto(out *ArangoMLBatchJobStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make(v1.ConditionList, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
@ -129,7 +136,7 @@ func (in *ArangoMLCronJob) DeepCopyInto(out *ArangoMLCronJob) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
in.Status.DeepCopyInto(&out.Status)
return
}
@ -203,6 +210,13 @@ func (in *ArangoMLCronJobSpec) DeepCopy() *ArangoMLCronJobSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoMLCronJobStatus) DeepCopyInto(out *ArangoMLCronJobStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make(v1.ConditionList, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
@ -322,7 +336,7 @@ func (in *ArangoMLStorage) DeepCopyInto(out *ArangoMLStorage) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
in.Status.DeepCopyInto(&out.Status)
return
}
@ -423,6 +437,13 @@ func (in *ArangoMLStorageSpec) DeepCopy() *ArangoMLStorageSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ArangoMLStorageStatus) DeepCopyInto(out *ArangoMLStorageStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make(v1.ConditionList, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}

View file

@ -36,3 +36,15 @@ func WithArangoBackupUpdateStatusInterfaceRetry(ctx context.Context, client Upda
func WithArangoExtensionUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[mlApi.ArangoMLExtensionStatus, *mlApi.ArangoMLExtension], obj *mlApi.ArangoMLExtension, status mlApi.ArangoMLExtensionStatus, opts meta.UpdateOptions) (*mlApi.ArangoMLExtension, error) {
return WithUpdateStatusInterfaceRetry[mlApi.ArangoMLExtensionStatus, *mlApi.ArangoMLExtension](ctx, client, obj, status, opts)
}
func WithArangoCronJobUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[mlApi.ArangoMLCronJobStatus, *mlApi.ArangoMLCronJob], obj *mlApi.ArangoMLCronJob, status mlApi.ArangoMLCronJobStatus, opts meta.UpdateOptions) (*mlApi.ArangoMLCronJob, error) {
return WithUpdateStatusInterfaceRetry[mlApi.ArangoMLCronJobStatus, *mlApi.ArangoMLCronJob](ctx, client, obj, status, opts)
}
func WithArangoBatchJobUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[mlApi.ArangoMLBatchJobStatus, *mlApi.ArangoMLBatchJob], obj *mlApi.ArangoMLBatchJob, status mlApi.ArangoMLBatchJobStatus, opts meta.UpdateOptions) (*mlApi.ArangoMLBatchJob, error) {
return WithUpdateStatusInterfaceRetry[mlApi.ArangoMLBatchJobStatus, *mlApi.ArangoMLBatchJob](ctx, client, obj, status, opts)
}
func WithArangoStorageUpdateStatusInterfaceRetry(ctx context.Context, client UpdateStatusInterface[mlApi.ArangoMLStorageStatus, *mlApi.ArangoMLStorage], obj *mlApi.ArangoMLStorage, status mlApi.ArangoMLStorageStatus, opts meta.UpdateOptions) (*mlApi.ArangoMLStorage, error) {
return WithUpdateStatusInterfaceRetry[mlApi.ArangoMLStorageStatus, *mlApi.ArangoMLStorage](ctx, client, obj, status, opts)
}