Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test #232

Merged
merged 6 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,19 @@ help: ## Display this help.
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-doris crd:generateEmbeddedObjectMeta=true webhook paths="./api/doris/..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=manager-doris crd:generateEmbeddedObjectMeta=true webhook paths="./api/doris/..." output:crd:artifacts:config=helm-charts/doris-operator/crds
$(CONTROLLER_GEN) rbac:roleName=manager-doris crd:generateEmbeddedObjectMeta=true webhook paths="./api/disaggregated/..." output:crd:artifacts:config=config/crd/bases
cat config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml > config/crd/bases/crds.yaml
cat config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml >> config/crd/bases/crds.yaml
cat config/crd/bases/apps.foundationdb.org_foundationdbrestores.yaml >> config/crd/bases/crds.yaml
cat config/crd/bases/doris.selectdb.com_dorisclusters.yaml >> config/crd/bases/crds.yaml
$(CONTROLLER_GEN) rbac:roleName=manager-doris crd:generateEmbeddedObjectMeta=true webhook paths="./api/disaggregated/cluster/..." output:crd:artifacts:config=config/crd/bases
#cat config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml > config/crd/bases/crds.yaml
#cat config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml >> config/crd/bases/crds.yaml
#cat config/crd/bases/apps.foundationdb.org_foundationdbrestores.yaml >> config/crd/bases/crds.yaml
cat config/crd/bases/doris.selectdb.com_dorisclusters.yaml > config/crd/bases/crds.yaml
cat config/crd/bases/disaggregated.cluster.doris.com_dorisdisaggregatedclusters.yaml >> config/crd/bases/crds.yaml
cat config/crd/bases/disaggregated.metaservice.doris.com_dorisdisaggregatedmetaservices.yaml >> config/crd/bases/crds.yaml
#cat config/crd/bases/disaggregated.metaservice.doris.com_dorisdisaggregatedmetaservices.yaml >> config/crd/bases/crds.yaml


.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/..."
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/doris/..."
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/disaggregated/cluster/..."

.PHONY: fmt
fmt: ## Run go fmt against code.
Expand Down Expand Up @@ -199,7 +200,7 @@ gen-tool: ## Download gen-crd-api-reference-docs locally if necessary.
gen-api: gen-tool
$(GEN_DOCS) -api-dir "./api/doris/v1" -config "./hack/gen-api/config.json" -template-dir "./hack/gen-api/template" -out-file "doc/api.md"
$(GEN_DOCS) -api-dir "./api/disaggregated/cluster/v1" -config "./hack/gen-api/config.json" -template-dir "./hack/gen-api/template" -out-file "doc/disaggregated_cluster_api.md"
$(GEN_DOCS) -api-dir "./api/disaggregated/metaservice/v1" -config "./hack/gen-api/config.json" -template-dir "./hack/gen-api/template" -out-file "doc/disaggregated_metaservice_api.md"
#$(GEN_DOCS) -api-dir "./api/disaggregated/metaservice/v1" -config "./hack/gen-api/config.json" -template-dir "./hack/gen-api/template" -out-file "doc/disaggregated_metaservice_api.md"

.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type DorisDisaggregatedClusterSpec struct {
InstanceConfigMap string `json:"instanceConfigMap,omitempty"`

//MetaService describe the metaservice that cluster want to storage metadata.
DisMS DisMS `json:"disMS,omitempty"`
MetaService `json:"metaService,omitempty"`

//FeSpec describe the fe specification of doris disaggregated cluster.
FeSpec FeSpec `json:"feSpec,omitempty"`
Expand All @@ -37,7 +37,7 @@ type DorisDisaggregatedClusterSpec struct {
ComputeClusters []ComputeCluster `json:"computeClusters,omitempty"`
}

type DisMS struct {
type MetaService struct {
//Namespace specify the namespace of metaservice deployed.
Namespace string `json:"namespace,omitempty"`
//Name specify the name of metaservice resource.
Expand Down
2 changes: 1 addition & 1 deletion cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func init() {
controller.Controllers = append(controller.Controllers, &controller.DorisClusterReconciler{}, &unnamedwatches.WResource{})
start := os.Getenv("START_DISAGGREGATED_OPERATOR")
if start == "true" {
controller.Controllers = append(controller.Controllers, &controller.DisaggregatedClusterReconciler{}, &controller.DisaggregatedMetaServiceReconciler{})
controller.Controllers = append(controller.Controllers, &controller.DisaggregatedClusterReconciler{})
}
}

Expand Down
Loading