MCPcopy Create free account
hub / github.com/Azure/ARO-HCP / AddLogValuesForResourceIDString

Method AddLogValuesForResourceIDString

internal/utils/context.go:252–258  ·  view source on GitHub ↗

AddLogValuesForResourceIDString parses a resource ID string and adds common logging key/value pairs. It adds: subscription_id, resource_group, resource_name, and resource_id. If parsing fails, only the resource_id is added.

(resourceIDString string)

Source from the content-addressed store, hash-verified

250
251 if hcpClusterName := metadataapihelpers.ClusterNameFromResourceID(resourceID); hcpClusterName != "" {
252 lv = lv.AddHCPClusterName(hcpClusterName)
253 }
254 return lv
255}
256
257// AddLogValuesForResourceIDString parses a resource ID string and adds common logging key/value pairs.
258// It adds: subscription_id, resource_group, resource_name, and resource_id.
259// If parsing fails, only the resource_id is added.
260func (lv LogValues) AddLogValuesForResourceIDString(resourceIDString string) LogValues {
261 resourceID, err := azcorearm.ParseResourceID(resourceIDString)

Callers 1

extendLogrMethod · 0.80

Calls 2

AddResourceIDMethod · 0.95

Tested by

no test coverage detected