-
Notifications
You must be signed in to change notification settings - Fork 363
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
Default index function #668
Default index function #668
Conversation
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.
This is the right call to make constants
really constant.
Looks all good, but you might want to adjust the date :)
/lgtm
/approve
/hold
Co-authored-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
"sigs.k8s.io/krew/pkg/constants" | ||
) | ||
|
||
func DefaultIndex() string { |
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.
a mini unit-test would be great for this.
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.
for sure, I'll add that in
/approve I'm now thinking if this option is worth documenting somewhere. We have other options like $KREW_ROOT that also are not documented, maybe in the future. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmetb, chriskim06, corneliusweig The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I was planning on adding the docs in a separate PR but if you guys think we don't need it for now I can get to it later on |
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.
If you don't forget about it, you can add the docs later. But we are in no hurry with this and it is far less useful while not documented.
pkg/index/util_test.go
Outdated
|
||
func TestDefaultIndex(t *testing.T) { | ||
if got := DefaultIndex(); got != constants.DefaultIndexURI { | ||
t.Errorf("expected DefaultIndex() to be %q; got=%q", constants.DefaultIndexURI, got) |
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.
t.Errorf("expected DefaultIndex() to be %q; got=%q", constants.DefaultIndexURI, got) | |
t.Errorf("DefaultIndex() = %q, want %q", got, constants.DefaultIndexURI) |
Same below.
/lgtm |
Ya I'd like to do them in a separate PR, I'll be able to submit that PR this weekend. /hold cancel |
Adding this based on the comment here #666 (comment). This reverts back
constants.go
so that it only has the constant values and adds apkg/index/util.go
that has theDefaultIndex
function in it./assign @ahmetb
/assign @corneliusweig
Related issue: #637