Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci/license-check): check if specifed images have been manually l… #1203

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/scripts/licenseList
marvinWolff marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
docker.io/aelbakry/kdave-server;MIT;https:/wayfair-incubator/kdave/blob/main/LICENSE
docker.io/bats/bats;MIT;https:/bats-core/bats-core/blob/master/LICENSE.md
docker.io/bitnami/external-dns;Apache-2.0;https://hub.docker.com/r/bitnami/external-dns
docker.io/bitnami/grafana-tempo;Apache-2.0;https://hub.docker.com/r/bitnami/grafana-tempo
docker.io/bitnami/grafana-tempo-vulture;Apache-2.0;https://hub.docker.com/r/bitnami/grafana-tempo-vulture
docker.io/bitnami/kubectl;Apache-2.0;https://hub.docker.com/r/bitnami/kubectl
docker.io/bitnami/memcached;Apache-2.0;https://hub.docker.com/r/bitnami/memcached
docker.io/bitnami/metrics-server;Apache-2.0;https://hub.docker.com/r/bitnami/metrics-server
docker.io/bitnami/postgresql;PostgreSQL;https://www.postgresql.org/about/licence/
docker.io/bitnami/redis;SSPL-1.0;https://redis.io/legal/licenses/
docker.io/bitnami/zookeeper;Apache-2.0;https://zookeeper.apache.org/
docker.io/busybox;GPL-2.0;http://www.busybox.net/license.html
docker.io/ckan/ckan-base-datapusher;AGPL-3.0-only;https:/ckan/datapusher
docker.io/confluentinc/cp-kafka;Apache-2.0;https:/confluentinc/kafka-images/blob/master/LICENSE
docker.io/curlimages/curl;curl;https://curl.se/docs/copyright.html
docker.io/emberstack/kubernetes-reflector;MIT;https:/emberstack/kubernetes-reflector/blob/main/LICENSE
docker.io/fluxcd/flux-cli;Apache-2.0;https:/fluxcd/flux2/blob/main/LICENSE
docker.io/grafana/grafana;AGPL-3.0-only;https:/grafana/grafana/blob/main/LICENSING.md
docker.io/grafana/grafana-image-renderer;Apache-2.0;https:/grafana/grafana-image-renderer/blob/master/LICENSE
docker.io/grafana/loki;AGPL-3.0;https:/grafana/loki/blob/main/LICENSE
docker.io/grafana/promtail;AGPL-3.0;https:/grafana/loki/blob/main/tools/LICENSE_APACHE2
docker.io/hjacobs/kube-janitor;AGPL-3.0;https:/hjacobs/kube-janitor/blob/main/LICENSE
docker.io/otel/opentelemetry-collector-contrib;Apache-2.0;https:/open-telemetry/opentelemetry-collector-contrib/blob/main/LICENSE
docker.io/stellio/stellio-api-gateway;Apache-2.0;https:/stellio-hub/stellio-context-broker/blob/develop/LICENSE.txt
docker.io/stellio/stellio-search-service;Apache-2.0;https:/stellio-hub/stellio-context-broker/blob/develop/LICENSE.txt
docker.io/stellio/stellio-subscription-service;Apache-2.0;https:/stellio-hub/stellio-context-broker/blob/develop/LICENSE.txt
docker.io/stellio/stellio-timescale-postgis;Apache-2.0;https:/stellio-hub/stellio-context-broker/blob/develop/LICENSE.txt
docker.io/velero/velero;Apache-2.0;https:/vmware-tanzu/velero-plugin-for-aws/blob/main/LICENSE
docker.io/velero/velero-plugin-for-aws;Apache-2.0;https:/vmware-tanzu/velero-plugin-for-aws/blob/main/LICENSE
docker.io/vladgh/gpg;Apache-2.0;https:/vladgh/docker_base_images/blob/main/LICENSE
ghcr.io/aquasecurity/trivy-operator;Apache-2.0;https:/aquasecurity/trivy-operator/blob/main/LICENSE
ghcr.io/kyverno/background-controller;Apache-2.0;https:/kyverno/kyverno/pkgs/container/background-controller
ghcr.io/kyverno/cleanup-controller;Apache-2.0;https:/kyverno/kyverno/pkgs/container/cleanup-controller
ghcr.io/kyverno/kyverno;Apache-2.0;https:/kyverno/kyverno/pkgs/container/kyverno
ghcr.io/kyverno/kyverno-cli;Apache-2.0;https:/kyverno/kyverno/pkgs/container/kyverno-cli
ghcr.io/kyverno/kyvernopre;Apache-2.0;https:/kyverno/kyverno/pkgs/container/kyvernopre
ghcr.io/kyverno/reports-controller;Apache-2.0;https:/kyverno/kyverno/pkgs/container/reports-controller
ghcr.io/teutonet/oci-images/ckan;MIT;https:/teutonet/oci-images/blob/main/LICENSE
ghcr.io/teutonet/oci-images/solr-ckan;MIT;https:/teutonet/oci-images/blob/main/LICENSE
k8s.gcr.io/sig-storage/csi-attacher;Apache-2.0;https:/kubernetes-csi/external-attacher/blob/master/LICENSE
k8s.gcr.io/sig-storage/csi-node-driver-registrar;Apache-2.0;https:/kubernetes-csi/node-driver-registrar/blob/master/LICENSE
k8s.gcr.io/sig-storage/csi-provisioner;Apache-2.0;https:/kubernetes-csi/external-provisioner/blob/master/LICENSE
k8s.gcr.io/sig-storage/csi-resizer;Apache-2.0;https:/kubernetes-csi/external-resizer/blob/master/LICENSE
k8s.gcr.io/sig-storage/csi-snapshotter;Apache-2.0;https:/kubernetes-csi/external-snapshotter/blob/master/LICENSE
k8s.gcr.io/sig-storage/livenessprobe;Apache-2.0;https:/kubernetes-csi/livenessprobe/blob/master/LICENSE
quay.io/cilium/cilium;Apache-2.0;https:/cilium/cilium/blob/main/LICENSE
quay.io/cilium/cilium-envoy;Apache-2.0;https:/cilium/cilium/blob/main/LICENSE
quay.io/cilium/hubble-relay;Apache-2.0;https:/cilium/cilium/blob/main/LICENSE
quay.io/cilium/hubble-ui;Apache-2.0;https:/cilium/cilium/blob/main/LICENSE
quay.io/cilium/hubble-ui-backend;Apache-2.0;https:/cilium/hubble-ui/blob/master/LICENSE
quay.io/cilium/operator-generic;Apache-2.0;https://hub.docker.com/r/cilium/operator-generic
quay.io/jetstack/cert-manager-cainjector;Apache-2.0;https:/cert-manager/cert-manager/blob/master/LICENSE
quay.io/jetstack/cert-manager-controller;Apache-2.0;https:/cert-manager/cert-manager/blob/master/LICENSE
quay.io/jetstack/cert-manager-startupapicheck;Apache-2.0;https:/cert-manager/cert-manager/blob/master/LICENSE
quay.io/jetstack/cert-manager-webhook;Apache-2.0;https:/cert-manager/cert-manager/blob/master/LICENSE
quay.io/kiwigrid/k8s-sidecar;MIT;https:/kiwigrid/k8s-sidecar/blob/master/LICENSE
quay.io/prometheus/alertmanager;Apache-2.0;https:/prometheus/alertmanager/blob/main/LICENSE
quay.io/prometheus/node-exporter;Apache-2.0;https:/prometheus/node_exporter/blob/master/LICENSE
quay.io/prometheus-operator/prometheus-operator;Apache-2.0;https:/prometheus-operator/prometheus-operator/blob/main/LICENSE
quay.io/prometheus/prometheus;Apache-2.0;https:/prometheus/prometheus/blob/main/LICENSE
registry-gitlab.teuto.net/4teuto/dev/teuto-portal/teuto-portal-k8s-worker/teuto-portal-k8s-worker;Apache-2.0;https://gitlab.teuto.net/4teuto/dev/teuto-portal/teuto-portal-k8s-worker/-/blob/main/gradlew?ref_type=heads
registry.k8s.io/descheduler/descheduler;Apache-2.0;https:/kubernetes-sigs/descheduler/blob/master/LICENSE
registry.k8s.io/etcd;Apache-2.0;https:/kubernetes/kubernetes/blob/master/LICENSE
registry.k8s.io/ingress-nginx/controller;Apache-2.0;https:/kubernetes/ingress-nginx/blob/main/LICENSE
registry.k8s.io/ingress-nginx/kube-webhook-certgen;Apache-2.0;https:/kubernetes/ingress-nginx/blob/main/LICENSE
registry.k8s.io/ingress-nginx/opentelemetry-1.25.3;Apache-2.0;https:/kubernetes/ingress-nginx/blob/main/LICENSE
registry.k8s.io/kube-state-metrics/kube-state-metrics;Apache-2.0;https:/kubernetes/kube-state-metrics/blob/main/LICENSE
registry.k8s.io/provider-os/cinder-csi-plugin;Apache-2.0;https:/kubernetes/cloud-provider-openstack/blob/master/LICENSE
registry.k8s.io/provider-os/openstack-cloud-controller-manager;Apache-2.0;https:/kubernetes/cloud-provider-openstack/blob/master/LICENSE
registry.k8s.io/sig-storage/nfs-provisioner;Apache-2.0;https:/kubernetes-sigs/nfs-subdir-external-provisioner/blob/master/LICENSE
17 changes: 16 additions & 1 deletion .github/workflows/check-licenses.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint Helm Charts
name: Check used licenses

on:
pull_request:
Expand All @@ -23,3 +23,18 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- run: pip install yq
- run: ./.github/scripts/scan-for-licenses.sh ${{ needs.getChangedChart.outputs.chart }}
check-licenses-list:
name: check licenses from list
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- run: pip install yq
- run: |
mapfile -t IMAGES < <(for chart in charts/*; do if [[ -f "$chart/Chart.yaml" ]]; then yq -r '.annotations["artifacthub.io/images"] // ""' <"$chart/Chart.yaml" ; fi; done | cut -d ":" -f2 | uniq | sort | sed '/^$/d')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should rather just use the $chart from getChangedChart

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this is fine now, testing is hard when using github-ci

#shellcheck disable=SC2068
mapfile -t RESULT < <(for IMAGE in ${IMAGES[@]}; do grep -q "$IMAGE" ./.github/scripts/licenseList || (echo "$IMAGE";); done;)
if [[ -n "${RESULT[*]}" ]]; then
echo "The following images are not accepted, please review:"
printf "%s\n" "${RESULT[@]}"
exit 1
fi