Skip to content

Commit

Permalink
Merge pull request #9 from MZC-CSC/feature_20240925_tumblebug-label-c…
Browse files Browse the repository at this point in the history
…heck

Feature 20240925 tumblebug label check
  • Loading branch information
hippo-an authored Sep 25, 2024
2 parents da8d010 + fbb7d72 commit 902ddc7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
9 changes: 5 additions & 4 deletions internal/core/load/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ const (
antNsId = "ant-default-ns"
antMciDescription = "Default MCI for Cloud Migration Verification"
antInstallMonAgent = "no"
antLabelKey = "ant-default-label"
antMciLabel = "DynamicMci,AntDefault"
antMciId = "ant-default-mci"

Expand Down Expand Up @@ -429,7 +430,7 @@ func (l *LoadService) InstallLoadGenerator(param InstallLoadGeneratorParam) (Loa
VmId: vm.CspViewVMDetail.IID.SystemID,
StartTime: vm.CspViewVMDetail.StartTime,
AdditionalVmKey: vm.ID,
Label: vm.Label,
Label: "temp-label",
IsCluster: false,
IsMaster: i == 0,
ClusterSize: uint64(len(antMci.VMs)),
Expand Down Expand Up @@ -553,7 +554,7 @@ func (l *LoadService) getAndDefaultMci(ctx context.Context, antVmCommonSpec, ant
dynamicMciArg := tumblebug.DynamicMciReq{
Description: antMciDescription,
InstallMonAgent: antInstallMonAgent,
Label: map[string]string{"label": "DynamicMci,AntDefault"},
Label: map[string]string{antLabelKey: antMciLabel},
Name: antMciId,
SystemLabel: "",
VM: []tumblebug.DynamicVmReq{
Expand All @@ -562,7 +563,7 @@ func (l *LoadService) getAndDefaultMci(ctx context.Context, antVmCommonSpec, ant
CommonSpec: antVmCommonSpec,
ConnectionName: antVmConnectionName,
Description: antVmDescription,
Label: antVmLabel,
Label: map[string]string{antLabelKey: antVmLabel},
Name: antVmName,
RootDiskSize: antVmRootDiskSize,
RootDiskType: antVmRootDiskType,
Expand All @@ -586,7 +587,7 @@ func (l *LoadService) getAndDefaultMci(ctx context.Context, antVmCommonSpec, ant
CommonSpec: antVmCommonSpec,
ConnectionName: antVmConnectionName,
Description: antVmDescription,
Label: antVmLabel,
Label: map[string]string{antLabelKey: antVmLabel},
Name: antVmName,
RootDiskSize: antVmRootDiskSize,
RootDiskType: antVmRootDiskType,
Expand Down
20 changes: 10 additions & 10 deletions internal/infra/outbound/tumblebug/req.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ type CreateNsReq struct {
}

type DynamicVmReq struct {
CommonImage string `json:"commonImage"`
CommonSpec string `json:"commonSpec"`
ConnectionName string `json:"connectionName"`
Description string `json:"description"`
Label string `json:"label"`
Name string `json:"name"`
RootDiskSize string `json:"rootDiskSize"`
RootDiskType string `json:"rootDiskType"`
SubGroupSize string `json:"subGroupSize"`
VMUserPassword string `json:"vmUserPassword"`
CommonImage string `json:"commonImage"`
CommonSpec string `json:"commonSpec"`
ConnectionName string `json:"connectionName"`
Description string `json:"description"`
Label map[string]string `json:"label"`
Name string `json:"name"`
RootDiskSize string `json:"rootDiskSize"`
RootDiskType string `json:"rootDiskType"`
SubGroupSize string `json:"subGroupSize"`
VMUserPassword string `json:"vmUserPassword"`
}

type DynamicMciReq struct {
Expand Down
32 changes: 16 additions & 16 deletions internal/infra/outbound/tumblebug/res.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import (
)

type MciRes struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
StatusCount StatusCountRes `json:"statusCount,omitempty"`
TargetStatus string `json:"targetStatus,omitempty"`
TargetAction string `json:"targetAction,omitempty"`
InstallMonAgent string `json:"installMonAgent,omitempty"`
ConfigureCloudAdaptiveNetwork string `json:"configureCloudAdaptiveNetwork,omitempty"`
Label string `json:"label,omitempty"`
SystemLabel string `json:"systemLabel,omitempty"`
SystemMessage string `json:"systemMessage,omitempty"`
Description string `json:"description,omitempty"`
VMs []VmRes `json:"vm,omitempty"`
NewVMList []string `json:"newVmList,omitempty"`
PlacementAlgo string `json:"placementAlgo"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
StatusCount StatusCountRes `json:"statusCount,omitempty"`
TargetStatus string `json:"targetStatus,omitempty"`
TargetAction string `json:"targetAction,omitempty"`
InstallMonAgent string `json:"installMonAgent,omitempty"`
ConfigureCloudAdaptiveNetwork string `json:"configureCloudAdaptiveNetwork,omitempty"`
Label map[string]string `json:"label,omitempty"`
SystemLabel string `json:"systemLabel,omitempty"`
SystemMessage string `json:"systemMessage,omitempty"`
Description string `json:"description,omitempty"`
VMs []VmRes `json:"vm,omitempty"`
NewVMList []string `json:"newVmList,omitempty"`
PlacementAlgo string `json:"placementAlgo"`
}

type StatusCountRes struct {
Expand Down Expand Up @@ -106,7 +106,7 @@ type VmRes struct {
NetworkAgentStatus string `json:"networkAgentStatus,omitempty"`
SystemMessage string `json:"systemMessage,omitempty"`
CreatedTime string `json:"createdTime,omitempty"`
Label string `json:"label,omitempty"`
Label map[string]string `json:"label,omitempty"`
Description string `json:"description,omitempty"`
Region RegionRes `json:"region,omitempty"`
PublicIP string `json:"publicIP,omitempty"`
Expand Down

0 comments on commit 902ddc7

Please sign in to comment.