Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fix-cli-update
Browse files Browse the repository at this point in the history
  • Loading branch information
lizzy-0323 committed Nov 18, 2024
2 parents 85ab6e6 + a2686bb commit 162a72f
Show file tree
Hide file tree
Showing 72 changed files with 2,417 additions and 218 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-docsite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build docsite

on:
push:
branches:
- master
- test-docsite
paths:
- 'docsite/**'
pull_request:
branches:
- master
- test-docsite
paths:
- 'docsite/**'

jobs:
build:
name: build docsite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache-dependency-path: './docsite/yarn.lock'
- name: Install dependencies
run: cd docsite && yarn install --frozen-lockfile
- name: Build website
run: cd docsite && yarn build
9 changes: 9 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,13 @@ resources:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: oceanbase.com
group: oceanbase
kind: OBTenantVariable
path: github.com/oceanbase/ob-operator/api/v1alpha1
version: v1alpha1
version: "3"
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Helm Chart 将 ob-operator 部署的命名空间进行了参数化,可在安
```shell
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm repo update
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.3.0
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace
```

#### 使用 terraform
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Helm Chart parameterizes the namespace in which ob-operator is deployed, allowin
```shell
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm repo update
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.3.0
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace
```

#### Using terraform
Expand Down
18 changes: 18 additions & 0 deletions api/types/variable.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Copyright (c) 2023 OceanBase
ob-operator is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/

package types

type Variable struct {
Name string `json:"name"`
Value string `json:"value"`
}
4 changes: 3 additions & 1 deletion api/v1alpha1/obcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ type OBClusterStatus struct {
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.status"
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="ClusterName",type="string",JSONPath=".spec.clusterName"
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="Image",type="string",JSONPath=".spec.observer.image",priority=1
//+kubebuilder:printcolumn:name="Storage",type="string",JSONPath=".spec.observer.storage",priority=1
//+kubebuilder:printcolumn:name="Tasks",type="string",JSONPath=".status.operationContext.tasks",priority=1
//+kubebuilder:printcolumn:name="Task",type="string",JSONPath=".status.operationContext.task",priority=1

Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/obtenant_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type OBTenantSpec struct {
Credentials TenantCredentials `json:"credentials,omitempty"`
Scenario string `json:"scenario,omitempty"`
Parameters []apitypes.Parameter `json:"parameters,omitempty"`
Variables []apitypes.Variable `json:"variables,omitempty"`
}

type TenantCredentials struct {
Expand Down Expand Up @@ -106,6 +107,7 @@ type OBTenantStatus struct {
Source *TenantSourceStatus `json:"source,omitempty"`
Credentials TenantCredentials `json:"credentials,omitempty"`
Parameters []apitypes.Parameter `json:"parameters,omitempty"`
Variables []apitypes.Variable `json:"variables,omitempty"`
}

type TenantSourceStatus struct {
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/obtenantbackuppolicy_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (r *OBTenantBackupPolicy) ValidateCreate() (admission.Warnings, error) {
Name: r.Spec.TenantCRName,
}, tenant)
if err != nil {
return nil, apierrors.NewNotFound(schema.GroupResource{Group: "oceanbase.oceanbase.com", Resource: "obtenants"}, r.Spec.TenantName)
return nil, apierrors.NewNotFound(schema.GroupResource{Group: "oceanbase.oceanbase.com", Resource: "obtenants"}, r.Spec.TenantCRName)
}

if tenant.Status.Status != tenantstatus.Running {
Expand Down
76 changes: 76 additions & 0 deletions api/v1alpha1/obtenantvariable_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
Copyright 2023.
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"

apitypes "github.com/oceanbase/ob-operator/api/types"
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// OBTenantVariableSpec defines the desired state of OBTenantVariable.
type OBTenantVariableSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of OBTenantVariable. Edit obtenantvariable_types.go to remove/update
OBTenant string `json:"obtenant"`
Variable *apitypes.Variable `json:"variable"`
}

// OBTenantVariableStatus defines the observed state of OBTenantVariable.
type OBTenantVariableStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
OperationContext *tasktypes.OperationContext `json:"operationContext,omitempty"`
Status string `json:"status"`
Variable apitypes.Variable `json:"variable"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Tenant",type="string",JSONPath=".spec.obtenant"
//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.status"
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="Key",type="string",JSONPath=".spec.variable.name"
//+kubebuilder:printcolumn:name="WantedValue",type="string",JSONPath=".spec.variable.value"

// OBTenantVariable is the Schema for the obtenantvariables API.
type OBTenantVariable struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec OBTenantVariableSpec `json:"spec,omitempty"`
Status OBTenantVariableStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// OBTenantVariableList contains a list of OBTenantVariable.
type OBTenantVariableList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []OBTenantVariable `json:"items"`
}

func init() {
SchemeBuilder.Register(&OBTenantVariable{}, &OBTenantVariableList{})
}
104 changes: 104 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 162a72f

Please sign in to comment.