diff --git a/.travis.yml b/.travis.yml index 454c68626..7d30d839b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,6 +45,7 @@ install: - sudo chmod -R og+r /usr/local/include/google/protobuf/ - protoc --version - go get -u github.com/vbatts/git-validation + - go get -u github.com/kunalkushwaha/ltag - sudo PATH=$PATH GOPATH=$GOPATH script/setup/install-runc - sudo PATH=$PATH GOPATH=$GOPATH script/setup/install-cni - sudo PATH=$PATH GOPATH=$GOPATH script/setup/install-critools @@ -57,6 +58,7 @@ script: - export GOOS=$TRAVIS_GOOS - export CGO_ENABLED=$TRAVIS_CGO_ENABLED - DCO_VERBOSITY=-q script/validate/dco + - script/validate/fileheader - GOOS=linux script/setup/install-dev-tools - script/validate/vendor - go build -i . diff --git a/cio/io_unix_test.go b/cio/io_unix_test.go index 081dca910..77a54d964 100644 --- a/cio/io_unix_test.go +++ b/cio/io_unix_test.go @@ -1,5 +1,21 @@ // +build !windows +/* + Copyright The containerd 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 cio import ( diff --git a/cmd/containerd/builtins_cri_linux.go b/cmd/containerd/builtins_cri_linux.go index deb5de0ad..c57b38617 100644 --- a/cmd/containerd/builtins_cri_linux.go +++ b/cmd/containerd/builtins_cri_linux.go @@ -1,5 +1,21 @@ // +build !no_cri +/* + Copyright The containerd 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 main import _ "github.com/containerd/cri-containerd" diff --git a/mount/temp.go b/mount/temp.go index ec7a06bcb..5994759f3 100644 --- a/mount/temp.go +++ b/mount/temp.go @@ -1,3 +1,19 @@ +/* + Copyright The containerd 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 mount import ( diff --git a/mount/temp_unix.go b/mount/temp_unix.go index 770631362..fcf90d6fb 100644 --- a/mount/temp_unix.go +++ b/mount/temp_unix.go @@ -1,5 +1,21 @@ // +build !windows +/* + Copyright The containerd 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 mount import ( diff --git a/mount/temp_unsupported.go b/mount/temp_unsupported.go index d3a188fc0..de3f4163a 100644 --- a/mount/temp_unsupported.go +++ b/mount/temp_unsupported.go @@ -1,5 +1,21 @@ // +build windows +/* + Copyright The containerd 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 mount // SetTempMountLocation sets the temporary mount location diff --git a/script/setup/install-cni b/script/setup/install-cni index 1d4573d4f..f077f1645 100755 --- a/script/setup/install-cni +++ b/script/setup/install-cni @@ -1,4 +1,19 @@ #!/usr/bin/env bash + +# Copyright The containerd 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. + # # Builds and installs cni plugins to /opt/cni/bin, # and create basic cni config in /etc/cni/net.d. diff --git a/script/setup/install-critools b/script/setup/install-critools index f83c0f933..75780a9e6 100755 --- a/script/setup/install-critools +++ b/script/setup/install-critools @@ -1,4 +1,19 @@ #!/usr/bin/env bash + +# Copyright The containerd 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. + # # Builds and installs critools including critest and crictl # to /usr/local/bin. diff --git a/script/validate/dco b/script/validate/dco index f8000fc8f..9a104ab3e 100755 --- a/script/validate/dco +++ b/script/validate/dco @@ -24,4 +24,4 @@ if ! command -v git-validation; then fi verbosity="${DCO_VERBOSITY--v}" -GIT_CHECK_EXCLUDE="./vendor" git-validation "$verbosity" -run DCO,short-subject,dangling-whitespace +GIT_CHECK_EXCLUDE="./vendor:./script/validate/template" git-validation "$verbosity" -run DCO,short-subject,dangling-whitespace diff --git a/script/validate/fileheader b/script/validate/fileheader new file mode 100755 index 000000000..ef5fa287f --- /dev/null +++ b/script/validate/fileheader @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Copyright The containerd 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. + + +set -eu -o pipefail + +if ! command -v ltag; then + >&2 echo "ERROR: ltag not found. Install with:" + >&2 echo " go get -u github.com/kunalkushwaha/ltag" + exit 1 +fi + +ltag -t script/validate/template --check -v diff --git a/script/validate/template/bash.txt b/script/validate/template/bash.txt new file mode 100644 index 000000000..b8424f326 --- /dev/null +++ b/script/validate/template/bash.txt @@ -0,0 +1,14 @@ +# Copyright The containerd 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. + diff --git a/script/validate/template/dockerfile.txt b/script/validate/template/dockerfile.txt new file mode 100644 index 000000000..b8424f326 --- /dev/null +++ b/script/validate/template/dockerfile.txt @@ -0,0 +1,14 @@ +# Copyright The containerd 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. + diff --git a/script/validate/template/go.txt b/script/validate/template/go.txt new file mode 100644 index 000000000..bee278d30 --- /dev/null +++ b/script/validate/template/go.txt @@ -0,0 +1,16 @@ +/* + Copyright The containerd 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. +*/ + diff --git a/script/validate/template/makefile.txt b/script/validate/template/makefile.txt new file mode 100644 index 000000000..b8424f326 --- /dev/null +++ b/script/validate/template/makefile.txt @@ -0,0 +1,14 @@ +# Copyright The containerd 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. +