-
Notifications
You must be signed in to change notification settings - Fork 369
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
validate-krew-manifest: add license check #642
Conversation
Ensure platform spec extracts a (case-insensitive) {LICENSE,COPYING}{,.txt} file by looking at the installation directory. Signed-off-by: Ahmet Alp Balkan <[email protected]>
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.
Heh, thanks for getting this done right away! I totally didn't expect that :D
cmd/validate-krew-manifest/main.go
Outdated
|
||
var licenseFiles = []string{ | ||
"license", | ||
"license.txt", |
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 also allow license.md
?
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
cmd/validate-krew-manifest/main.go
Outdated
for _, lf := range licenseFiles { | ||
if lf == f { | ||
return nil | ||
} | ||
} | ||
} |
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 use a map instead?
var licenseFiles = map[string]bool{
"license": true,
"license.txt": true,
"copying": true,
"copying.txt":true,
}
// ...
if licenseFiles[f] {
return nil
}
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
cmd/validate-krew-manifest/main.go
Outdated
f = strings.ToLower(filepath.Base(f)) | ||
for _, lf := range licenseFiles { | ||
if lf == f { | ||
return nil |
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:
klog.V(8).Infof("found license file: %s", f)
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: Ahmet Alp Balkan <[email protected]>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmetb, 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 |
Do you mind updating the go-get in krew-index CI? |
Sure, no problem. Will do later today. |
Ensure platform spec extracts a (case-insensitive) {LICENSE,COPYING}{,.txt}
file by looking at the installation directory.
Fixes #641
/assign @corneliusweig