Skip to content

Commit

Permalink
chore: add script to update artifacthub digest
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly committed Sep 25, 2023
1 parent cd47ec5 commit 0cde911
Show file tree
Hide file tree
Showing 28 changed files with 48 additions and 27 deletions.
2 changes: 1 addition & 1 deletion argo/application-field-validation/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Argo"
kyverno/kubernetesVersion: "1.23"
kyverno/subject: "Application"
digest: c8ad238bcb8b9014775649b68d78dc902dcd58d2b3d54c536b2ec99c0dc821da
digest: d3fb7174f682520a3ab0f62c4430014fc3228b51b989d770f5546099f342f416
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ readme: |
annotations:
kyverno/category: "Best Practices"
kyverno/subject: "Ingress"
digest: 4c8e14cfe546a3912985257916af8cdae9e8ed3c5b9c8710de0452b0780352e6
digest: f9e70cf095e2d69a9586d7b8071975006e76aa715e5c978d37761c03ac6fc7fd
2 changes: 1 addition & 1 deletion best-practices/require-ro-rootfs/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ readme: |
annotations:
kyverno/category: "Best Practices, EKS Best Practices"
kyverno/subject: "Pod"
digest: 6a96d468500f2d2d152dbde7a04a698c9cc62cc2975c04fb4c740dac187f5f4b
digest: 27b193124b332e64884209f20617f5b5d2c3fc41b9a33265e971ec807b14ae14
2 changes: 1 addition & 1 deletion castai/add-castai-removal-disabled/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "CAST AI"
kyverno/kubernetesVersion: "1.25"
kyverno/subject: "Job, CronJob"
digest: 18f7de8b701cdf06e44c82655aaa91c386e9e3b44da1e72e04423f2d2a04a4f7
digest: 992992b1eb3573e61d58ecf18bf58a2df70ce647b69243bc1e2adcdc5cea30ce
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "ExternalSecretOperator"
kyverno/kubernetesVersion: "1.23"
kyverno/subject: "ExternalSecret"
digest: e37b41aabc7d65947ee0cdd0707601d3bc2e43ffd6bc87aef76d8620aca5c1b7
digest: 8b8e211f173edc5ba55b5e11c2a4799da30eb59a8cf0dd442b215e1a9cf79514
21 changes: 21 additions & 0 deletions hack/update-artifacthub-pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -e

FILES=$(find . -name "artifacthub-pkg.yml")
SED=sed

if [[ "$OSTYPE" == "darwin"* ]]; then
SED=gsed
fi

