Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update msgraphsdk to v0.61.0 and k8s deps to v1.26 #832

Merged
merged 6 commits into from
Apr 11, 2023

Conversation

aramase
Copy link
Member

@aramase aramase commented Apr 10, 2023

  • update otel to v0.37.0 and update metrics
  • update msgraph-beta-sdk-go to msgraph-sdk-go/v0.61.0
  • update golangci-lint to v1.52.2
  • update k8s deps to v1.26

fixes #433

@aramase aramase force-pushed the aramase/f/msgraph_sdk_go_latest branch 2 times, most recently from 73ed806 to b5a1cf1 Compare April 10, 2023 19:38
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2023

Codecov Report

Merging #832 (1bd7e04) into main (544b901) will increase coverage by 0.65%.
The diff coverage is 22.95%.

@@            Coverage Diff             @@
##             main     #832      +/-   ##
==========================================
+ Coverage   50.92%   51.58%   +0.65%     
==========================================
  Files          36       36              
  Lines        2370     2367       -3     
==========================================
+ Hits         1207     1221      +14     
+ Misses       1116     1100      -16     
+ Partials       47       46       -1     
Impacted Files Coverage Δ
pkg/cloud/azureclient.go 0.00% <0.00%> (ø)
pkg/cloud/errors.go 31.11% <0.00%> (ø)
pkg/cloud/graph.go 2.77% <0.00%> (+0.12%) ⬆️
pkg/cmd/serviceaccount/auth/provider.go 15.97% <0.00%> (ø)
pkg/proxy/proxy.go 26.28% <0.00%> (+0.16%) ⬆️
pkg/webhook/webhook.go 78.66% <25.00%> (+0.40%) ⬆️
pkg/cmd/serviceaccount/create.go 68.42% <100.00%> (ø)
pkg/cmd/serviceaccount/delete.go 50.00% <100.00%> (ø)
...count/phases/create/federatedidentitycredential.go 95.31% <100.00%> (ø)
pkg/webhook/stats_reporter.go 100.00% <100.00%> (+100.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@aramase aramase force-pushed the aramase/f/msgraph_sdk_go_latest branch 2 times, most recently from 7cd7eae to 4577632 Compare April 10, 2023 23:46
Signed-off-by: Anish Ramasekar <[email protected]>
@aramase aramase force-pushed the aramase/f/msgraph_sdk_go_latest branch from 4577632 to 22cf5f4 Compare April 11, 2023 00:07
Signed-off-by: Anish Ramasekar <[email protected]>
@aramase
Copy link
Member Author

aramase commented Apr 11, 2023

github.com/Azure/azure-workload-identity was only required in test module for the constants. I've decoupled that and remove the dep to fix (and reduce) conflicts with otel deps used in k8s, graph sdks as part of 1bd7e04

@aramase aramase marked this pull request as ready for review April 11, 2023 01:39
@aramase aramase changed the title chore: update msgraphsdk to v0.61.0 chore: update msgraphsdk to v0.61.0 and k8s deps to v1.26 Apr 11, 2023
@aramase aramase requested review from enj and sozercan April 11, 2023 01:42
@aramase aramase added this to the v1.1.0 milestone Apr 11, 2023
Copy link
Member

@enj enj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aramase can you manually confirm that the logging changes to the CLI still work?

type reporter struct {
metric.Meter
}
func registerMetrics() error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have to be global?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only used in webhook and register is called when pod mutator is created, so we don't need this to be global.


roleAssignmentsClient authorization.RoleAssignmentsClient
roleDefinitionsClient authorization.RoleDefinitionsClient
}

