Skip to content

Commit

Permalink
SingleStore Ops-Request
Browse files Browse the repository at this point in the history
Signed-off-by: ashraful <[email protected]>
  • Loading branch information
AshrafulHaqueToni committed May 9, 2024
1 parent 7fb9b8c commit ab2246d
Show file tree
Hide file tree
Showing 18 changed files with 1,515 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apis/ops/v1alpha1/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,9 @@ const (
HorizontalScaleSentinelUp = "HorizontalScaleSentinelUp"
HorizontalScaleSentinelDown = "HorizontalScaleSentinelDown"
)

// SingleStore Constants
const (
UpdateAggregatorNodePVCs = "UpdateAggregatorNodePVCs"
UpdateLeafNodePVCs = "UpdateLeafNodePVCs"
)
236 changes: 236 additions & 0 deletions apis/ops/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apis/ops/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&RedisOpsRequestList{},
&RedisSentinelOpsRequest{},
&RedisSentinelOpsRequestList{},
&SinglestoreOpsRequest{},
&SinglestoreOpsRequestList{},
)

scheme.AddKnownTypes(SchemeGroupVersion,
Expand Down
60 changes: 60 additions & 0 deletions apis/ops/v1alpha1/singlestore_ops_helpers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package v1alpha1

import (
"fmt"

"kubedb.dev/apimachinery/apis"
"kubedb.dev/apimachinery/apis/ops"
"kubedb.dev/apimachinery/crds"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"kmodules.xyz/client-go/apiextensions"
)

func (r *SinglestoreOpsRequest) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralSinglestoreOpsRequest))
}

var _ apis.ResourceInfo = &SinglestoreOpsRequest{}

func (r *SinglestoreOpsRequest) ResourceFQN() string {
return fmt.Sprintf("%s.%s", ResourcePluralSinglestoreOpsRequest, ops.GroupName)
}

func (r *SinglestoreOpsRequest) ResourceShortCode() string {
return ResourceCodeSinglestoreOpsRequest
}

func (r *SinglestoreOpsRequest) ResourceKind() string {
return ResourceKindSinglestoreOpsRequest
}

func (r *SinglestoreOpsRequest) ResourceSingular() string {
return ResourceSingularSinglestoreOpsRequest
}

func (r *SinglestoreOpsRequest) ResourcePlural() string {
return ResourcePluralSinglestoreOpsRequest
}

var _ Accessor = &SinglestoreOpsRequest{}

func (r *SinglestoreOpsRequest) GetObjectMeta() metav1.ObjectMeta {
return r.ObjectMeta
}

func (r *SinglestoreOpsRequest) GetDBRefName() string {
return r.Spec.DatabaseRef.Name
}

func (r *SinglestoreOpsRequest) GetRequestType() any {
return r.Spec.Type
}

func (r *SinglestoreOpsRequest) GetStatus() OpsRequestStatus {
return r.Status
}

func (r *SinglestoreOpsRequest) SetStatus(s OpsRequestStatus) {
r.Status = s
}
Loading

0 comments on commit ab2246d

Please sign in to comment.