Skip to content
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

Merged
merged 2 commits into from
Aug 30, 2020

Conversation

ahmetb
Copy link
Member

@ahmetb ahmetb commented Aug 29, 2020

Ensure platform spec extracts a (case-insensitive) {LICENSE,COPYING}{,.txt}
file by looking at the installation directory.

Fixes #641
/assign @corneliusweig

Ensure platform spec extracts a (case-insensitive) {LICENSE,COPYING}{,.txt}
file by looking at the installation directory.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 29, 2020
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 29, 2020
Copy link
Contributor

@corneliusweig corneliusweig left a 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


var licenseFiles = []string{
"license",
"license.txt",
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 194 to 199
for _, lf := range licenseFiles {
if lf == f {
return nil
}
}
}
Copy link
Contributor

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
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

f = strings.ToLower(filepath.Base(f))
for _, lf := range licenseFiles {
if lf == f {
return nil
Copy link
Contributor

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)

Copy link
Member Author

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 <ahmetb@google.com>
@corneliusweig
Copy link
Contributor

/lgtm
/approve
Nice work :)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 30, 2020
@k8s-ci-robot
Copy link
Contributor

[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:
  • OWNERS [ahmetb,corneliusweig]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 9fc1c54 into kubernetes-sigs:master Aug 30, 2020
@ahmetb
Copy link
Member Author

ahmetb commented Aug 31, 2020

Do you mind updating the go-get in krew-index CI?

@corneliusweig
Copy link
Contributor

Sure, no problem. Will do later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for presence of license file in CI
3 participants