// NewAzureClientWithCLI creates an AzureClient configured from Azure CLI 2.0 for local development scenarios.
func NewAzureClientWithCLI(env azure.Environment, subscriptionID, tenantID string, client *http.Client) (*AzureClient, error) {
_, tenantID, err := getOAuthConfig(env, subscriptionID, tenantID)
_, _, err := getOAuthConfig(env, tenantID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really hope all these string changes are correct xD

@aramase
Copy link
Member Author

aramase commented Apr 11, 2023

@aramase can you manually confirm that the logging changes to the CLI still work?

Validated it locally

Tue, 11 Apr 2023 19:23:24 UTC  auth/provider.go:191  No subscription provided, using selected subscription from Azure CLI  {"subscriptionID": "SUB_ID"}
Tue, 11 Apr 2023 19:23:24 UTC  cloud/azureclient.go:235  Resolving tenantID  {"subscriptionID": "SUB_ID"}
Tue, 11 Apr 2023 19:23:24 UTC  cloud/graph.go:91  Getting application  {"displayName": "aramase-kindkv"}
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:466  curl -v -XGET  -H "User-Agent: azsdk-go-azidentity/v1.2.2 (go1.20.3; linux)" 'https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=https%3A%2F%2Flogin.microsoftonline.com%2FTENANT_ID%2Foauth2%2Fv2.0%2Fauthorize'
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:495  HTTP Trace: DNS Lookup for login.microsoftonline.com resolved to [{40.126.29.11 } {40.126.29.15 } {40.126.29.10 } {40.126.29.8 } {40.126.29.7 } {40.126.29.9 } {20.190.157.11 } {40.126.29.14 }]
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:510  HTTP Trace: Dial to tcp:40.126.29.11:443 succeed
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:553  GET https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=https%3A%2F%2Flogin.microsoftonline.com%2FTENANT_ID%2Foauth2%2Fv2.0%2Fauthorize 200 OK in 70 milliseconds
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:570  HTTP Statistics: DNSLookup 3 ms Dial 0 ms TLSHandshake 6 ms ServerProcessing 59 ms Duration 70 ms
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:577  Response Headers:
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Access-Control-Allow-Origin: *
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Date: Tue, 11 Apr 2023 19:23:23 GMT
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Content-Type-Options: nosniff
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Access-Control-Allow-Methods: GET, OPTIONS
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Ms-Request-Id: 5ad0927f-bbfc-44fb-b24f-a85cfa936b00
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Xss-Protection: 0
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Content-Type: application/json; charset=utf-8
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Strict-Transport-Security: max-age=31536000; includeSubDomains
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      P3p: CP="DSP CUR OTPi IND OTRi ONL FIN"
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Client-Request-Id: ed16989d-58e0-4d9f-82b7-0f7e5d21358f
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Cache-Control: max-age=86400, private
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: fpc=AobzfcaRRSRIvQr7krxjd0c; expires=Thu, 11-May-2023 19:23:24 GMT; path=/; secure; HttpOnly; SameSite=None
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: esctx=PAQABAAEAAAD--DLA3VO7QrddgJg7Wevrs6I3LFpeSBIxaoZ7drpdCVpeJCMzMEa1I1dKk7VLz4zcLIYICbWN460jo-1kY21ZrUiHDyDa6S-eiLnIlDipB41wXCFC62kxbjtlKN4ZjS6edrQ_95lS9eZs5z3J-7nTIAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: stsservicecookie=estsfd; path=/; secure; samesite=none; httponly
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Content-Length: 980
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Ms-Ests-Server: 2.1.14939.4 - WUS2 ProdSlices
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:466  curl -v -XGET  -H "User-Agent: azsdk-go-azidentity/v1.2.2 (go1.20.3; linux)" 'https://login.microsoftonline.com/TENANT_ID/v2.0/.well-known/openid-configuration'
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:553  GET https://login.microsoftonline.com/TENANT_ID/v2.0/.well-known/openid-configuration 200 OK in 35 milliseconds
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:570  HTTP Statistics: GetConnection 0 ms ServerProcessing 35 ms Duration 35 ms
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:577  Response Headers:
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Access-Control-Allow-Methods: GET, OPTIONS
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      P3p: CP="DSP CUR OTPi IND OTRi ONL FIN"
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Content-Length: 1753
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Client-Request-Id: bc2804c3-d8db-42c0-ba8f-39f467bfa954
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Ms-Request-Id: e5350e26-7972-4783-a725-5eaf0872f501
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Xss-Protection: 0
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Cache-Control: max-age=86400, private
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Strict-Transport-Security: max-age=31536000; includeSubDomains
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: fpc=AtZzwJMzbIlNvxh9A2JJSWA; expires=Thu, 11-May-2023 19:23:24 GMT; path=/; secure; HttpOnly; SameSite=None
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: esctx=PAQABAAEAAAD--DLA3VO7QrddgJg7Wevro_690c-Brgkfo4KNojeF35viViJiR3W-FGTlupeThdsau-Jhzj5TFrAlijitwTI4jtdddhqmhowVdpf7nBRQRsSyIdYkULnbVPsmfdaL9XgV-5F5rNdTsA3n8AMf0XjJIAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: stsservicecookie=estsfd; path=/; secure; samesite=none; httponly
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Date: Tue, 11 Apr 2023 19:23:23 GMT
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Content-Type: application/json; charset=utf-8
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Content-Type-Options: nosniff
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Access-Control-Allow-Origin: *
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Ms-Ests-Server: 2.1.14939.4 - NCUS ProdSlices
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:466  curl -v -XPOST  -H "Content-Length: 176" -H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" -H "User-Agent: azsdk-go-azidentity/v1.2.2 (go1.20.3; linux)" 'https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/token'
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:553  POST https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/token 400 Bad Request in 5 milliseconds
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:570  HTTP Statistics: GetConnection 0 ms ServerProcessing 5 ms Duration 5 ms
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:577  Response Headers:
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Ms-Request-Id: 3838de21-9ff1-41f9-b0c5-a6350871dd01
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Xss-Protection: 0
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: fpc=Aje9njd7U-REm56_dHo4qM4; expires=Thu, 11-May-2023 19:23:24 GMT; path=/; secure; HttpOnly; SameSite=None
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: stsservicecookie=estsfd; path=/; secure; samesite=none; httponly
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Pragma: no-cache
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      P3p: CP="DSP CUR OTPi IND OTRi ONL FIN"
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Content-Type-Options: nosniff
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Ms-Ests-Server: 2.1.14939.4 - SCUS ProdSlices
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Content-Length: 503
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Cache-Control: no-store, no-cache
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Expires: -1
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Content-Type: application/json; charset=utf-8
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Strict-Transport-Security: max-age=31536000; includeSubDomains
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Client-Request-Id: 6d1405e3-2d37-4630-babb-1e76cfac6515
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Date: Tue, 11 Apr 2023 19:23:23 GMT
Tue, 11 Apr 2023 19:23:24 UTC  serviceaccount/create.go:151  failed to get AAD application object ID. Returning an empty string  {"error": "ClientSecretCredential authentication failed\nPOST https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/token\n--------------------------------------------------------------------------------\nRESPONSE 400 Bad Request\n--------------------------------------------------------------------------------\n{\n  \"error\": \"invalid_request\",\n  \"error_description\": \"AADSTS900144: The request body must contain the following parameter: 'grant_type'.\\r\\nTrace ID: 3838de21-9ff1-41f9-b0c5-a6350871dd01\\r\\nCorrelation ID: 6d1405e3-2d37-4630-babb-1e76cfac6515\\r\\nTimestamp: 2023-04-11 19:23:24Z\",\n  \"error_codes\": [\n    900144\n  ],\n  \"timestamp\": \"2023-04-11 19:23:24Z\",\n  \"trace_id\": \"3838de21-9ff1-41f9-b0c5-a6350871dd01\",\n  \"correlation_id\": \"6d1405e3-2d37-4630-babb-1e76cfac6515\",\n  \"error_uri\": \"https://login.microsoftonline.com/error?code=900144\"\n}\n--------------------------------------------------------------------------------\nTo troubleshoot, visit https://aka.ms/azsdk/go/identity/troubleshoot#client-secret"}
Tue, 11 Apr 2023 19:23:24 UTC  cloud/graph.go:130  Adding federated credential  {"objectID": ""}
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:466  curl -v -XPOST  -H "User-Agent: azsdk-go-azidentity/v1.2.2 (go1.20.3; linux)" -H "Content-Length: 176" -H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" 'https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/token'
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:553  POST https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/token 400 Bad Request in 48 milliseconds
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:570  HTTP Statistics: GetConnection 0 ms ServerProcessing 47 ms Duration 48 ms
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:577  Response Headers:
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Content-Type-Options: nosniff
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Client-Request-Id: 6ee7c53e-4a35-43d3-99ca-5463a6fb8de6
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Pragma: no-cache
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Expires: -1
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Date: Tue, 11 Apr 2023 19:23:24 GMT
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Content-Length: 503
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Cache-Control: no-store, no-cache
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Content-Type: application/json; charset=utf-8
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Strict-Transport-Security: max-age=31536000; includeSubDomains
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Ms-Ests-Server: 2.1.15049.4 - WUS2 ProdSlices
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Xss-Protection: 0
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: fpc=Am1TiIDA-W5GtS__uR0VWvA; expires=Thu, 11-May-2023 19:23:24 GMT; path=/; secure; HttpOnly; SameSite=None
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      Set-Cookie: stsservicecookie=estsfd; path=/; secure; samesite=none; httponly
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      P3p: CP="DSP CUR OTPi IND OTRi ONL FIN"
Tue, 11 Apr 2023 19:23:24 UTC  transport/round_trippers.go:580      X-Ms-Request-Id: 56bf3ae0-eb0e-4d4b-ad70-b4f03bff4401
Error: failed to run phase federated-identity: failed to add federated credential: ClientSecretCredential authentication failed
POST https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/token
--------------------------------------------------------------------------------
RESPONSE 400 Bad Request
--------------------------------------------------------------------------------
{
  "error": "invalid_request",
  "error_description": "AADSTS900144: The request body must contain the following parameter: 'grant_type'.\r\nTrace ID: 56bf3ae0-eb0e-4d4b-ad70-b4f03bff4401\r\nCorrelation ID: 6ee7c53e-4a35-43d3-99ca-5463a6fb8de6\r\nTimestamp: 2023-04-11 19:23:24Z",
  "error_codes": [
    900144
  ],
  "timestamp": "2023-04-11 19:23:24Z",
  "trace_id": "56bf3ae0-eb0e-4d4b-ad70-b4f03bff4401",
  "correlation_id": "6ee7c53e-4a35-43d3-99ca-5463a6fb8de6",
  "error_uri": "https://login.microsoftonline.com/error?code=900144"
}
--------------------------------------------------------------------------------
To troubleshoot, visit https://aka.ms/azsdk/go/identity/troubleshoot#client-secret

@aramase aramase requested a review from enj April 11, 2023 19:29
@enj enj merged commit 348c89a into Azure:main Apr 11, 2023
@aramase aramase deleted the aramase/f/msgraph_sdk_go_latest branch April 11, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update github.com/microsoftgraph/msgraph-beta-sdk-go to latest
3 participants