From f9c43e9bae04fafc97f8c8759eeec55b24ead997 Mon Sep 17 00:00:00 2001 From: Sveta Smirnova Date: Mon, 13 Nov 2023 17:40:58 +0300 Subject: [PATCH 01/13] ARM64 support for macOS - Added option darwin-arm64 into Go tools Makefile - Changed --delimiter option to its short version that works on all platforms - Changed "Mongo tools" comments to "Go tools", because now Go tools are not only for Mongo --- src/go/Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/go/Makefile b/src/go/Makefile index e0d8057f..e967593a 100644 --- a/src/go/Makefile +++ b/src/go/Makefile @@ -22,7 +22,7 @@ pkgs = $(shell find . -type d -name "pt-*" -exec basename {} \;) # VERSION ?=$(shell git describe --abbrev=0) doesn't always work here, need to use git log VERSION ?=$(shell git log --no-walk --tags --pretty="%H %d" --decorate=short | head -n1 | awk -F'[, $(CP)]' '{ print $$4; }') BUILD=$(BUILD_DATE) -GOVERSION=$(shell go version | cut --delimiter=" " -f3) +GOVERSION=$(shell go version | cut -d " " -f3) GOUTILSDIR ?= $(GOPATH)/bin FILES = $(shell find . -type f -name '*.go' -not -path "./vendor/*") PREFIX=$(shell pwd) @@ -127,24 +127,30 @@ env-down: env ## Clean-up MongoDB docker containers cluster docker-compose down -v rm .env -linux-amd64: ## Build Mongo tools for linux-amd64. +linux-amd64: ## Build Go tools for linux-amd64. @echo "Building linux/amd64 binaries in ${BIN_DIR} as version ${VERSION}" @cd ${TOP_DIR} && go get ./... @$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;) @$(foreach pkg,$(pkgs),GOOS=linux GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);) -linux-386: ## Build Mongo tools for linux-386 +linux-386: ## Build Go tools for linux-386 @echo "Building linux/386 binaries in ${BIN_DIR} as version ${VERSION}" @cd ${TOP_DIR} && go get ./... @$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;) @$(foreach pkg,$(pkgs),GOOS=linux GOARCH=386 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);) -darwin-amd64: ## Build Mongo tools for darwin-amd64 (MacOS) +darwin-amd64: ## Build Go tools for darwin-amd64 (MacOS) @echo "Building darwin/amd64 binaries in ${BIN_DIR} as version ${VERSION}" @cd ${TOP_DIR} && go get ./... @$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;) @$(foreach pkg,$(pkgs),GOOS=darwin GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);) +darwin-arm64: ## Build Go tools for darwin-arm64 (MacOS) + @echo "Building darwin/arm64 binaries in ${BIN_DIR} as version ${VERSION}" + @cd ${TOP_DIR} && go get ./... + @$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;) + @$(foreach pkg,$(pkgs),GOOS=darwin GOARCH=arm64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);) + style: ## Check code style @echo ">> checking code style" @! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^' From 65358b715fe00b2f9fe881d13b6453d4a4a207fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Fri, 17 Nov 2023 20:32:07 +0100 Subject: [PATCH 02/13] Fix MongoDB StorageEngine --- src/go/mongolib/proto/server_status.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/go/mongolib/proto/server_status.go b/src/go/mongolib/proto/server_status.go index a9608927..88710e84 100644 --- a/src/go/mongolib/proto/server_status.go +++ b/src/go/mongolib/proto/server_status.go @@ -30,10 +30,10 @@ type ServerStatus struct { } type StorageEngine struct { - Name string `bson:"name"` - SupportCommittedREads bool `bson:supportsCommittedReads"` - ReadOnly bool `bson:"readOnly"` - Persistent bool `bson:"persistent"` + Name string `bson:"name"` + SupportsCommittedReads bool `bson:"supportsCommittedReads"` + ReadOnly bool `bson:"readOnly"` + Persistent bool `bson:"persistent"` } // WiredTiger stores information related to the WiredTiger storage engine. From 2ea8f4036cff97f9cad2a9878d7c59ffe5ad1339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Fri, 17 Nov 2023 20:34:35 +0100 Subject: [PATCH 03/13] Fix MongoDB Security --- src/go/mongolib/proto/cmdlineopts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/mongolib/proto/cmdlineopts.go b/src/go/mongolib/proto/cmdlineopts.go index 802a3042..0d2cf16c 100644 --- a/src/go/mongolib/proto/cmdlineopts.go +++ b/src/go/mongolib/proto/cmdlineopts.go @@ -37,7 +37,7 @@ type Security struct { KeyFile string `bson:"keyFile"` ClusterAuthMode string `bson:"clusterAuthMode"` Authorization string `bson:"authorization"` - JavascriptEnabled bool `bson:javascriptEnabled"` + JavascriptEnabled bool `bson:"javascriptEnabled"` Sasl struct { HostName string `bson:"hostName"` ServiceName string `bson:"serverName"` From 1c5048546ada0eb34259e32e82ab5f940d47233a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Fri, 17 Nov 2023 20:38:08 +0100 Subject: [PATCH 04/13] Fix variable collision with imported package name --- src/go/lib/config/config_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/go/lib/config/config_test.go b/src/go/lib/config/config_test.go index a09c2db4..438ca5f7 100644 --- a/src/go/lib/config/config_test.go +++ b/src/go/lib/config/config_test.go @@ -129,14 +129,14 @@ func TestOverrideConfig(t *testing.T) { } func TestDefaultFiles(t *testing.T) { - user, _ := user.Current() + currentUser, _ := user.Current() toolname := "pt-testing" want := []string{ "/etc/percona-toolkit/percona-toolkit.conf", fmt.Sprintf("/etc/percona-toolkit/%s.conf", toolname), - fmt.Sprintf("%s/.percona-toolkit.conf", user.HomeDir), - fmt.Sprintf("%s/.%s.conf", user.HomeDir, toolname), + fmt.Sprintf("%s/.percona-toolkit.conf", currentUser.HomeDir), + fmt.Sprintf("%s/.%s.conf", currentUser.HomeDir, toolname), } got, err := DefaultConfigFiles(toolname) From 629ded39608afafce74a5e612e0feb541bc13c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Fri, 17 Nov 2023 20:47:54 +0100 Subject: [PATCH 05/13] Make OrderedBy's return type exported --- src/go/pt-mongodb-query-digest/main.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/go/pt-mongodb-query-digest/main.go b/src/go/pt-mongodb-query-digest/main.go index 51ccbe73..1c11020e 100644 --- a/src/go/pt-mongodb-query-digest/main.go +++ b/src/go/pt-mongodb-query-digest/main.go @@ -407,32 +407,32 @@ func getTotalsTemplate() string { type lessFunc func(p1, p2 *stats.QueryStats) bool -type multiSorter struct { +type MultiSorter struct { queries []stats.QueryStats less []lessFunc } // Sort sorts the argument slice according to the less functions passed to OrderedBy. -func (ms *multiSorter) Sort(queries []stats.QueryStats) { +func (ms *MultiSorter) Sort(queries []stats.QueryStats) { ms.queries = queries sort.Sort(ms) } // OrderedBy returns a Sorter that sorts using the less functions, in order. // Call its Sort method to sort the data. -func OrderedBy(less ...lessFunc) *multiSorter { - return &multiSorter{ +func OrderedBy(less ...lessFunc) *MultiSorter { + return &MultiSorter{ less: less, } } // Len is part of sort.Interface. -func (ms *multiSorter) Len() int { +func (ms *MultiSorter) Len() int { return len(ms.queries) } // Swap is part of sort.Interface. -func (ms *multiSorter) Swap(i, j int) { +func (ms *MultiSorter) Swap(i, j int) { ms.queries[i], ms.queries[j] = ms.queries[j], ms.queries[i] } @@ -441,7 +441,7 @@ func (ms *multiSorter) Swap(i, j int) { // !Less. Note that it can call the less functions twice per call. We // could change the functions to return -1, 0, 1 and reduce the // number of calls for greater efficiency: an exercise for the reader. -func (ms *multiSorter) Less(i, j int) bool { +func (ms *MultiSorter) Less(i, j int) bool { p, q := &ms.queries[i], &ms.queries[j] // Try all but the last comparison. var k int From 61021d9ce6c0e626501d6b5cd3a2f62ef68b10d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sun, 19 Nov 2023 22:13:42 +0100 Subject: [PATCH 06/13] Update src/go/lib/config/config_test.go Co-authored-by: Sveta Smirnova --- src/go/lib/config/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/lib/config/config_test.go b/src/go/lib/config/config_test.go index 438ca5f7..6ab1170e 100644 --- a/src/go/lib/config/config_test.go +++ b/src/go/lib/config/config_test.go @@ -129,7 +129,7 @@ func TestOverrideConfig(t *testing.T) { } func TestDefaultFiles(t *testing.T) { - currentUser, _ := user.Current() + current, _ := user.Current() toolname := "pt-testing" want := []string{ From ed7f4b3e396635daa3a32c27c4d1d19cfa7054fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sun, 19 Nov 2023 22:13:47 +0100 Subject: [PATCH 07/13] Update src/go/lib/config/config_test.go Co-authored-by: Sveta Smirnova --- src/go/lib/config/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/lib/config/config_test.go b/src/go/lib/config/config_test.go index 6ab1170e..67c947c5 100644 --- a/src/go/lib/config/config_test.go +++ b/src/go/lib/config/config_test.go @@ -135,7 +135,7 @@ func TestDefaultFiles(t *testing.T) { want := []string{ "/etc/percona-toolkit/percona-toolkit.conf", fmt.Sprintf("/etc/percona-toolkit/%s.conf", toolname), - fmt.Sprintf("%s/.percona-toolkit.conf", currentUser.HomeDir), + fmt.Sprintf("%s/.percona-toolkit.conf", current.HomeDir), fmt.Sprintf("%s/.%s.conf", currentUser.HomeDir, toolname), } From c6b6a4086d44c6808eda793347c0de28350e4c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sun, 19 Nov 2023 22:13:53 +0100 Subject: [PATCH 08/13] Update src/go/lib/config/config_test.go Co-authored-by: Sveta Smirnova --- src/go/lib/config/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/lib/config/config_test.go b/src/go/lib/config/config_test.go index 67c947c5..1eb5fd05 100644 --- a/src/go/lib/config/config_test.go +++ b/src/go/lib/config/config_test.go @@ -136,7 +136,7 @@ func TestDefaultFiles(t *testing.T) { "/etc/percona-toolkit/percona-toolkit.conf", fmt.Sprintf("/etc/percona-toolkit/%s.conf", toolname), fmt.Sprintf("%s/.percona-toolkit.conf", current.HomeDir), - fmt.Sprintf("%s/.%s.conf", currentUser.HomeDir, toolname), + fmt.Sprintf("%s/.%s.conf", current.HomeDir, toolname), } got, err := DefaultConfigFiles(toolname) From fef6fa402234cb5dca55d8ecb0e81403849355ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:18:12 +0000 Subject: [PATCH 09/13] Bump k8s.io/api from 0.28.3 to 0.28.4 Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.28.3 to 0.28.4. - [Commits](https://github.com/kubernetes/api/compare/v0.28.3...v0.28.4) --- updated-dependencies: - dependency-name: k8s.io/api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index a47ee3da..aaca3e02 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/crypto v0.15.0 golang.org/x/exp v0.0.0-20230321023759-10a507213a29 gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 - k8s.io/api v0.28.3 + k8s.io/api v0.28.4 ) require ( @@ -57,7 +57,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apimachinery v0.28.3 // indirect + k8s.io/apimachinery v0.28.4 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index 341aeb43..6550443a 100644 --- a/go.sum +++ b/go.sum @@ -193,10 +193,10 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM= -k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc= -k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A= -k8s.io/apimachinery v0.28.3/go.mod h1:uQTKmIqs+rAYaq+DFaoD2X7pcjLOqbQX2AOiO0nIpb8= +k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= +k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= +k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= +k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= From 81882b67ccac3f15647be538cbc0dd44926f1d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 21 Nov 2023 02:41:26 +0000 Subject: [PATCH 10/13] fix --- src/go/pt-mongodb-query-digest/main.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/go/pt-mongodb-query-digest/main.go b/src/go/pt-mongodb-query-digest/main.go index 1c11020e..0b8a6018 100644 --- a/src/go/pt-mongodb-query-digest/main.go +++ b/src/go/pt-mongodb-query-digest/main.go @@ -407,32 +407,32 @@ func getTotalsTemplate() string { type lessFunc func(p1, p2 *stats.QueryStats) bool -type MultiSorter struct { +type multiSorter struct { queries []stats.QueryStats less []lessFunc } // Sort sorts the argument slice according to the less functions passed to OrderedBy. -func (ms *MultiSorter) Sort(queries []stats.QueryStats) { +func (ms *multiSorter) Sort(queries []stats.QueryStats) { ms.queries = queries sort.Sort(ms) } -// OrderedBy returns a Sorter that sorts using the less functions, in order. +// orderedBy returns a Sorter that sorts using the less functions, in order. // Call its Sort method to sort the data. -func OrderedBy(less ...lessFunc) *MultiSorter { - return &MultiSorter{ +func orderedBy(less ...lessFunc) *multiSorter { + return &multiSorter{ less: less, } } // Len is part of sort.Interface. -func (ms *MultiSorter) Len() int { +func (ms *multiSorter) Len() int { return len(ms.queries) } // Swap is part of sort.Interface. -func (ms *MultiSorter) Swap(i, j int) { +func (ms *multiSorter) Swap(i, j int) { ms.queries[i], ms.queries[j] = ms.queries[j], ms.queries[i] } @@ -441,7 +441,7 @@ func (ms *MultiSorter) Swap(i, j int) { // !Less. Note that it can call the less functions twice per call. We // could change the functions to return -1, 0, 1 and reduce the // number of calls for greater efficiency: an exercise for the reader. -func (ms *MultiSorter) Less(i, j int) bool { +func (ms *multiSorter) Less(i, j int) bool { p, q := &ms.queries[i], &ms.queries[j] // Try all but the last comparison. var k int From f3bd08ad0d753e8dd05c49624caf8becb73479bd Mon Sep 17 00:00:00 2001 From: Sveta Smirnova Date: Thu, 23 Nov 2023 22:14:35 +0300 Subject: [PATCH 11/13] Make OrderedBy not exported - Updated orderedBy call --- src/go/pt-mongodb-query-digest/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/go/pt-mongodb-query-digest/main.go b/src/go/pt-mongodb-query-digest/main.go index 0b8a6018..badc1a57 100644 --- a/src/go/pt-mongodb-query-digest/main.go +++ b/src/go/pt-mongodb-query-digest/main.go @@ -412,7 +412,7 @@ type multiSorter struct { less []lessFunc } -// Sort sorts the argument slice according to the less functions passed to OrderedBy. +// Sort sorts the argument slice according to the less functions passed to orderedBy. func (ms *multiSorter) Sort(queries []stats.QueryStats) { ms.queries = queries sort.Sort(ms) @@ -520,7 +520,7 @@ func sortQueries(queries []stats.QueryStats, orderby []string) []stats.QueryStat sortFuncs = append(sortFuncs, f) } - OrderedBy(sortFuncs...).Sort(queries) + orderedBy(sortFuncs...).Sort(queries) return queries } From 5e1dfaf218de3801a0cd29ded8daf0c7a9089525 Mon Sep 17 00:00:00 2001 From: Sami Ahlroos Date: Tue, 28 Nov 2023 14:29:58 +0200 Subject: [PATCH 12/13] build Go tools from top Makefile --- Makefile.PL | 24 +++++++++++++++++++++--- src/go/Makefile | 6 ++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 485e715b..0e8e8280 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,22 +1,40 @@ use ExtUtils::MakeMaker; +use ExtUtils::MY; + +sub MY::postamble { + return <<'MAKE_GOTOOLS'; +gotools: + cd src/go && $(MAKE) build + +MAKE_GOTOOLS +} WriteMakefile( NAME => 'Percona::Toolkit', VERSION => '3.5.5', - EXE_FILES => [ ], + EXE_FILES => [ + map { + (my $name = $_) =~ s/^bin.//; + my $file_name = $_; + if ( ( $file_name !~ m/mongo/ ) || ( $file_name !~ m/pg/ ) || ( $file_name !~ m/pt-stalk/ ) || ( $file_name !~ m/pt-k8s/ ) ) { + $_; + } + } + ], MAN1PODS => { 'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p', map { (my $name = $_) =~ s/^bin.//; my $file_name = $_; - if ( ( $file_name !~ m/mongo/ ) || ( $file_name !~ m/pg/ ) || ( $file_name !~ m/pt-stalk/ ) ) { + if ( ( $file_name !~ m/mongo/ ) || ( $file_name !~ m/pg/ ) || ( $file_name !~ m/pt-stalk/ ) || ( $file_name !~ m/pt-k8s/ ) ) { $_ => "blib/man1/$name.1p"; } } }, MAN3PODS => {}, # man(3) pages are for C libs + depend => {manifypods => gotools}, PREREQ_PM => { DBI => 1.46, DBD::mysql => 3.0000_0, }, -); +); \ No newline at end of file diff --git a/src/go/Makefile b/src/go/Makefile index e967593a..f94a431f 100644 --- a/src/go/Makefile +++ b/src/go/Makefile @@ -151,6 +151,12 @@ darwin-arm64: ## Build Go tools for darwin-arm64 (MacOS) @$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;) @$(foreach pkg,$(pkgs),GOOS=darwin GOARCH=arm64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);) +build: + @echo "Building binaries in ${BIN_DIR} as version ${VERSION}" + @cd ${TOP_DIR} && go get ./... + @$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;) + @$(foreach pkg,$(pkgs),go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);) + style: ## Check code style @echo ">> checking code style" @! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^' From 375b67ddf38e4a00e83b471a415245e41c2ff204 Mon Sep 17 00:00:00 2001 From: Surabhi Bhat Date: Thu, 30 Nov 2023 17:10:55 +0530 Subject: [PATCH 13/13] Fix Trivy Scan Failure - update libraries --- .github/workflows/toolkit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/toolkit.yml b/.github/workflows/toolkit.yml index 02b2bf77..7561f626 100644 --- a/.github/workflows/toolkit.yml +++ b/.github/workflows/toolkit.yml @@ -25,7 +25,7 @@ jobs: run: cd src/go; make linux-amd64; cd ../../ - name: Build the Docker image - run: echo "FROM oraclelinux:9-slim" > Dockerfile; echo "COPY bin/* /usr/bin/" >> Dockerfile; docker build . --file Dockerfile --tag percona-toolkit:${{ github.sha }} + run: echo "FROM oraclelinux:9-slim" > Dockerfile; echo "RUN microdnf -y update" >> Dockerfile; echo "COPY bin/* /usr/bin/" >> Dockerfile; docker build . --file Dockerfile --tag percona-toolkit:${{ github.sha }} - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@0.14.0 with: