Skip to content

Commit ef13af4

Browse files
mtardyPushkarJ
andcommitted
Fix typos in comments and add explanations about usage of tee
Co-authored-by: Pushkar Joglekar <3390906+PushkarJ@users.noreply.github.com>
1 parent e61ffa9 commit ef13af4

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

sig-security-tooling/cve-feed/hack/fetch-cve-feed.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ set -o nounset
1717
set -o errexit
1818
set -o pipefail
1919

20-
#install python-pip3
20+
# install python-pip3
2121
apt-get update
2222
apt-get install -y python3-pip
2323

24-
#install requests module
24+
# install requests module
2525
pip3 install requests
2626

27-
#python script to generate official-cve-feed.json
27+
# python script to generate official-cve-feed.json
28+
# tee duplicates the output from the script to stdout for logs and the JSON file
2829
python3 fetch-official-cve-feed.py | tee official_cve_feed.json
2930

30-
#function to calculate the hash value of official-cve-feed.json
31+
# function to calculate the hash value of official-cve-feed.json
3132
calculate_hash(){
3233
if command -v shasum >/dev/null 2>&1; then
3334
cat "$@" | shasum -a 256 | cut -d' ' -f1
@@ -39,12 +40,13 @@ calculate_hash(){
3940
fi
4041
}
4142

42-
#check if official-cve-feed.json blob exists in the bucket
43+
# check if official-cve-feed.json blob exists in the bucket
4344
set -e
4445
EXIT_CODE=0
4546
gsutil ls gs://k8s-cve-feed/official-cve-feed.json >/dev/null 2>&1 || EXIT_CODE=$?
4647

47-
#fetch the hash value of existing official-cve-feed.json json, if differs then upload the new cve feed data to the existing blob.
48+
# fetch the hash value of existing official-cve-feed.json json, if differs then
49+
# upload the new cve feed data to the existing blob.
4850
if [[ $EXIT_CODE -eq 1 ]]; then
4951
gsutil cp official-cve-feed.json gs://k8s-cve-feed
5052
calculate_hash official-cve-feed.json > cve-feed-hash

sig-security-tooling/cve-feed/hack/fetch-official-cve-feed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
cve['_kubernetes_io']['issue_number'] = item['number']
6767
cve['content_text'] = item['body']
6868
cve['date_published'] = item['created_at']
69-
# This because some CVEs were titled "CVE-XXXX-XXXX - Something" instead of
69+
# This is because some CVEs were titled "CVE-XXXX-XXXX - Something" instead of
7070
# "CVE-XXXX-XXXX: Something" on GitHub (see https://github.com/kubernetes/kubernetes/issues/60813).
7171
title = item['title'].replace(' -', ':')
7272
# This splits the CVE into its ID and the description/name, however some are in the following forms:

0 commit comments

Comments
 (0)