Skip to content

Commit

Permalink
chore(license): add license-check for .go , .sh , Dockerfile and Make…
Browse files Browse the repository at this point in the history
…file (#328)

* add license-check for .go , .sh , Dockerfile and Makefile
* Fix license issues

Signed-off-by: Payes Anand <[email protected]>
  • Loading branch information
payes authored Sep 23, 2020
1 parent 73dfc13 commit 96e6c30
Show file tree
Hide file tree
Showing 115 changed files with 1,978 additions and 37 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ before_install:
- mkdir -p $HOME/gopath/bin

script:
- make license-check
- make build

- if [ $RUN_FEATURE_TESTS = 1 ]; then
Expand Down
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright © 2020 The OpenEBS Authors
#
# This file was originally authored by Rancher Labs
# under Apache License 2018.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Makefile for building jiva docker image
#
# Reference Guide - https://www.gnu.org/software/make/manual/make.html
Expand Down Expand Up @@ -121,3 +138,16 @@ build_gitlab: deps build_image _push_image

.PHONY: help deps build $(TARGETS)
.DEFAULT_GOAL := build


.PHONY: license-check
license-check:
@echo "Checking license header..."
@licRes=$$(for file in $$(find . -type f -regex '.*\.sh\|.*\.go\|.*Docker.*\|.*\Makefile*' ! -path './vendor/*' ) ; do \
awk 'NR<=5' $$file | grep -Eq "(Copyright|generated|GENERATED|License)" || echo $$file; \
done); \
if [ -n "$${licRes}" ]; then \
echo "license header checking failed:"; echo "$${licRes}"; \
exit 1; \
fi
@echo "Done checking license."
16 changes: 16 additions & 0 deletions alertlog/alertlog.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright © 2020 The OpenEBS Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package alertlog

import (
Expand Down
19 changes: 19 additions & 0 deletions app/add_replica.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
19 changes: 19 additions & 0 deletions app/backing_disable.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
// +build !qcow

/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
19 changes: 19 additions & 0 deletions app/backup.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
19 changes: 19 additions & 0 deletions app/controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
16 changes: 16 additions & 0 deletions app/controller_gotgt.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright © 2020 The OpenEBS Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
19 changes: 19 additions & 0 deletions app/controller_rest.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
16 changes: 16 additions & 0 deletions app/log.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright © 2020 The OpenEBS Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
19 changes: 19 additions & 0 deletions app/ls_replica.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
23 changes: 21 additions & 2 deletions app/replica.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down Expand Up @@ -354,7 +373,7 @@ func startReplica(c *cli.Context) error {
time.Sleep(2 * time.Second)
}
if replicaType == "clone" && snapName != "" {
logrus.Infof("Starting clone process\n")
logrus.Infof("Starting clone process")
status := s.Replica().GetCloneStatus()
if status != "completed" {
logrus.Infof("Set clone status as inProgress")
Expand All @@ -376,7 +395,7 @@ func startReplica(c *cli.Context) error {
logrus.Error("Error in setting the clone status as 'completed'")
return err
}
logrus.Infof("Clone process completed successfully\n")
logrus.Infof("Clone process completed successfully")
} else {
logrus.Infof("Set clone status as NA")
if err := s.Replica().SetCloneStatus("NA"); err != nil {
Expand Down
19 changes: 19 additions & 0 deletions app/rm_replica.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
17 changes: 17 additions & 0 deletions app/shutdown.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
21 changes: 20 additions & 1 deletion app/snapshot.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down Expand Up @@ -377,7 +396,7 @@ func infoSnapshot(c *cli.Context) error {

}

output, err = json.MarshalIndent(outputDisks, "", "\t")
output, err = json.MarshalIndent(outputDisks, "", " ")
if err != nil {
return err
}
Expand Down
19 changes: 19 additions & 0 deletions app/stats.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2020 The OpenEBS Authors
This file was originally authored by Rancher Labs
under Apache License 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
Expand Down
Loading

0 comments on commit 96e6c30

Please sign in to comment.