From b59bd1648baaa11ce43f52f2b97fb07906bd876f Mon Sep 17 00:00:00 2001 From: mengyipeng <413183498@qq.com> Date: Thu, 7 Nov 2024 15:03:40 +0800 Subject: [PATCH] remove tenancy because it's deprecated --- pkg/cmd/cluster/cluster_test.go | 1 - pkg/cmd/cluster/create_subcmds.go | 5 ----- pkg/cmd/cluster/update.go | 1 - 3 files changed, 7 deletions(-) diff --git a/pkg/cmd/cluster/cluster_test.go b/pkg/cmd/cluster/cluster_test.go index 90ece248e..74493e111 100644 --- a/pkg/cmd/cluster/cluster_test.go +++ b/pkg/cmd/cluster/cluster_test.go @@ -104,7 +104,6 @@ var _ = Describe("Cluster", func() { }) It("with schedulingPolicy", func() { o, err := NewSubCmdsOptions(createOptions, clusterType) - o.Tenancy = "SharedNode" o.TopologyKeys = []string{"zone", "hostname"} o.NodeLabels = map[string]string{"environment": "environment", "region": "region"} o.TolerationsRaw = []string{"key=value:effect", " key:effect"} diff --git a/pkg/cmd/cluster/create_subcmds.go b/pkg/cmd/cluster/create_subcmds.go index e5dd5c231..f99761dfb 100644 --- a/pkg/cmd/cluster/create_subcmds.go +++ b/pkg/cmd/cluster/create_subcmds.go @@ -64,7 +64,6 @@ type CreateSubCmdsOptions struct { // TopologyKeys if TopologyKeys is nil, add omitempty json tag, because CueLang can not covert null to list. TopologyKeys []string `json:"topologyKeys,omitempty"` NodeLabels map[string]string `json:"nodeLabels,omitempty"` - Tenancy string `json:"tenancy"` TolerationsRaw []string `json:"-"` schedulingPolicy *v1.SchedulingPolicy @@ -133,9 +132,6 @@ func buildCreateSubCmds(createOptions *action.CreateOptions) []*cobra.Command { cmd.Flags().StringArrayVar(&o.TopologyKeys, "topology-keys", nil, "Topology keys for affinity") cmd.Flags().StringToStringVar(&o.NodeLabels, "node-labels", nil, "Node label selector") cmd.Flags().StringSliceVar(&o.TolerationsRaw, "tolerations", nil, `Tolerations for cluster, such as "key=value:effect,key:effect", for example '"engineType=mongo:NoSchedule", "diskType:NoSchedule"'`) - if cmd.Flag("tenancy") == nil { - cmd.Flags().StringVar(&o.Tenancy, "tenancy", "SharedNode", "Tenancy options, one of: (SharedNode, DedicatedNode)") - } cmds = append(cmds, cmd) } return cmds @@ -264,7 +260,6 @@ func (o *CreateSubCmdsOptions) Run() error { } _ = unstructured.SetNestedField(clusterObj.Object, converted, "spec", "schedulingPolicy") } - _ = unstructured.SetNestedField(clusterObj.Object, o.Tenancy, "spec", "tenancy") } // only edits the cluster object, other dependency objects are created directly diff --git a/pkg/cmd/cluster/update.go b/pkg/cmd/cluster/update.go index a2c8d6fd4..b80006d36 100644 --- a/pkg/cmd/cluster/update.go +++ b/pkg/cmd/cluster/update.go @@ -117,7 +117,6 @@ type UpdatableFlags struct { // TopologyKeys if TopologyKeys is nil, add omitempty json tag, because CueLang can not covert null to list. TopologyKeys []string `json:"topologyKeys,omitempty"` NodeLabels map[string]string `json:"nodeLabels,omitempty"` - Tenancy string `json:"tenancy"` TolerationsRaw []string `json:"-"` // backup config