From c5ace22b4ea06bab09d8c6363de0988a81ee4915 Mon Sep 17 00:00:00 2001 From: Christian Kotzbauer Date: Sun, 19 Jun 2022 11:12:42 +0200 Subject: [PATCH] fix: update libk8soci Signed-off-by: Christian Kotzbauer --- go.mod | 3 ++- go.sum | 6 ++++-- internal/daemon/daemon.go | 7 +++---- internal/kubernetes/kubernetes.go | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 526c59b5..bf522dd3 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/anchore/syft v0.48.1 - github.com/ckotzbauer/libk8soci v0.0.0-20220618141744-5d23eb2eeea7 + github.com/ckotzbauer/libk8soci v0.0.0-20220619090832-e2ab03f1c147 github.com/novln/docker-parser v1.0.0 github.com/nscuro/dtrack-client v0.6.0 github.com/robfig/cron v1.2.0 @@ -103,6 +103,7 @@ require ( github.com/xanzy/ssh-agent v0.3.0 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f // indirect + golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d // indirect golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 // indirect golang.org/x/tools v0.1.10 // indirect diff --git a/go.sum b/go.sum index 191749ed..edcd2c3e 100644 --- a/go.sum +++ b/go.sum @@ -204,8 +204,8 @@ github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLI github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/ckotzbauer/libk8soci v0.0.0-20220618141744-5d23eb2eeea7 h1:femLWHdpj7arNUzYxsIrhv4+fzaAqVSAnUxhz2bWZi4= -github.com/ckotzbauer/libk8soci v0.0.0-20220618141744-5d23eb2eeea7/go.mod h1:MuZMhEXIeKexg2qhJVtYc3xNo15g63M9d1ArjKSCXU4= +github.com/ckotzbauer/libk8soci v0.0.0-20220619090832-e2ab03f1c147 h1:JFCyIG3cuWioiqHev9wQ2bIUeqnIW+RkEeMrTQRzLnc= +github.com/ckotzbauer/libk8soci v0.0.0-20220619090832-e2ab03f1c147/go.mod h1:aWyQlE59uqprR2BxAgryFaULVxb8fMy4EH+WpInGz0o= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -1307,6 +1307,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d h1:vtUKgx8dahOomfFzLREU8nSv25YHnTgLBn4rDnWZdU0= +golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/internal/daemon/daemon.go b/internal/daemon/daemon.go index 109f8779..db82f891 100644 --- a/internal/daemon/daemon.go +++ b/internal/daemon/daemon.go @@ -94,8 +94,7 @@ func (c *CronService) runBackgroundService() { running = false } -func (c *CronService) executeSyftScans(format string, k8s *kubernetes.KubeClient, - containerImages []libk8s.KubeImage, allImages map[string]libk8s.KubeImage) { +func (c *CronService) executeSyftScans(format string, k8s *kubernetes.KubeClient, containerImages []libk8s.KubeImage, allImages []libk8s.KubeImage) { sy := syft.New(format) for _, image := range containerImages { @@ -119,9 +118,9 @@ func (c *CronService) executeSyftScans(format string, k8s *kubernetes.KubeClient } } - /*for _, t := range c.targets { + for _, t := range c.targets { t.Cleanup(allImages) - }*/ + } } func executeJobImage(k8s *kubernetes.KubeClient, containerImages []libk8s.KubeImage) { diff --git a/internal/kubernetes/kubernetes.go b/internal/kubernetes/kubernetes.go index 48d13852..beedbe81 100644 --- a/internal/kubernetes/kubernetes.go +++ b/internal/kubernetes/kubernetes.go @@ -38,7 +38,7 @@ func NewClient(ignoreAnnotations bool) *KubeClient { return &KubeClient{Client: client, ignoreAnnotations: ignoreAnnotations, SbomOperatorNamespace: sbomOperatorNamespace} } -func (client *KubeClient) LoadImageInfos(namespaces []corev1.Namespace, podLabelSelector string) ([]libk8s.KubeImage, map[string]libk8s.KubeImage) { +func (client *KubeClient) LoadImageInfos(namespaces []corev1.Namespace, podLabelSelector string) ([]libk8s.KubeImage, []libk8s.KubeImage) { fallbackPullSecretName := viper.GetString(internal.ConfigKeyFallbackPullSecret) var fallbackPullSecret []oci.KubeCreds