From e465b3d485234daca93103693defc9eaae6b54de Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Tue, 29 Sep 2020 18:40:26 +0200 Subject: [PATCH] Add UBI 8 image to the dependencies report (#21374) Red Hat certification process requires to include the UBI image in the list of dependencies for the project. Append it to the current list of dependencies. This requires to include a new sourceURL column in the CSV, because UBI images have a different url and source url. This is kept the same for existing dependencies. (cherry picked from commit e6c3d89234a449f671a0a68ccba2a224b0e4a31f) --- dev-tools/dependencies-report | 11 +++++++++++ dev-tools/notice/dependencies.csv.tmpl | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dev-tools/dependencies-report b/dev-tools/dependencies-report index a824d0f4bf9..a2662a4ab9a 100755 --- a/dev-tools/dependencies-report +++ b/dev-tools/dependencies-report @@ -41,3 +41,14 @@ go list -m -json all $@ | go run go.elastic.co/go-licence-detector \ -noticeTemplate "$SRCPATH/notice/dependencies.csv.tmpl" \ -noticeOut "$outfile" \ -depsOut "" + + +# Fill-in required values for UBI images +# Check headers in $SRCPATH/notice/dependencies.csv.tmpl: +# name,url,version,revision,license +ubi8url='https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8' +ubi8source='https://oss-dependencies.elastic.co/redhat/ubi/ubi-minimal-8-source.tar.gz' +ubilicense='Custom;https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf,https://oss-dependencies.elastic.co/redhat/ubi/ubi-minimal-8-source.tar.gz' +cat <> $outfile +Red Hat Universal Base Image,$ubi8url,8,,$ubilicense,$ubi8source +EOF diff --git a/dev-tools/notice/dependencies.csv.tmpl b/dev-tools/notice/dependencies.csv.tmpl index 6ab2a970199..088314378f6 100644 --- a/dev-tools/notice/dependencies.csv.tmpl +++ b/dev-tools/notice/dependencies.csv.tmpl @@ -1,7 +1,7 @@ {{- define "depInfo" -}} {{- range $i, $dep := . }} -{{ $dep.Name }},{{ $dep.URL }},{{ $dep.Version | canonicalVersion }},{{ $dep.Version | revision }},{{ $dep.LicenceType }} +{{ $dep.Name }},{{ $dep.URL }},{{ $dep.Version | canonicalVersion }},{{ $dep.Version | revision }},{{ $dep.LicenceType }},{{ $dep.URL }} {{- end -}} {{- end -}} -name,url,version,revision,license{{ template "depInfo" .Direct }}{{ template "depInfo" .Indirect }} +name,url,version,revision,license,sourceURL{{ template "depInfo" .Direct }}{{ template "depInfo" .Indirect }}