Merge pull request #458 from mikebrow/boilerplate-update

fixes for boilerplate
This commit is contained in:
Lantao Liu 2017-12-04 10:03:41 -08:00 committed by GitHub
commit 562eb725c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 7 deletions

View File

@ -33,12 +33,12 @@ parser.add_argument(
nargs='*') nargs='*')
# Rootdir defaults to the directory **above** the hack/repo-infra dir. # Rootdir defaults to the directory **above** the hack/repo-infra dir.
rootdir = os.path.dirname(__file__) + "/../../../../" rootdir = os.path.dirname(__file__) + "/../../"
rootdir = os.path.abspath(rootdir) rootdir = os.path.abspath(rootdir)
parser.add_argument( parser.add_argument(
"--rootdir", default=rootdir, help="root directory to examine") "--rootdir", default=rootdir, help="root directory to examine")
default_boilerplate_dir = os.path.join(rootdir, "hack/repo-infra/verify/boilerplate") default_boilerplate_dir = os.path.join(rootdir, "hack/boilerplate")
parser.add_argument( parser.add_argument(
"--boilerplate-dir", default=default_boilerplate_dir) "--boilerplate-dir", default=default_boilerplate_dir)
@ -133,7 +133,7 @@ def file_extension(filename):
skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git',
'cluster/env.sh', 'vendor', 'test/e2e/generated/bindata.go', 'cluster/env.sh', 'vendor', 'test/e2e/generated/bindata.go',
'hack/repo-infra/verify/boilerplate/test', '.glide'] 'hack/boilerplate/test', '.glide']
def normalize_files(files): def normalize_files(files):
newfiles = [] newfiles = []

View File

@ -1,22 +1,36 @@
#!/bin/bash #!/bin/bash
# Copyright 2017 The Kubernetes 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.
CRICTL_CLI="crictl --runtime-endpoint /var/run/cri-containerd.sock " CRICTL_CLI="crictl --runtime-endpoint /var/run/cri-containerd.sock "
crictl_stop_running_containers() { crictl_stop_running_containers() {
for x in $($CRICTL_CLI ps | awk '{ print $1 }' | awk '{if(NR>1)print}') ;do for x in $($CRICTL_CLI ps | awk '{ print $1 }' | awk '{if(NR>1)print}') ;do
$CRICTL_CLI stop $x $CRICTL_CLI stop $x
done done
} }
crictl_rm_stopped_containers() { crictl_rm_stopped_containers() {
$CRICTL_CLI ps | awk '{ print $1 }' | awk '{if(NR>1)print}' $CRICTL_CLI ps | awk '{ print $1 }' | awk '{if(NR>1)print}'
for x in $($CRICTL_CLI ps | awk '{ print $1 }' | awk '{if(NR>1)print}') ;do for x in $($CRICTL_CLI ps | awk '{ print $1 }' | awk '{if(NR>1)print}') ;do
$CRICTL_CLI rm $x $CRICTL_CLI rm $x
done done
} }
crictl_stop_sandboxes() { crictl_stop_sandboxes() {
for x in $($CRICTL_CLI sandboxes | awk '{ print $1 }' | awk '{if(NR>1)print}') ;do for x in $($CRICTL_CLI sandboxes | awk '{ print $1 }' | awk '{if(NR>1)print}') ;do
$CRICTL_CLI stops $x $CRICTL_CLI stops $x
done done
} }
@ -28,7 +42,7 @@ crictl_rm_sandboxes() {
} }
crictl_rm_images() { crictl_rm_images() {
for x in $($CRICTL_CLI images | awk '{ print $1 }' | awk '{if(NR>1)print}') ;do for x in $($CRICTL_CLI images | awk '{ print $1 }' | awk '{if(NR>1)print}') ;do
$CRICTL_CLI rmi $x $CRICTL_CLI rmi $x
done done
} }

View File

@ -13,6 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set -o nounset set -o nounset
set -o pipefail set -o pipefail

View File

@ -13,6 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set -o nounset set -o nounset
set -o pipefail set -o pipefail

View File

@ -13,6 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set -o nounset set -o nounset
set -o pipefail set -o pipefail

View File

@ -1,9 +1,12 @@
/* /*
Copyright 2017 The Kubernetes Authors. Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

View File

@ -1,9 +1,12 @@
/* /*
Copyright 2017 The Kubernetes Authors. Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

View File

@ -1,9 +1,12 @@
/* /*
Copyright 2017 The Kubernetes Authors. Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

View File

@ -1,5 +1,6 @@
/* /*
Copyright 2017 The Kubernetes Authors. Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at