-
Notifications
You must be signed in to change notification settings - Fork 547
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
Add a warning to remember how to configure a custom Gitlab host #2816
Add a warning to remember how to configure a custom Gitlab host #2816
Conversation
refs sigstore#2730 Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
07e4ae4
to
13bd977
Compare
Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #2816 +/- ##
==========================================
+ Coverage 28.99% 29.51% +0.52%
==========================================
Files 151 151
Lines 9655 9655
==========================================
+ Hits 2799 2850 +51
+ Misses 6436 6366 -70
- Partials 420 439 +19 see 4 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
pkg/cosign/git/gitlab/gitlab.go
Outdated
@@ -70,6 +71,7 @@ func (g *Gl) PutSecret(ctx context.Context, ref string, pf cosign.PassFunc) erro | |||
EnvironmentScope: gitlab.String("*"), | |||
}) | |||
if err != nil { | |||
ui.Infof(ctx, "WARNING: if you want to use a custom Gitlab host, set the \"GITLAB_HOST\" environment variable.") |
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.
maybe, we can say something like: "if you are using a self-hosted gitlab please set the GITLAB_HOST your server name"
thanks for this PR!
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.
thanks for suggestion, changed!
Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
pkg/cosign/git/gitlab/gitlab.go
Outdated
@@ -70,6 +71,7 @@ func (g *Gl) PutSecret(ctx context.Context, ref string, pf cosign.PassFunc) erro | |||
EnvironmentScope: gitlab.String("*"), | |||
}) | |||
if err != nil { | |||
ui.Warnf(ctx, "if you are using a self-hosted gitlab please set the \"GITLAB_HOST\" your server name.") |
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.
nit: if in capital letter "If you are using a self-hosted ...
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.
done
Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
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.
thank you
…tore#2816) * feat: add warning for gitlab host refs sigstore#2730 Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com> * Use ui lib where applicable Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com> * fix: change the message of the warning when the host is not gitlab.com Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com> * fix: use ui.Warnf instead of ui.Infof Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com> * fix: use a capitalized warning message Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com> --------- Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
Resolves #2730
Summary
Add a warning to explain how to use a custom Gitlab host.
I've also changed
fmt.Fprintln
withui.Infof
where applicable.Release Note
NONE
Documentation
NO