diff --git a/apis/kubedb/v1alpha2/openapi_generated.go b/apis/kubedb/v1alpha2/openapi_generated.go index 8d93cf5e81..9069593aee 100644 --- a/apis/kubedb/v1alpha2/openapi_generated.go +++ b/apis/kubedb/v1alpha2/openapi_generated.go @@ -826,6 +826,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Topology": schema_apimachinery_apis_kubedb_v1alpha2_Topology(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Weaviate": schema_apimachinery_apis_kubedb_v1alpha2_Weaviate(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.WeaviateApp": schema_apimachinery_apis_kubedb_v1alpha2_WeaviateApp(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.WeaviateConfiguration": schema_apimachinery_apis_kubedb_v1alpha2_WeaviateConfiguration(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.WeaviateList": schema_apimachinery_apis_kubedb_v1alpha2_WeaviateList(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.WeaviateSpec": schema_apimachinery_apis_kubedb_v1alpha2_WeaviateSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.WeaviateStatus": schema_apimachinery_apis_kubedb_v1alpha2_WeaviateStatus(ref), @@ -46950,6 +46951,49 @@ func schema_apimachinery_apis_kubedb_v1alpha2_WeaviateApp(ref common.ReferenceCa } } +func schema_apimachinery_apis_kubedb_v1alpha2_WeaviateConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "secretName": { + SchemaProps: spec.SchemaProps{ + Description: "SecretName is an optional field to provide custom configuration file for the database (i.e. mssql.conf). If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). Configurations from this secret will override default configurations. This secret must be created by user.", + Type: []string{"string"}, + Format: "", + }, + }, + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline contains key-value pairs of configurations to be applied to the database. These configurations will override both default configurations and configurations from the config secret (if any).", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "backupConfigSecret": { + SchemaProps: spec.SchemaProps{ + Description: "BackupConfigSecret is an optional field to provide environment variables from a Kubernetes Secret for backup or other purposes. These env vars will be injected into the database container.", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.LocalObjectReference"}, + } +} + func schema_apimachinery_apis_kubedb_v1alpha2_WeaviateList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -47047,10 +47091,16 @@ func schema_apimachinery_apis_kubedb_v1alpha2_WeaviateSpec(ref common.ReferenceC Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, + "init": { + SchemaProps: spec.SchemaProps{ + Description: "Init is used to initialize database", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec"), + }, + }, "configuration": { SchemaProps: spec.SchemaProps{ Description: "Configuration is an optional field to provide custom configuration file for database (i.e conf.yaml). If specified, this file will be used as configuration file otherwise default configuration file will be used. You can provide custom configurations using Secret or ApplyConfig.", - Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.WeaviateConfiguration"), }, }, "podTemplate": { @@ -47093,7 +47143,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_WeaviateSpec(ref common.ReferenceC }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.WeaviateConfiguration"}, } } diff --git a/apis/kubedb/v1alpha2/weaviate_types.go b/apis/kubedb/v1alpha2/weaviate_types.go index a58a353fe0..7af3509032 100644 --- a/apis/kubedb/v1alpha2/weaviate_types.go +++ b/apis/kubedb/v1alpha2/weaviate_types.go @@ -75,11 +75,15 @@ type WeaviateSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` + // Init is used to initialize database + // +optional + Init *InitSpec `json:"init,omitempty"` + // Configuration is an optional field to provide custom configuration file for database (i.e conf.yaml). // If specified, this file will be used as configuration file otherwise default configuration file will be used. // You can provide custom configurations using Secret or ApplyConfig. // +optional - Configuration *ConfigurationSpec `json:"configuration,omitempty"` + Configuration *WeaviateConfiguration `json:"configuration,omitempty"` // PodTemplate is an optional configuration for pods used to expose database // +optional @@ -120,3 +124,13 @@ type WeaviateList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []Weaviate `json:"items"` } + +type WeaviateConfiguration struct { + ConfigurationSpec `json:",inline,omitempty"` + + // BackupConfigSecret is an optional field to provide environment variables + // from a Kubernetes Secret for backup or other purposes. + // These env vars will be injected into the database container. + // +optional + BackupConfigSecret *core.LocalObjectReference `json:"backupConfigSecret,omitempty"` +} diff --git a/apis/kubedb/v1alpha2/zz_generated.deepcopy.go b/apis/kubedb/v1alpha2/zz_generated.deepcopy.go index f7133437b1..474440c7f0 100644 --- a/apis/kubedb/v1alpha2/zz_generated.deepcopy.go +++ b/apis/kubedb/v1alpha2/zz_generated.deepcopy.go @@ -8076,6 +8076,28 @@ func (in *WeaviateApp) DeepCopy() *WeaviateApp { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WeaviateConfiguration) DeepCopyInto(out *WeaviateConfiguration) { + *out = *in + in.ConfigurationSpec.DeepCopyInto(&out.ConfigurationSpec) + if in.BackupConfigSecret != nil { + in, out := &in.BackupConfigSecret, &out.BackupConfigSecret + *out = new(corev1.LocalObjectReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeaviateConfiguration. +func (in *WeaviateConfiguration) DeepCopy() *WeaviateConfiguration { + if in == nil { + return nil + } + out := new(WeaviateConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WeaviateList) DeepCopyInto(out *WeaviateList) { *out = *in @@ -8127,9 +8149,14 @@ func (in *WeaviateSpec) DeepCopyInto(out *WeaviateSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } + if in.Init != nil { + in, out := &in.Init, &out.Init + *out = new(InitSpec) + (*in).DeepCopyInto(*out) + } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(ConfigurationSpec) + *out = new(WeaviateConfiguration) (*in).DeepCopyInto(*out) } in.PodTemplate.DeepCopyInto(&out.PodTemplate) diff --git a/apis/ops/v1alpha1/openapi_generated.go b/apis/ops/v1alpha1/openapi_generated.go index 05afc20f93..ce05373747 100644 --- a/apis/ops/v1alpha1/openapi_generated.go +++ b/apis/ops/v1alpha1/openapi_generated.go @@ -834,6 +834,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_SolrVolumeExpansionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec": schema_apimachinery_apis_ops_v1alpha1_TLSSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.Topology": schema_apimachinery_apis_ops_v1alpha1_Topology(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateOpsRequest": schema_apimachinery_apis_ops_v1alpha1_WeaviateOpsRequest(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_WeaviateOpsRequestList(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateOpsRequestSpec": schema_apimachinery_apis_ops_v1alpha1_WeaviateOpsRequestSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateReconfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_WeaviateReconfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_ZooKeeperHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperOpsRequest": schema_apimachinery_apis_ops_v1alpha1_ZooKeeperOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_ZooKeeperOpsRequestList(ref), @@ -44214,6 +44218,220 @@ func schema_apimachinery_apis_ops_v1alpha1_Topology(ref common.ReferenceCallback } } +func schema_apimachinery_apis_ops_v1alpha1_WeaviateOpsRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateOpsRequestSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.OpsRequestStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubedb.dev/apimachinery/apis/ops/v1alpha1.OpsRequestStatus", "kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateOpsRequestSpec"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_WeaviateOpsRequestList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WeaviateOpsRequestList is a list of WeaviateOpsRequests", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "Items is a list of WeaviateOpsRequest CRD objects", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateOpsRequest"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateOpsRequest"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_WeaviateOpsRequestSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WeaviateOpsRequestSpec is the spec for WeaviateOpsRequest", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "databaseRef": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the Weaviate reference", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the ops request type: UpdateVersion, HorizontalScaling, VerticalScaling etc.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "restart": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies information necessary for restarting database", + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"), + }, + }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies information necessary for custom configuration of weaviate", + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateReconfigurationSpec"), + }, + }, + "timeout": { + SchemaProps: spec.SchemaProps{ + Description: "Timeout for each step of the ops request in second. If a step doesn't finish within the specified timeout, the ops request will result in failure.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), + }, + }, + "apply": { + SchemaProps: spec.SchemaProps{ + Description: "ApplyOption is to control the execution of OpsRequest depending on the database state.", + Type: []string{"string"}, + Format: "", + }, + }, + "maxRetries": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"databaseRef", "type"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.WeaviateReconfigurationSpec"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_WeaviateReconfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WeaviateReconfigurationSpec is the Weaviate-specific reconfiguration spec. It embeds the generic ReconfigurationSpec and adds Weaviate-specific fields.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "configSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ConfigSecret is an optional field to provide custom configuration file for the database (i.e. mssql.conf, mongod.conf). If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). Configurations from this secret will override default configurations.", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + "applyConfig": { + SchemaProps: spec.SchemaProps{ + Description: "ApplyConfig contains key-value pairs of configurations to be applied to the database. These configurations will override both default configurations and configurations from the config secret (if any).", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "removeCustomConfig": { + SchemaProps: spec.SchemaProps{ + Description: "RemoveCustomConfig when set to true, removes any previous custom configuration (config secret and apply configs) and uses only current configurations (if provided) and the default configurations.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "restart": { + SchemaProps: spec.SchemaProps{ + Description: "Restart controls whether to restart the database during reconfiguration. - auto (default): Operator determines if restart is needed based on configuration changes. - true: Restart the database during reconfiguration. - false: Don't restart the database during reconfiguration.", + Type: []string{"string"}, + Format: "", + }, + }, + "backupConfigSecret": { + SchemaProps: spec.SchemaProps{ + Description: "BackupConfigSecret is an optional field to provide environment variables from a Kubernetes Secret for the database container.", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.LocalObjectReference"}, + } +} + func schema_apimachinery_apis_ops_v1alpha1_ZooKeeperHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/apis/ops/v1alpha1/register.go b/apis/ops/v1alpha1/register.go index 37741d958d..0a703e3fc2 100644 --- a/apis/ops/v1alpha1/register.go +++ b/apis/ops/v1alpha1/register.go @@ -108,6 +108,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &SolrOpsRequestList{}, &ZooKeeperOpsRequest{}, &ZooKeeperOpsRequestList{}, + &WeaviateOpsRequest{}, + &WeaviateOpsRequestList{}, ) scheme.AddKnownTypes(SchemeGroupVersion, diff --git a/apis/ops/v1alpha1/weaviate_ops_helpers.go b/apis/ops/v1alpha1/weaviate_ops_helpers.go new file mode 100644 index 0000000000..7653ddd4f8 --- /dev/null +++ b/apis/ops/v1alpha1/weaviate_ops_helpers.go @@ -0,0 +1,41 @@ +/* +Copyright AppsCode Inc. and Contributors + +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. +*/ + +package v1alpha1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +var _ Accessor = &WeaviateOpsRequest{} + +func (w *WeaviateOpsRequest) GetObjectMeta() metav1.ObjectMeta { + return w.ObjectMeta +} + +func (w *WeaviateOpsRequest) GetDBRefName() string { + return w.Spec.DatabaseRef.Name +} + +func (w *WeaviateOpsRequest) GetRequestType() string { + return string(w.Spec.Type) +} + +func (w *WeaviateOpsRequest) GetStatus() OpsRequestStatus { + return w.Status +} + +func (w *WeaviateOpsRequest) SetStatus(s OpsRequestStatus) { + w.Status = s +} diff --git a/apis/ops/v1alpha1/weaviate_ops_types.go b/apis/ops/v1alpha1/weaviate_ops_types.go new file mode 100644 index 0000000000..aa65dca6aa --- /dev/null +++ b/apis/ops/v1alpha1/weaviate_ops_types.go @@ -0,0 +1,99 @@ +/* +Copyright AppsCode Inc. and Contributors + +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. +*/ + +//go:generate go-enum --mustparse --names --values +package v1alpha1 + +import ( + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + ResourceCodeWeaviateOpsRequest = "wvops" + ResourceKindWeaviateOpsRequest = "WeaviateOpsRequest" + ResourceSingularWeaviateOpsRequest = "weaviateopsrequest" + ResourcePluralWeaviateOpsRequest = "weaviateopsrequests" +) + +// WeaviateDBOpsRequest defines a Weaviate DBA operation. + +// +genclient +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=weaviateopsrequests,singular=weaviateopsrequest,shortName=wvops,categories={ops,kubedb,appscode} +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.phase" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +type WeaviateOpsRequest struct { + metav1.TypeMeta `json:",inline,omitempty"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec WeaviateOpsRequestSpec `json:"spec,omitempty"` + Status OpsRequestStatus `json:"status,omitempty"` +} + +// WeaviateOpsRequestSpec is the spec for WeaviateOpsRequest +type WeaviateOpsRequestSpec struct { + // Specifies the Weaviate reference + DatabaseRef core.LocalObjectReference `json:"databaseRef"` + + // Specifies the ops request type: UpdateVersion, HorizontalScaling, VerticalScaling etc. + Type WeaviateOpsRequestType `json:"type"` + + // Specifies information necessary for restarting database + Restart *RestartSpec `json:"restart,omitempty"` + + // Specifies information necessary for custom configuration of weaviate + Configuration *WeaviateReconfigurationSpec `json:"configuration,omitempty"` + + // Timeout for each step of the ops request in second. If a step doesn't finish within the specified timeout, the ops request will result in failure. + Timeout *metav1.Duration `json:"timeout,omitempty"` + + // ApplyOption is to control the execution of OpsRequest depending on the database state. + // +kubebuilder:default="IfReady" + Apply ApplyOption `json:"apply,omitempty"` + + // +kubebuilder:default=1 + MaxRetries int32 `json:"maxRetries,omitempty"` +} + +// +kubebuilder:validation:Enum=Restart;Reconfigure +// ENUM(Restart,Reconfigure) +type WeaviateOpsRequestType string + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// WeaviateOpsRequestList is a list of WeaviateOpsRequests +type WeaviateOpsRequestList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + // Items is a list of WeaviateOpsRequest CRD objects + Items []WeaviateOpsRequest `json:"items,omitempty"` +} + +// WeaviateReconfigurationSpec is the Weaviate-specific reconfiguration spec. +// It embeds the generic ReconfigurationSpec and adds Weaviate-specific fields. +type WeaviateReconfigurationSpec struct { + ReconfigurationSpec `json:",inline,omitempty"` + // BackupConfigSecret is an optional field to provide environment variables + // from a Kubernetes Secret for the database container. + // +optional + BackupConfigSecret *core.LocalObjectReference `json:"backupConfigSecret,omitempty"` +} diff --git a/apis/ops/v1alpha1/weaviate_ops_types_enum.go b/apis/ops/v1alpha1/weaviate_ops_types_enum.go new file mode 100644 index 0000000000..5ca491270c --- /dev/null +++ b/apis/ops/v1alpha1/weaviate_ops_types_enum.go @@ -0,0 +1,74 @@ +// Code generated by go-enum DO NOT EDIT. +// Version: v0.9.2 + +// Built By: go install + +package v1alpha1 + +import ( + "fmt" + "strings" +) + +const ( + // WeaviateOpsRequestTypeRestart is a WeaviateOpsRequestType of type Restart. + WeaviateOpsRequestTypeRestart WeaviateOpsRequestType = "Restart" + // WeaviateOpsRequestTypeReconfigure is a WeaviateOpsRequestType of type Reconfigure. + WeaviateOpsRequestTypeReconfigure WeaviateOpsRequestType = "Reconfigure" +) + +var ErrInvalidWeaviateOpsRequestType = fmt.Errorf("not a valid WeaviateOpsRequestType, try [%s]", strings.Join(_WeaviateOpsRequestTypeNames, ", ")) + +var _WeaviateOpsRequestTypeNames = []string{ + string(WeaviateOpsRequestTypeRestart), + string(WeaviateOpsRequestTypeReconfigure), +} + +// WeaviateOpsRequestTypeNames returns a list of possible string values of WeaviateOpsRequestType. +func WeaviateOpsRequestTypeNames() []string { + tmp := make([]string, len(_WeaviateOpsRequestTypeNames)) + copy(tmp, _WeaviateOpsRequestTypeNames) + return tmp +} + +// WeaviateOpsRequestTypeValues returns a list of the values for WeaviateOpsRequestType +func WeaviateOpsRequestTypeValues() []WeaviateOpsRequestType { + return []WeaviateOpsRequestType{ + WeaviateOpsRequestTypeRestart, + WeaviateOpsRequestTypeReconfigure, + } +} + +// String implements the Stringer interface. +func (x WeaviateOpsRequestType) String() string { + return string(x) +} + +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x WeaviateOpsRequestType) IsValid() bool { + _, err := ParseWeaviateOpsRequestType(string(x)) + return err == nil +} + +var _WeaviateOpsRequestTypeValue = map[string]WeaviateOpsRequestType{ + "Restart": WeaviateOpsRequestTypeRestart, + "Reconfigure": WeaviateOpsRequestTypeReconfigure, +} + +// ParseWeaviateOpsRequestType attempts to convert a string to a WeaviateOpsRequestType. +func ParseWeaviateOpsRequestType(name string) (WeaviateOpsRequestType, error) { + if x, ok := _WeaviateOpsRequestTypeValue[name]; ok { + return x, nil + } + return WeaviateOpsRequestType(""), fmt.Errorf("%s is %w", name, ErrInvalidWeaviateOpsRequestType) +} + +// MustParseWeaviateOpsRequestType converts a string to a WeaviateOpsRequestType, and panics if is not valid. +func MustParseWeaviateOpsRequestType(name string) WeaviateOpsRequestType { + val, err := ParseWeaviateOpsRequestType(name) + if err != nil { + panic(err) + } + return val +} diff --git a/apis/ops/v1alpha1/zz_generated.deepcopy.go b/apis/ops/v1alpha1/zz_generated.deepcopy.go index ac2e403be2..eb4e126082 100644 --- a/apis/ops/v1alpha1/zz_generated.deepcopy.go +++ b/apis/ops/v1alpha1/zz_generated.deepcopy.go @@ -7571,6 +7571,121 @@ func (in *Topology) DeepCopy() *Topology { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WeaviateOpsRequest) DeepCopyInto(out *WeaviateOpsRequest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeaviateOpsRequest. +func (in *WeaviateOpsRequest) DeepCopy() *WeaviateOpsRequest { + if in == nil { + return nil + } + out := new(WeaviateOpsRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WeaviateOpsRequest) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WeaviateOpsRequestList) DeepCopyInto(out *WeaviateOpsRequestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]WeaviateOpsRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeaviateOpsRequestList. +func (in *WeaviateOpsRequestList) DeepCopy() *WeaviateOpsRequestList { + if in == nil { + return nil + } + out := new(WeaviateOpsRequestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WeaviateOpsRequestList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WeaviateOpsRequestSpec) DeepCopyInto(out *WeaviateOpsRequestSpec) { + *out = *in + out.DatabaseRef = in.DatabaseRef + if in.Restart != nil { + in, out := &in.Restart, &out.Restart + *out = new(RestartSpec) + **out = **in + } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(WeaviateReconfigurationSpec) + (*in).DeepCopyInto(*out) + } + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(metav1.Duration) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeaviateOpsRequestSpec. +func (in *WeaviateOpsRequestSpec) DeepCopy() *WeaviateOpsRequestSpec { + if in == nil { + return nil + } + out := new(WeaviateOpsRequestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WeaviateReconfigurationSpec) DeepCopyInto(out *WeaviateReconfigurationSpec) { + *out = *in + in.ReconfigurationSpec.DeepCopyInto(&out.ReconfigurationSpec) + if in.BackupConfigSecret != nil { + in, out := &in.BackupConfigSecret, &out.BackupConfigSecret + *out = new(v1.LocalObjectReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeaviateReconfigurationSpec. +func (in *WeaviateReconfigurationSpec) DeepCopy() *WeaviateReconfigurationSpec { + if in == nil { + return nil + } + out := new(WeaviateReconfigurationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ZooKeeperHorizontalScalingSpec) DeepCopyInto(out *ZooKeeperHorizontalScalingSpec) { *out = *in diff --git a/client/clientset/versioned/typed/ops/v1alpha1/fake/fake_ops_client.go b/client/clientset/versioned/typed/ops/v1alpha1/fake/fake_ops_client.go index 08db0593f0..8ceb0859d1 100644 --- a/client/clientset/versioned/typed/ops/v1alpha1/fake/fake_ops_client.go +++ b/client/clientset/versioned/typed/ops/v1alpha1/fake/fake_ops_client.go @@ -133,6 +133,10 @@ func (c *FakeOpsV1alpha1) SolrOpsRequests(namespace string) v1alpha1.SolrOpsRequ return &FakeSolrOpsRequests{c, namespace} } +func (c *FakeOpsV1alpha1) WeaviateOpsRequests(namespace string) v1alpha1.WeaviateOpsRequestInterface { + return &FakeWeaviateOpsRequests{c, namespace} +} + func (c *FakeOpsV1alpha1) ZooKeeperOpsRequests(namespace string) v1alpha1.ZooKeeperOpsRequestInterface { return &FakeZooKeeperOpsRequests{c, namespace} } diff --git a/client/clientset/versioned/typed/ops/v1alpha1/fake/fake_weaviateopsrequest.go b/client/clientset/versioned/typed/ops/v1alpha1/fake/fake_weaviateopsrequest.go new file mode 100644 index 0000000000..7793e1aacf --- /dev/null +++ b/client/clientset/versioned/typed/ops/v1alpha1/fake/fake_weaviateopsrequest.go @@ -0,0 +1,142 @@ +/* +Copyright AppsCode Inc. and Contributors + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "kubedb.dev/apimachinery/apis/ops/v1alpha1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeWeaviateOpsRequests implements WeaviateOpsRequestInterface +type FakeWeaviateOpsRequests struct { + Fake *FakeOpsV1alpha1 + ns string +} + +var weaviateopsrequestsResource = v1alpha1.SchemeGroupVersion.WithResource("weaviateopsrequests") + +var weaviateopsrequestsKind = v1alpha1.SchemeGroupVersion.WithKind("WeaviateOpsRequest") + +// Get takes name of the weaviateOpsRequest, and returns the corresponding weaviateOpsRequest object, and an error if there is any. +func (c *FakeWeaviateOpsRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.WeaviateOpsRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(weaviateopsrequestsResource, c.ns, name), &v1alpha1.WeaviateOpsRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.WeaviateOpsRequest), err +} + +// List takes label and field selectors, and returns the list of WeaviateOpsRequests that match those selectors. +func (c *FakeWeaviateOpsRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.WeaviateOpsRequestList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(weaviateopsrequestsResource, weaviateopsrequestsKind, c.ns, opts), &v1alpha1.WeaviateOpsRequestList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.WeaviateOpsRequestList{ListMeta: obj.(*v1alpha1.WeaviateOpsRequestList).ListMeta} + for _, item := range obj.(*v1alpha1.WeaviateOpsRequestList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested weaviateOpsRequests. +func (c *FakeWeaviateOpsRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(weaviateopsrequestsResource, c.ns, opts)) + +} + +// Create takes the representation of a weaviateOpsRequest and creates it. Returns the server's representation of the weaviateOpsRequest, and an error, if there is any. +func (c *FakeWeaviateOpsRequests) Create(ctx context.Context, weaviateOpsRequest *v1alpha1.WeaviateOpsRequest, opts v1.CreateOptions) (result *v1alpha1.WeaviateOpsRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(weaviateopsrequestsResource, c.ns, weaviateOpsRequest), &v1alpha1.WeaviateOpsRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.WeaviateOpsRequest), err +} + +// Update takes the representation of a weaviateOpsRequest and updates it. Returns the server's representation of the weaviateOpsRequest, and an error, if there is any. +func (c *FakeWeaviateOpsRequests) Update(ctx context.Context, weaviateOpsRequest *v1alpha1.WeaviateOpsRequest, opts v1.UpdateOptions) (result *v1alpha1.WeaviateOpsRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(weaviateopsrequestsResource, c.ns, weaviateOpsRequest), &v1alpha1.WeaviateOpsRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.WeaviateOpsRequest), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeWeaviateOpsRequests) UpdateStatus(ctx context.Context, weaviateOpsRequest *v1alpha1.WeaviateOpsRequest, opts v1.UpdateOptions) (*v1alpha1.WeaviateOpsRequest, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(weaviateopsrequestsResource, "status", c.ns, weaviateOpsRequest), &v1alpha1.WeaviateOpsRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.WeaviateOpsRequest), err +} + +// Delete takes name of the weaviateOpsRequest and deletes it. Returns an error if one occurs. +func (c *FakeWeaviateOpsRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(weaviateopsrequestsResource, c.ns, name, opts), &v1alpha1.WeaviateOpsRequest{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeWeaviateOpsRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(weaviateopsrequestsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.WeaviateOpsRequestList{}) + return err +} + +// Patch applies the patch and returns the patched weaviateOpsRequest. +func (c *FakeWeaviateOpsRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.WeaviateOpsRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(weaviateopsrequestsResource, c.ns, name, pt, data, subresources...), &v1alpha1.WeaviateOpsRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.WeaviateOpsRequest), err +} diff --git a/client/clientset/versioned/typed/ops/v1alpha1/generated_expansion.go b/client/clientset/versioned/typed/ops/v1alpha1/generated_expansion.go index f8f7b446ab..88106f97a5 100644 --- a/client/clientset/versioned/typed/ops/v1alpha1/generated_expansion.go +++ b/client/clientset/versioned/typed/ops/v1alpha1/generated_expansion.go @@ -70,4 +70,6 @@ type SinglestoreOpsRequestExpansion interface{} type SolrOpsRequestExpansion interface{} +type WeaviateOpsRequestExpansion interface{} + type ZooKeeperOpsRequestExpansion interface{} diff --git a/client/clientset/versioned/typed/ops/v1alpha1/ops_client.go b/client/clientset/versioned/typed/ops/v1alpha1/ops_client.go index 66dc77a606..9c2f66282a 100644 --- a/client/clientset/versioned/typed/ops/v1alpha1/ops_client.go +++ b/client/clientset/versioned/typed/ops/v1alpha1/ops_client.go @@ -55,6 +55,7 @@ type OpsV1alpha1Interface interface { RedisSentinelOpsRequestsGetter SinglestoreOpsRequestsGetter SolrOpsRequestsGetter + WeaviateOpsRequestsGetter ZooKeeperOpsRequestsGetter } @@ -167,6 +168,10 @@ func (c *OpsV1alpha1Client) SolrOpsRequests(namespace string) SolrOpsRequestInte return newSolrOpsRequests(c, namespace) } +func (c *OpsV1alpha1Client) WeaviateOpsRequests(namespace string) WeaviateOpsRequestInterface { + return newWeaviateOpsRequests(c, namespace) +} + func (c *OpsV1alpha1Client) ZooKeeperOpsRequests(namespace string) ZooKeeperOpsRequestInterface { return newZooKeeperOpsRequests(c, namespace) } diff --git a/client/clientset/versioned/typed/ops/v1alpha1/weaviateopsrequest.go b/client/clientset/versioned/typed/ops/v1alpha1/weaviateopsrequest.go new file mode 100644 index 0000000000..f7ff326fdd --- /dev/null +++ b/client/clientset/versioned/typed/ops/v1alpha1/weaviateopsrequest.go @@ -0,0 +1,196 @@ +/* +Copyright AppsCode Inc. and Contributors + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "kubedb.dev/apimachinery/apis/ops/v1alpha1" + scheme "kubedb.dev/apimachinery/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// WeaviateOpsRequestsGetter has a method to return a WeaviateOpsRequestInterface. +// A group's client should implement this interface. +type WeaviateOpsRequestsGetter interface { + WeaviateOpsRequests(namespace string) WeaviateOpsRequestInterface +} + +// WeaviateOpsRequestInterface has methods to work with WeaviateOpsRequest resources. +type WeaviateOpsRequestInterface interface { + Create(ctx context.Context, weaviateOpsRequest *v1alpha1.WeaviateOpsRequest, opts v1.CreateOptions) (*v1alpha1.WeaviateOpsRequest, error) + Update(ctx context.Context, weaviateOpsRequest *v1alpha1.WeaviateOpsRequest, opts v1.UpdateOptions) (*v1alpha1.WeaviateOpsRequest, error) + UpdateStatus(ctx context.Context, weaviateOpsRequest *v1alpha1.WeaviateOpsRequest, opts v1.UpdateOptions) (*v1alpha1.WeaviateOpsRequest, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.WeaviateOpsRequest, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.WeaviateOpsRequestList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.WeaviateOpsRequest, err error) + WeaviateOpsRequestExpansion +} + +// weaviateOpsRequests implements WeaviateOpsRequestInterface +type weaviateOpsRequests struct { + client rest.Interface + ns string +} + +// newWeaviateOpsRequests returns a WeaviateOpsRequests +func newWeaviateOpsRequests(c *OpsV1alpha1Client, namespace string) *weaviateOpsRequests { + return &weaviateOpsRequests{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the weaviateOpsRequest, and returns the corresponding weaviateOpsRequest object, and an error if there is any. +func (c *weaviateOpsRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.WeaviateOpsRequest, err error) { + result = &v1alpha1.WeaviateOpsRequest{} + err = c.client.Get(). + Namespace(c.ns). + Resource("weaviateopsrequests"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of WeaviateOpsRequests that match those selectors. +func (c *weaviateOpsRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.WeaviateOpsRequestList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.WeaviateOpsRequestList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("weaviateopsrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested weaviateOpsRequests. +func (c *weaviateOpsRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("weaviateopsrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a weaviateOpsRequest and creates it. Returns the server's representation of the weaviateOpsRequest, and an error, if there is any. +func (c *weaviateOpsRequests) Create(ctx context.Context, weaviateOpsRequest *v1alpha1.WeaviateOpsRequest, opts v1.CreateOptions) (result *v1alpha1.WeaviateOpsRequest, err error) { + result = &v1alpha1.WeaviateOpsRequest{} + err = c.client.Post(). + Namespace(c.ns). + Resource("weaviateopsrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(weaviateOpsRequest). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a weaviateOpsRequest and updates it. Returns the server's representation of the weaviateOpsRequest, and an error, if there is any. +func (c *weaviateOpsRequests) Update(ctx context.Context, weaviateOpsRequest *v1alpha1.WeaviateOpsRequest, opts v1.UpdateOptions) (result *v1alpha1.WeaviateOpsRequest, err error) { + result = &v1alpha1.WeaviateOpsRequest{} + err = c.client.Put(). + Namespace(c.ns). + Resource("weaviateopsrequests"). + Name(weaviateOpsRequest.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(weaviateOpsRequest). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *weaviateOpsRequests) UpdateStatus(ctx context.Context, weaviateOpsRequest *v1alpha1.WeaviateOpsRequest, opts v1.UpdateOptions) (result *v1alpha1.WeaviateOpsRequest, err error) { + result = &v1alpha1.WeaviateOpsRequest{} + err = c.client.Put(). + Namespace(c.ns). + Resource("weaviateopsrequests"). + Name(weaviateOpsRequest.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(weaviateOpsRequest). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the weaviateOpsRequest and deletes it. Returns an error if one occurs. +func (c *weaviateOpsRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("weaviateopsrequests"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *weaviateOpsRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("weaviateopsrequests"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched weaviateOpsRequest. +func (c *weaviateOpsRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.WeaviateOpsRequest, err error) { + result = &v1alpha1.WeaviateOpsRequest{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("weaviateopsrequests"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/informers/externalversions/generic.go b/client/informers/externalversions/generic.go index 0c6821a349..0fe19413a0 100644 --- a/client/informers/externalversions/generic.go +++ b/client/informers/externalversions/generic.go @@ -402,6 +402,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Ops().V1alpha1().SinglestoreOpsRequests().Informer()}, nil case opsv1alpha1.SchemeGroupVersion.WithResource("solropsrequests"): return &genericInformer{resource: resource.GroupResource(), informer: f.Ops().V1alpha1().SolrOpsRequests().Informer()}, nil + case opsv1alpha1.SchemeGroupVersion.WithResource("weaviateopsrequests"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Ops().V1alpha1().WeaviateOpsRequests().Informer()}, nil case opsv1alpha1.SchemeGroupVersion.WithResource("zookeeperopsrequests"): return &genericInformer{resource: resource.GroupResource(), informer: f.Ops().V1alpha1().ZooKeeperOpsRequests().Informer()}, nil diff --git a/client/informers/externalversions/ops/v1alpha1/interface.go b/client/informers/externalversions/ops/v1alpha1/interface.go index a7ae889889..e5ec8dd375 100644 --- a/client/informers/externalversions/ops/v1alpha1/interface.go +++ b/client/informers/externalversions/ops/v1alpha1/interface.go @@ -76,6 +76,8 @@ type Interface interface { SinglestoreOpsRequests() SinglestoreOpsRequestInformer // SolrOpsRequests returns a SolrOpsRequestInformer. SolrOpsRequests() SolrOpsRequestInformer + // WeaviateOpsRequests returns a WeaviateOpsRequestInformer. + WeaviateOpsRequests() WeaviateOpsRequestInformer // ZooKeeperOpsRequests returns a ZooKeeperOpsRequestInformer. ZooKeeperOpsRequests() ZooKeeperOpsRequestInformer } @@ -221,6 +223,11 @@ func (v *version) SolrOpsRequests() SolrOpsRequestInformer { return &solrOpsRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// WeaviateOpsRequests returns a WeaviateOpsRequestInformer. +func (v *version) WeaviateOpsRequests() WeaviateOpsRequestInformer { + return &weaviateOpsRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // ZooKeeperOpsRequests returns a ZooKeeperOpsRequestInformer. func (v *version) ZooKeeperOpsRequests() ZooKeeperOpsRequestInformer { return &zooKeeperOpsRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/client/informers/externalversions/ops/v1alpha1/weaviateopsrequest.go b/client/informers/externalversions/ops/v1alpha1/weaviateopsrequest.go new file mode 100644 index 0000000000..2ea1ae6977 --- /dev/null +++ b/client/informers/externalversions/ops/v1alpha1/weaviateopsrequest.go @@ -0,0 +1,91 @@ +/* +Copyright AppsCode Inc. and Contributors + +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. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + opsv1alpha1 "kubedb.dev/apimachinery/apis/ops/v1alpha1" + versioned "kubedb.dev/apimachinery/client/clientset/versioned" + internalinterfaces "kubedb.dev/apimachinery/client/informers/externalversions/internalinterfaces" + v1alpha1 "kubedb.dev/apimachinery/client/listers/ops/v1alpha1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// WeaviateOpsRequestInformer provides access to a shared informer and lister for +// WeaviateOpsRequests. +type WeaviateOpsRequestInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.WeaviateOpsRequestLister +} + +type weaviateOpsRequestInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewWeaviateOpsRequestInformer constructs a new informer for WeaviateOpsRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewWeaviateOpsRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredWeaviateOpsRequestInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredWeaviateOpsRequestInformer constructs a new informer for WeaviateOpsRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredWeaviateOpsRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.OpsV1alpha1().WeaviateOpsRequests(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.OpsV1alpha1().WeaviateOpsRequests(namespace).Watch(context.TODO(), options) + }, + }, + &opsv1alpha1.WeaviateOpsRequest{}, + resyncPeriod, + indexers, + ) +} + +func (f *weaviateOpsRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredWeaviateOpsRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *weaviateOpsRequestInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&opsv1alpha1.WeaviateOpsRequest{}, f.defaultInformer) +} + +func (f *weaviateOpsRequestInformer) Lister() v1alpha1.WeaviateOpsRequestLister { + return v1alpha1.NewWeaviateOpsRequestLister(f.Informer().GetIndexer()) +} diff --git a/client/listers/ops/v1alpha1/expansion_generated.go b/client/listers/ops/v1alpha1/expansion_generated.go index d06c2f308b..da20f198e9 100644 --- a/client/listers/ops/v1alpha1/expansion_generated.go +++ b/client/listers/ops/v1alpha1/expansion_generated.go @@ -226,6 +226,14 @@ type SolrOpsRequestListerExpansion interface{} // SolrOpsRequestNamespaceLister. type SolrOpsRequestNamespaceListerExpansion interface{} +// WeaviateOpsRequestListerExpansion allows custom methods to be added to +// WeaviateOpsRequestLister. +type WeaviateOpsRequestListerExpansion interface{} + +// WeaviateOpsRequestNamespaceListerExpansion allows custom methods to be added to +// WeaviateOpsRequestNamespaceLister. +type WeaviateOpsRequestNamespaceListerExpansion interface{} + // ZooKeeperOpsRequestListerExpansion allows custom methods to be added to // ZooKeeperOpsRequestLister. type ZooKeeperOpsRequestListerExpansion interface{} diff --git a/client/listers/ops/v1alpha1/weaviateopsrequest.go b/client/listers/ops/v1alpha1/weaviateopsrequest.go new file mode 100644 index 0000000000..bdd807c53a --- /dev/null +++ b/client/listers/ops/v1alpha1/weaviateopsrequest.go @@ -0,0 +1,100 @@ +/* +Copyright AppsCode Inc. and Contributors + +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. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "kubedb.dev/apimachinery/apis/ops/v1alpha1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// WeaviateOpsRequestLister helps list WeaviateOpsRequests. +// All objects returned here must be treated as read-only. +type WeaviateOpsRequestLister interface { + // List lists all WeaviateOpsRequests in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.WeaviateOpsRequest, err error) + // WeaviateOpsRequests returns an object that can list and get WeaviateOpsRequests. + WeaviateOpsRequests(namespace string) WeaviateOpsRequestNamespaceLister + WeaviateOpsRequestListerExpansion +} + +// weaviateOpsRequestLister implements the WeaviateOpsRequestLister interface. +type weaviateOpsRequestLister struct { + indexer cache.Indexer +} + +// NewWeaviateOpsRequestLister returns a new WeaviateOpsRequestLister. +func NewWeaviateOpsRequestLister(indexer cache.Indexer) WeaviateOpsRequestLister { + return &weaviateOpsRequestLister{indexer: indexer} +} + +// List lists all WeaviateOpsRequests in the indexer. +func (s *weaviateOpsRequestLister) List(selector labels.Selector) (ret []*v1alpha1.WeaviateOpsRequest, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.WeaviateOpsRequest)) + }) + return ret, err +} + +// WeaviateOpsRequests returns an object that can list and get WeaviateOpsRequests. +func (s *weaviateOpsRequestLister) WeaviateOpsRequests(namespace string) WeaviateOpsRequestNamespaceLister { + return weaviateOpsRequestNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// WeaviateOpsRequestNamespaceLister helps list and get WeaviateOpsRequests. +// All objects returned here must be treated as read-only. +type WeaviateOpsRequestNamespaceLister interface { + // List lists all WeaviateOpsRequests in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.WeaviateOpsRequest, err error) + // Get retrieves the WeaviateOpsRequest from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.WeaviateOpsRequest, error) + WeaviateOpsRequestNamespaceListerExpansion +} + +// weaviateOpsRequestNamespaceLister implements the WeaviateOpsRequestNamespaceLister +// interface. +type weaviateOpsRequestNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all WeaviateOpsRequests in the indexer for a given namespace. +func (s weaviateOpsRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.WeaviateOpsRequest, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.WeaviateOpsRequest)) + }) + return ret, err +} + +// Get retrieves the WeaviateOpsRequest from the indexer for a given namespace and name. +func (s weaviateOpsRequestNamespaceLister) Get(name string) (*v1alpha1.WeaviateOpsRequest, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("weaviateopsrequest"), name) + } + return obj.(*v1alpha1.WeaviateOpsRequest), nil +} diff --git a/crds/kubedb.com_weaviates.yaml b/crds/kubedb.com_weaviates.yaml index dd9d4c8334..96d78432eb 100644 --- a/crds/kubedb.com_weaviates.yaml +++ b/crds/kubedb.com_weaviates.yaml @@ -73,6 +73,13 @@ spec: x-kubernetes-map-type: atomic configuration: properties: + backupConfigSecret: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic inline: additionalProperties: type: string @@ -110,6 +117,1090 @@ spec: format: int32 type: integer type: object + init: + properties: + archiver: + properties: + encryptionSecret: + properties: + name: + type: string + namespace: + type: string + required: + - name + type: object + fullDBRepository: + properties: + name: + type: string + namespace: + type: string + required: + - name + type: object + manifestOptions: + properties: + archiver: + default: false + type: boolean + archiverRef: + properties: + name: + type: string + namespace: + type: string + required: + - name + type: object + initScript: + default: false + type: boolean + type: object + manifestRepository: + properties: + name: + type: string + namespace: + type: string + required: + - name + type: object + recoveryTimestamp: + format: date-time + type: string + replicationStrategy: + enum: + - fscopy + - clone + - sync + - none + type: string + required: + - recoveryTimestamp + type: object + initialized: + type: boolean + script: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + default: ext4 + type: string + kind: + type: string + readOnly: + default: false + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + required: + - secretName + - shareName + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + x-kubernetes-list-type: atomic + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + required: + - spec + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + x-kubernetes-list-type: atomic + wwids: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + git: + properties: + args: + items: + type: string + type: array + authSecret: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + resources: + properties: + claims: + items: + properties: + name: + type: string + request: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + capabilities: + properties: + add: + items: + type: string + type: array + x-kubernetes-list-type: atomic + drop: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + required: + - args + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + image: + properties: + pullPolicy: + type: string + reference: + type: string + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + default: default + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + x-kubernetes-list-type: atomic + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + targetPortal: + type: string + required: + - iqn + - lun + - targetPortal + type: object + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + clusterTrustBundle: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + name: + type: string + optional: + type: boolean + path: + type: string + signerName: + type: string + required: + - path + type: object + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + required: + - path + type: object + type: object + type: array + x-kubernetes-list-type: atomic + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + default: /etc/ceph/keyring + type: string + monitors: + items: + type: string + type: array + x-kubernetes-list-type: atomic + pool: + default: rbd + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + user: + default: admin + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + default: xfs + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + sslEnabled: + type: boolean + storageMode: + default: ThinProvisioned + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + scriptPath: + type: string + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath + type: object + type: object + waitForInitialRestore: + type: boolean + type: object podTemplate: properties: controller: diff --git a/crds/ops.kubedb.com_weaviateopsrequests.yaml b/crds/ops.kubedb.com_weaviateopsrequests.yaml new file mode 100644 index 0000000000..09f5946e2e --- /dev/null +++ b/crds/ops.kubedb.com_weaviateopsrequests.yaml @@ -0,0 +1,166 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + app.kubernetes.io/name: kubedb + name: weaviateopsrequests.ops.kubedb.com +spec: + group: ops.kubedb.com + names: + categories: + - ops + - kubedb + - appscode + kind: WeaviateOpsRequest + listKind: WeaviateOpsRequestList + plural: weaviateopsrequests + shortNames: + - wvops + singular: weaviateopsrequest + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.type + name: Type + type: string + - jsonPath: .status.phase + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + apply: + default: IfReady + enum: + - IfReady + - Always + type: string + configuration: + properties: + applyConfig: + additionalProperties: + type: string + type: object + backupConfigSecret: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + configSecret: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + removeCustomConfig: + type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string + type: object + databaseRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + maxRetries: + default: 1 + format: int32 + type: integer + restart: + type: object + timeout: + type: string + type: + enum: + - Restart + - Reconfigure + type: string + required: + - databaseRef + - type + type: object + status: + properties: + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + message: + type: string + observedGeneration: + format: int64 + type: integer + reason: + type: string + severity: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + observedGeneration: + format: int64 + type: integer + pausedBackups: + items: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - name + type: object + type: array + phase: + enum: + - Pending + - Progressing + - Successful + - WaitingForApproval + - Failed + - Approved + - Denied + - Skipped + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {}