[gke] skip hard error when client misses permissions for some projects#51344
Merged
[gke] skip hard error when client misses permissions for some projects#51344
Conversation
This PR fixes a behavior problem that results in GKE discovery to completely fail when the client misses permissions in some of the discovered projects. If the client misses list permissions for projectID 1 but has the required permissions for projectID 2, the discovery service should continue with the projectID 2 discovery and skip the failing one. Fixes #48101 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
ryanclark
approved these changes
Jan 22, 2025
Comment on lines
+117
to
+122
| if trace.IsAccessDenied(err) { | ||
| a.Logger.WarnContext(ctx, "Access denied to list GKE clusters", "project_id", projectID, "location", a.Location) | ||
| return nil, nil | ||
| } else if err != nil { | ||
| return nil, trace.Wrap(err) | ||
| } |
Member
There was a problem hiding this comment.
I feel like this is a nicer way of doing this
Suggested change
| if trace.IsAccessDenied(err) { | |
| a.Logger.WarnContext(ctx, "Access denied to list GKE clusters", "project_id", projectID, "location", a.Location) | |
| return nil, nil | |
| } else if err != nil { | |
| return nil, trace.Wrap(err) | |
| } | |
| if err != nil { | |
| if trace.IsAccessDenied(err) { | |
| a.Logger.WarnContext(ctx, "Access denied to list GKE clusters", "project_id", projectID, "location", a.Location) | |
| return nil, nil | |
| } | |
| return nil, trace.Wrap(err) | |
| } |
zmb3
approved these changes
Jan 22, 2025
tigrato
added a commit
that referenced
this pull request
Jan 23, 2025
#51344) This PR fixes a behavior problem that results in GKE discovery to completely fail when the client misses permissions in some of the discovered projects. If the client misses list permissions for projectID 1 but has the required permissions for projectID 2, the discovery service should continue with the projectID 2 discovery and skip the failing one. Fixes #48101 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
tigrato
added a commit
that referenced
this pull request
Jan 23, 2025
#51344) This PR fixes a behavior problem that results in GKE discovery to completely fail when the client misses permissions in some of the discovered projects. If the client misses list permissions for projectID 1 but has the required permissions for projectID 2, the discovery service should continue with the projectID 2 discovery and skip the failing one. Fixes #48101 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
tigrato
added a commit
that referenced
this pull request
Jan 23, 2025
#51344) This PR fixes a behavior problem that results in GKE discovery to completely fail when the client misses permissions in some of the discovered projects. If the client misses list permissions for projectID 1 but has the required permissions for projectID 2, the discovery service should continue with the projectID 2 discovery and skip the failing one. Fixes #48101 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
This was referenced Jan 23, 2025
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jan 23, 2025
#51344) (#51400) This PR fixes a behavior problem that results in GKE discovery to completely fail when the client misses permissions in some of the discovered projects. If the client misses list permissions for projectID 1 but has the required permissions for projectID 2, the discovery service should continue with the projectID 2 discovery and skip the failing one. Fixes #48101 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jan 23, 2025
#51344) (#51399) This PR fixes a behavior problem that results in GKE discovery to completely fail when the client misses permissions in some of the discovered projects. If the client misses list permissions for projectID 1 but has the required permissions for projectID 2, the discovery service should continue with the projectID 2 discovery and skip the failing one. Fixes #48101 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jan 23, 2025
#51344) (#51401) This PR fixes a behavior problem that results in GKE discovery to completely fail when the client misses permissions in some of the discovered projects. If the client misses list permissions for projectID 1 but has the required permissions for projectID 2, the discovery service should continue with the projectID 2 discovery and skip the failing one. Fixes #48101 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
carloscastrojumo
pushed a commit
to carloscastrojumo/teleport
that referenced
this pull request
Feb 19, 2025
gravitational#51344) This PR fixes a behavior problem that results in GKE discovery to completely fail when the client misses permissions in some of the discovered projects. If the client misses list permissions for projectID 1 but has the required permissions for projectID 2, the discovery service should continue with the projectID 2 discovery and skip the failing one. Fixes gravitational#48101 Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a behavior problem that results in GKE discovery to completely fail when the client misses permissions in some of the discovered projects.
If the client misses list permissions for projectID 1 but has the required permissions for projectID 2, the discovery service should continue with the projectID 2 discovery and skip the failing one.
Fixes #48101
Changelog: Fixed a bug in GKE auto-discovery where the process failed to discover any clusters if the identity lacked permissions for one or more detected GCP project IDs.