Skip to content

Commit

Permalink
disable get moc deploymentid (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpdnju authored Jan 26, 2024
1 parent d0e6702 commit 485930f
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions cloud/telemetry/logutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/go-logr/logr"
"github.com/microsoft/cluster-api-provider-azurestackhci/cloud/scope"
"github.com/microsoft/cluster-api-provider-azurestackhci/cloud/services/health"
"github.com/microsoft/cluster-api-provider-azurestackhci/cloud/services/versions"
mocerrors "github.com/microsoft/moc/pkg/errors"
ctrlutil "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
Expand Down Expand Up @@ -122,16 +121,14 @@ func GenerateMocResourceName(nameSegments ...string) string {
}

type MocInfoLog struct {
MocDeploymentID string `json:"moc_deployment_id"`
WssdCloudAgentVersion string `json:"wssd_cloud_agent_version"`
MocVersion string `json:"moc_version"`
MocDeploymentID string `json:"moc_deployment_id,omitempty"`
WssdCloudAgentVersion string `json:"wssd_cloud_agent_version,omitempty"`
MocVersion string `json:"moc_version,omitempty"`
}

var healthService *health.Service
var versionsService *versions.Service

func WriteMocInfoLog(ctx context.Context, scope scope.ScopeInterface) {
deploymentID := getHealthService(scope).GetMocDeploymentID(ctx)
wssdCloudAgentVersion := ""
mocVersion := ""

Expand All @@ -145,7 +142,6 @@ func WriteMocInfoLog(ctx context.Context, scope scope.ScopeInterface) {
}

infoLog := MocInfoLog{
MocDeploymentID: deploymentID,
WssdCloudAgentVersion: wssdCloudAgentVersion,
MocVersion: mocVersion,
}
Expand All @@ -157,16 +153,6 @@ func WriteMocInfoLog(ctx context.Context, scope scope.ScopeInterface) {
}
}

func getHealthService(scope scope.ScopeInterface) *health.Service {
// if healthService instance is created, directly return instance
if healthService != nil {
return healthService
}

healthService = health.NewService(scope)
return healthService
}

func getVersionsService(scope scope.ScopeInterface) *versions.Service {
if versionsService != nil {
return versionsService
Expand Down

0 comments on commit 485930f

Please sign in to comment.