Skip to content

Commit

Permalink
Merge pull request kubernetes#73251 from danielqsj/api
Browse files Browse the repository at this point in the history
fix shellcheck in k8s.io/apiserver
  • Loading branch information
k8s-ci-robot authored Jan 29, 2019
2 parents b2d2432 + 481c2d8 commit d9fbb9a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 35 deletions.
4 changes: 0 additions & 4 deletions hack/.shellcheck_failures
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,6 @@
./staging/src/k8s.io/apiextensions-apiserver/hack/build-image.sh
./staging/src/k8s.io/apiextensions-apiserver/hack/update-codegen.sh
./staging/src/k8s.io/apiextensions-apiserver/hack/verify-codegen.sh
./staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testcerts/gencerts.sh
./staging/src/k8s.io/apiserver/pkg/util/webhook/gencerts.sh
./staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/gen.sh
./staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/gencerts.sh
./staging/src/k8s.io/code-generator/generate-groups.sh
./staging/src/k8s.io/code-generator/generate-internal-groups.sh
./staging/src/k8s.io/code-generator/hack/update-codegen.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was generated using openssl by the gencerts.sh script
// and holds raw certificates for the webhook tests.
package testcerts
EOF

echo "// This file was generated using openssl by the gencerts.sh script" >> $outfile
echo "// and holds raw certificates for the webhook tests." >> $outfile
echo "" >> $outfile
echo "package testcerts" >> $outfile
for file in CAKey CACert BadCAKey BadCACert ServerKey ServerCert ClientKey ClientCert; do
data=$(cat ${file}.pem)
echo "" >> $outfile
echo "var $file = []byte(\`$data\`)" >> $outfile
done

# Clean up after we're done.
rm *.pem
rm *.csr
rm *.srl
rm *.conf
rm ./*.pem
rm ./*.csr
rm ./*.srl
rm ./*.conf
16 changes: 8 additions & 8 deletions staging/src/k8s.io/apiserver/pkg/util/webhook/gencerts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was generated using openssl by the gencerts.sh script
// and holds raw certificates for the webhook tests.
package webhook
EOF

echo "// This file was generated using openssl by the gencerts.sh script" >> $outfile
echo "// and holds raw certificates for the webhook tests." >> $outfile
echo "" >> $outfile
echo "package webhook" >> $outfile
for file in caKey caCert badCAKey badCACert serverKey serverCert clientKey clientCert; do
data=$(cat ${file}.pem)
echo "" >> $outfile
echo "var $file = []byte(\`$data\`)" >> $outfile
done

# Clean up after we're done.
rm *.pem
rm *.csr
rm *.srl
rm *.conf
rm ./*.pem
rm ./*.csr
rm ./*.srl
rm ./*.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash -e
#!/usr/bin/env bash

# Copyright 2018 The Kubernetes Authors.
#
Expand All @@ -14,14 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

rm *.pem
set -e

for N in `seq 1 3`; do
ssh-keygen -t rsa -b 2048 -f rsa_$N.pem -N ''
rm ./*.pem

for N in $(seq 1 3); do
ssh-keygen -t rsa -b 2048 -f rsa_"$N".pem -N ''
done

for N in `seq 1 3`; do
ssh-keygen -t ecdsa -b 521 -f ecdsa_$N.pem -N ''
for N in $(seq 1 3); do
ssh-keygen -t ecdsa -b 521 -f ecdsa_"$N".pem -N ''
done

rm *.pub
rm ./*.pub
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was generated using openssl by the gencerts.sh script
// and holds raw certificates for the webhook tests.
package webhook
EOF

echo "// This file was generated using openssl by the gencerts.sh script" >> $outfile
echo "// and holds raw certificates for the webhook tests." >> $outfile
echo "" >> $outfile
echo "package webhook" >> $outfile
for file in caKey caCert badCAKey badCACert serverKey serverCert clientKey clientCert; do
data=$(cat ${file}.pem)
echo "" >> $outfile
echo "var $file = []byte(\`$data\`)" >> $outfile
done

# Clean up after we're done.
rm *.pem
rm *.csr
rm *.srl
rm *.conf
rm ./*.pem
rm ./*.csr
rm ./*.srl
rm ./*.conf

0 comments on commit d9fbb9a

Please sign in to comment.