turbonomic / kubeturbo

140 stars 75 forks source link

Trb 23038 add logging to find target #898

Closed andreiastra closed 1 year ago

andreiastra commented 1 year ago

Intent

Add extra logging to addTarget, see related commits https://github.com/turbonomic/turbo-api/pull/19 https://github.com/turbonomic/turbo-go-sdk/pull/159

Background

Customer sees duplicate Kubeturbo targets. We cannot reproduce the problem in-house. We need extra logging to track the problem.

Testing

I0710 09:56:18.948909   71033 api_client.go:233] Find target &{Category:Cloud Native ClassName: DisplayName: IdentifyingFields:[] InputFields:[0x14000793c70 0x14000793d40 0x14000793e10 0x14000793ee0 0x140009a21a0 0x140009a2270 0x140009a2340] LastValidated: Links:[] Status: Type:Kubernetes UUID:}
I0710 09:56:18.948921   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description: DisplayName: GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:targetIdentifier UUID: Value:Kubernetes-Astra Test ValueType: VerificationRegex:}
I0710 09:56:18.948927   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description: DisplayName: GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:masterHost UUID: Value:https://9.46.74.187:6443 ValueType: VerificationRegex:}
I0710 09:56:18.948931   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description: DisplayName: GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:serverVersion UUID: Value:v1.27.3+k3s1 ValueType: VerificationRegex:}
I0710 09:56:18.948934   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description: DisplayName: GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:image UUID: Value: ValueType: VerificationRegex:}
I0710 09:56:18.948937   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description: DisplayName: GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:imageID UUID: Value: ValueType: VerificationRegex:}
I0710 09:56:18.948940   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description: DisplayName: GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:probeVersion UUID: Value:latest ValueType: VerificationRegex:}
I0710 09:56:18.948943   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description: DisplayName: GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:communicationBindingChannel UUID: Value:861c12f7-274a-48c2-8814-25dd8d3c4510 ValueType: VerificationRegex:}
...
I0710 09:56:19.175957   71033 api_client.go:233] Trying to match with target &{Category:Cloud Native ClassName: DisplayName:Kubernetes-Astra Test IdentifyingFields:[] InputFields:[0x1400088d450 0x1400088d520 0x1400088d5f0 0x1400088d6c0 0x1400088d790 0x1400088d860 0x1400088d930] LastValidated:2023-07-10T08:54:53Z Links:[] Status:Probe version ('latest') is custom; please confirm image being used supports server version '8.9.1'. Type:Kubernetes UUID:75050749783008}
I0710 09:56:19.175967   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description:Name of the Kubernetes cluster DisplayName:Name GroupProperties:[] IsMandatory:true IsSecret:false Links:[] Name:targetIdentifier UUID: Value:Kubernetes-Astra Test ValueType:STRING VerificationRegex:.*}
I0710 09:56:19.175973   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description:Address of the Kubernetes master DisplayName:Master Host GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:masterHost UUID: Value:https://9.46.74.187:6443 ValueType:STRING VerificationRegex:.*}
I0710 09:56:19.175976   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description:Version of the Kubernetes server DisplayName:Kubernetes Server Version GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:serverVersion UUID: Value:v1.27.3+k3s1 ValueType:STRING VerificationRegex:.*}
I0710 09:56:19.175979   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description:Container Image of Kubeturbo Probe DisplayName:Kubeturbo Image GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:image UUID: Value: ValueType:STRING VerificationRegex:.*}
I0710 09:56:19.175983   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description:Container Image ID of Kubeturbo Probe DisplayName:Kubeturbo Image ID GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:imageID UUID: Value: ValueType:STRING VerificationRegex:.*}
I0710 09:56:19.175986   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description:Release Version of Kubeturbo Probe DisplayName:Kubeturbo Version GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:probeVersion UUID: Value:latest ValueType:STRING VerificationRegex:.*}
I0710 09:56:19.175989   71033 api_client.go:235] Input field: &{ClassName: DefaultValue: Description: DisplayName:communicationBindingChannel GroupProperties:[] IsMandatory:false IsSecret:false Links:[] Name:communicationBindingChannel UUID: Value:861c12f7-274a-48c2-8814-25dd8d3c4510 ValueType: VerificationRegex:}
I0710 09:56:19.175995   71033 api_client.go:281] Found target match
I0710 09:56:19.175998   71033 api_client.go:151] Target Kubernetes-Astra Test already exists.

Checklist

These are the items that must be done by the developer and by reviewers before the change is ready to merge. Please strikeout any items that are not applicable, but don't delete them

Audience

(@ mention any review/... groups or people that should be aware of this merge request)