for FILE in $FILES
do
FOLDER=$(dirname "$FILE")
POLICY=$(basename "$FOLDER")
POLICY_FILE="$FOLDER/$POLICY.yaml"
echo "Processing policy $POLICY ($POLICY_FILE) ..."
DIGEST=$(shasum -U -a 256 "$POLICY_FILE" | cut -d" " -f 1)
echo " Digest: $DIGEST"
$SED -i "s/^digest:.*/digest: $DIGEST/" $FILE
done
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ annotations:
kyverno/category: "Karpenter"
kyverno/kubernetesVersion: "1.26"
kyverno/subject: "DaemonSet"
digest: d362d0f39e827f364e3527542260994471420007e6624f4a992d8ce2963b01ac
digest: 275bf6fb95839933a781efbcaeaea792cf1bd5d4af9833eb37fefc374aed26f3
2 changes: 1 addition & 1 deletion karpenter/set-karpenter-non-cpu-limits/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ annotations:
kyverno/category: "Karpenter, EKS Best Practices"
kyverno/kubernetesVersion: "1.26"
kyverno/subject: "Pod"
digest: cd4fd255ac954d358ccff5df240fcd9ff441d3c53ac9629abc5c31118d9e9892
digest: 93d84f8ba71d2bf87cb84d4174962cc50ecd0b0f9bb29f6fccb8a8a41d11b500
2 changes: 1 addition & 1 deletion kubevirt/enforce-instancetype/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "KubeVirt"
kyverno/kubernetesVersion: "1.24-1.25"
kyverno/subject: "VirtualMachine"
digest: fd5e58353ef32aab91803a63e1a1f95ff0e311344f33a88f99ebe37757e64990
digest: b0d3d34707cb815c644f2ed54060f6d546655cfb58600618f61575ac355f3439
2 changes: 1 addition & 1 deletion openshift/enforce-etcd-encryption/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "OpenShift"
kyverno/kubernetesVersion: "1.20"
kyverno/subject: "APIServer"
digest: d54ffd53d3d442062c5980b6333701a7b18477329422ad030912b1756d30c3a7
digest: 52b34f10d90e6c15782ef1b861c42f0f16618ee7093fc7763fa24758e78c64b3
2 changes: 1 addition & 1 deletion openshift/inject-infrastructurename/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "OpenShift"
kyverno/kubernetesVersion: "1.26"
kyverno/subject: "MachineSet"
digest: 3f9aaaeeea9c2bde0fb8398da2bb64437e73ea8d644031102369beaa7f73e32e
digest: 55f4f0f016cfed1e26b0a3621fa3ced8cd89134ade53976dec7cd6d7b2d9911a
2 changes: 1 addition & 1 deletion other/a/add-certificates-volume/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Sample"
kyverno/kubernetesVersion: "1.21"
kyverno/subject: "Pod,Volume"
digest: 41e873cb02f9b6c18d454968681f9797f1c0f3d89dc1610a60581e1e710031fb
digest: d0bece92401b5c2c3fe482333fed5c09379d383934cd5bc860e416875a6d6267
2 changes: 1 addition & 1 deletion other/a/apply-pss-restricted-profile/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Other"
kyverno/kubernetesVersion: "1.23"
kyverno/subject: "Pod"
digest: 79ec68a13ec96ac3c01fe6d39eb6fa79e10ef936453e17a76b7d10dfe2c26d96
digest: 5fe9842816e537b8cdb8d6f231ccf31cefa7e11a936ee38f787e329f7b63ba97
2 changes: 1 addition & 1 deletion other/b-d/block-cluster-admin-from-ns/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ annotations:
policies.kyverno.io/category: other
policies.kyverno.io/subject: Namespace, ClusterRole, User
policies.kyverno.io/minversion: 1.9.0
digest: 8b212d6056e1871537018ab93e1236f971b42a4c
digest: 841724d983a9f27618678d596f30e20717115787e0f24304226b79d2e6b892e0
2 changes: 1 addition & 1 deletion other/b-d/cordon-and-drain-node/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "other"
kyverno/kubernetesVersion: "1.26"
kyverno/subject: "Node"
digest: d9540eced93532fb54d51aa9ce0ca4d4b954737d6cc2eeb82687665bcfde826e
digest: adbb84bccd2bb5f35c5987eb14aacc51e85a624124ce3281372607f92d6090bb
2 changes: 1 addition & 1 deletion other/e-l/forbid-cpu-limits/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Other"
kyverno/kubernetesVersion: "1.26"
kyverno/subject: "Pod"
digest: ab06fedd32b519429eff449321a29c84db403982f3732621b32188ce9c98f767
digest: d83f7beccf5eacc5a32cfb36225689b76007755b2f4d04876db11f75459baa62
2 changes: 1 addition & 1 deletion other/m-q/pdb-minavailable/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Other"
kyverno/kubernetesVersion: "1.24"
kyverno/subject: "PodDisruptionBudget, Deployment, StatefulSet"
digest: f5fb2bf91603f5fb0f607f5f15124ae0e931e60f0eb23c4b38ff0bc13b55c07b
digest: bcb87ac5337aad2386c47726f85247202cdbaca62e62a6e96085adaddb7159e7
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Other"
kyverno/kubernetesVersion: "1.25"
kyverno/subject: "Pod,ServiceAccount,Volume"
digest: 43d3e00dc3547628d2efec1ed83f461f56b1e98ec5523836d067fd54b9aa6a2d
digest: d23bd2501b0c893a15d5d956af131fbaa0d25e6278980e3ba6cce9608841bebd
2 changes: 1 addition & 1 deletion other/res/restrict-ingress-host/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ readme: |
annotations:
kyverno/category: "Sample"
kyverno/subject: "Ingress"
digest: 0f685d07e0611885d3614a013bf7a65cad34ea0d1e960c23724d715254a8dd07
digest: 626994bf34517beb56b95c46ae5055dabd3173ab94b391c2806a76015b1f46fd
2 changes: 1 addition & 1 deletion other/res/restrict-jobs/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Other"
kyverno/kubernetesVersion: "1.26"
kyverno/subject: "Job"
digest: 0dc990246332e0389cae2d6182a147137c5c6ffcd3f1fd9684437a90f45b75e5
digest: a1945324de2d3e44b2edf57393a27c9348778a460df3cd020d9b2a40b28e4305
2 changes: 1 addition & 1 deletion other/s-z/scale-deployment-zero/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "other"
kyverno/kubernetesVersion: "1.23"
kyverno/subject: "Deployment"
digest: e788ce3e9d3bec239e132a18bf021ef60922d73f7b3d31a7347cdcd730807f7f
digest: 3fbc00dd9353159fa0ab0e13bd1a1c07f1b28bc49bd7ad63277241f11812aff3
2 changes: 1 addition & 1 deletion other/s-z/unique-ingress-paths/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ readme: |
annotations:
kyverno/category: "Sample"
kyverno/subject: "Ingress"
digest: 6438f8a31d452b9c3b412ec330edd4efbc8865bb8b04019030c77b5c08b28add
digest: b7d6475c0f1a2e885ffeec1b6840bfca32b8d690dbefe6646d3dca6b78fdc7b2
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Pod Security Standards (Baseline)"
kyverno/kubernetesVersion: "1.22-1.23"
kyverno/subject: "Pod"
digest: 138e5cdd4c48ade80d49c0d7599a99285dec59834703ec333b4561916aa4f042
digest: 424f0a6b33686600c40b6658dd67ebd4eb596e0975b01120ea994168a2e065c8
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Pod Security Standards (Restricted)"
kyverno/kubernetesVersion: "1.22-1.23"
kyverno/subject: "Pod,Volume"
digest: ae033e57fb11b5c713876efb465f102d3c7059440ae7e8e5dab4fef28117dde2
digest: f050ec83c6176c4124cb678418bba7326d9885bd23ee9669e19761d8ec8a0cf2
2 changes: 1 addition & 1 deletion psp-migration/add-apparmor/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "PSP Migration"
kyverno/kubernetesVersion: "1.24"
kyverno/subject: "Pod,Annotation"
digest: fc8cacbbf4086fe2da8ad7e4a635a4283c1e5d9cc27762a7a4ee06e407968bf5
digest: 082461dca2f21839c429ac792fa4c8cb7a6a86639580345e124e541bf595332d
2 changes: 1 addition & 1 deletion psp-migration/add-capabilities/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "PSP Migration"
kyverno/kubernetesVersion: "1.24"
kyverno/subject: "Pod"
digest: 2d16b8adeb8826cfa2f90d56aab7bb3616d08b678fb978822e827f64bb115b5a
digest: 5f25e343611f412f21608223ee89a3684280045469ce1053bc7a3418ee57a1c4
2 changes: 1 addition & 1 deletion psp-migration/add-runtimeClassName/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "PSP Migration"
kyverno/kubernetesVersion: "1.24"
kyverno/subject: "Pod"
digest: 865b4bd0f95875c04b76057678b5c4146581414ca9b17fd10b719bd9e50145b1
digest: 1c05ef4bd3486b75bda76a23da00b220229d3b38b5d22ffa141c779a28b2a15b
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "PSP Migration"
kyverno/kubernetesVersion: "1.24"
kyverno/subject: "Pod"
digest: 4ef56ff9a8131df118e9b52312c70ea17a6c785a0c55c6dc305859ce5da6b653
digest: e4916e7d06c1fa8afeb2568c330a36c4e44b98a844002270ea2070ba8fae7752

0 comments on commit 0cde911

Please sign in to comment.