-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[image-builder-mk3] log errors for auth #18611
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
Conversation
17f1a27
to
2cff4b0
Compare
This will help us troubleshoot: * credential reload via watch * potential ECR authN issues * potential additionalAuth issues
f7fb540
to
8c5ee96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to share comments 🙃
defer func() { | ||
if err != nil { | ||
err = fmt.Errorf("error with ECR authenticate: %w", err) | ||
log.WithError(err).WithField("registry", registry).Error("failed ECR authenticate") | ||
} | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few errors in func (ath *ECRAuthenticator) Authenticate(ctx context.Context, registry string)
, which this could help surface.
} | ||
|
||
segs := strings.Split(ath.ecrAuth, ":") | ||
if len(segs) != 2 { | ||
return nil, fmt.Errorf("cannot understand ECR token. Expected 2 segments, got %d", len(segs)) | ||
err = fmt.Errorf("cannot understand ECR token. Expected 2 segments, got %d", len(segs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By setting err
here, it's value will be included in the above defer.
Description
This will help us troubleshoot:
Summary generated by Copilot
🤖 Generated by Copilot at 8082e76
Improve error logging in image-builder-mk3 auth package. Add log messages with error and file or image name in
auth.go
.Related Issue(s)
Relates to ENG-757
How to test
kubectx
for your preview envkubectl get secrets gcp-sa-registry-auth -o yaml > /tmp/secret-backup.yaml
kubectl logs --follow deployment/image-builder-mk3
kubectl apply --server-side --force-conflicts -f /tmp/secret-backup.yaml
Test Scenarios
Success (restored from the backup):
A token that has invalid format, FAKE_INVALID_TOKEN (this error is from docker cli here):
A token that appears valid, FAKE_VALID_TOKEN (passed field validation, contains junk):
Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold