From 023880fc0d26ef9dd574de4cab0ea9132de2072a Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Thu, 7 Mar 2024 15:25:18 +0100 Subject: [PATCH] fix comments Signed-off-by: Ivan Milchev --- explorer/scan/discovery.go | 2 +- explorer/scan/local_scanner.go | 2 +- providers-sdk/v1/inventory/inventory.proto | 2 +- providers/os/connection/container/image_connection.go | 2 +- providers/os/connection/docker/container_connection.go | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/explorer/scan/discovery.go b/explorer/scan/discovery.go index 4278f3e4ea..200afdf2ab 100644 --- a/explorer/scan/discovery.go +++ b/explorer/scan/discovery.go @@ -201,7 +201,7 @@ func prepareAsset(a *inventory.Asset, rootAsset *inventory.Asset, runtimeLabels a.AddAnnotations(rootAsset.GetAnnotations()) a.ManagedBy = rootAsset.ManagedBy if platform := a.GetPlatform(); platform != nil { - a.KindString = a.GetPlatform().Kind + a.KindString = platform.Kind } if a.Labels == nil { a.Labels = map[string]string{} diff --git a/explorer/scan/local_scanner.go b/explorer/scan/local_scanner.go index 6be2134a21..28b07c1438 100644 --- a/explorer/scan/local_scanner.go +++ b/explorer/scan/local_scanner.go @@ -263,7 +263,6 @@ func (s *LocalScanner) distributeJob(job *Job, ctx context.Context, upstream *up assetBatches := slicesx.Batch(discoveredAssets.Assets, 100) for i := range assetBatches { - log.Info().Msg("synchronize assets") batch := assetBatches[i] // sync assets @@ -277,6 +276,7 @@ func (s *LocalScanner) distributeJob(job *Job, ctx context.Context, upstream *up assetsToSync = append(assetsToSync, batch[i].Asset) } + log.Info().Msg("synchronize assets") resp, err := services.SynchronizeAssets(ctx, &explorer.SynchronizeAssetsReq{ SpaceMrn: spaceMrn, List: assetsToSync, diff --git a/providers-sdk/v1/inventory/inventory.proto b/providers-sdk/v1/inventory/inventory.proto index 5094e739da..6a79d7244f 100644 --- a/providers-sdk/v1/inventory/inventory.proto +++ b/providers-sdk/v1/inventory/inventory.proto @@ -198,7 +198,7 @@ message Config { string platform_id = 26; repeated string capabilities = 29; // Determines whether to delay discovery during the connection phase. - // Discovery will only happen if this is false + // Discovery will only happen if Connect is called and this is false bool delay_discovery = 31; } diff --git a/providers/os/connection/container/image_connection.go b/providers/os/connection/container/image_connection.go index e90df9c062..7100b69f76 100644 --- a/providers/os/connection/container/image_connection.go +++ b/providers/os/connection/container/image_connection.go @@ -23,7 +23,7 @@ import ( // NewImageConnection uses a container image reference as input and creates a tar connection func NewImageConnection(id uint32, conf *inventory.Config, asset *inventory.Asset, img v1.Image) (*tar.Connection, error) { // FIXME: DEPRECATED, remove in v12.0 vv - // The SkipDiscovery flag should always be set from v12 + // The DelayDiscovery flag should always be set from v12 if conf.Options == nil || conf.Options[plugin.DISABLE_DELAYED_DISCOVERY_OPTION] == "" { conf.DelayDiscovery = true // Delay discovery, to make sure we don't directly download the image } diff --git a/providers/os/connection/docker/container_connection.go b/providers/os/connection/docker/container_connection.go index a0d5940188..f09ae90a5c 100644 --- a/providers/os/connection/docker/container_connection.go +++ b/providers/os/connection/docker/container_connection.go @@ -217,7 +217,7 @@ func NewDockerEngineContainer(id uint32, conf *inventory.Config, asset *inventor conn.Metadata.Name = containerid.ShortContainerImageID(ci.ID) conn.Metadata.Labels = ci.Labels // FIXME: DEPRECATED, remove in v12.0 vv - // The SkipDiscovery flag should always be set from v12 + // The DelayDiscovery flag should always be set from v12 if conf.Options == nil || conf.Options[plugin.DISABLE_DELAYED_DISCOVERY_OPTION] == "" { conf.DelayDiscovery = true // Delay discovery, to make sure we don't directly download the image } @@ -302,7 +302,7 @@ func NewContainerImageConnection(id uint32, conf *inventory.Config, asset *inven } conf.Options[tar.OPTION_FILE] = filename // FIXME: DEPRECATED, remove in v12.0 vv - // The SkipDiscovery flag should always be set from v12 + // The DelayDiscovery flag should always be set from v12 if conf.Options == nil || conf.Options[plugin.DISABLE_DELAYED_DISCOVERY_OPTION] == "" { conf.DelayDiscovery = true // Delay discovery, to make sure we don't directly download the image }