Skip to content

Commit

Permalink
update: explicitly handle artifact types when pushing
Browse files Browse the repository at this point in the history
Co-authored-by: Federico Di Pierro <[email protected]>
Signed-off-by: Lorenzo Susini <[email protected]>
  • Loading branch information
loresuso and FedeDP committed Jul 31, 2023
1 parent 83f13d1 commit 8eb9184
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
12 changes: 9 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const (
// Default values is set every 24 hours.
FollowResync = time.Hour * 24

//
// Viper configuration keys.
//

// RegistryCredentialConfigKey is the Viper key for the credentials store path configuration.
//#nosec G101 -- false positive
Expand All @@ -82,8 +84,10 @@ const (
RegistryAuthBasicKey = "registry.auth.basic"
// RegistryAuthGcpKey is the Viper key for gcp authentication configuration.
RegistryAuthGcpKey = "registry.auth.gcp"

// IndexesKey is the Viper key for indexes configuration.
IndexesKey = "indexes"

// ArtifactFollowEveryKey is the Viper key for follower "every" configuration.
ArtifactFollowEveryKey = "artifact.follow.every"
// ArtifactFollowCronKey is the Viper key for follower "cron" configuration.
Expand All @@ -100,16 +104,18 @@ const (
ArtifactFollowAssetsDirKey = "artifact.follow.assetsdir"
// ArtifactFollowTmpDirKey is the Viper key for follower "pluginsDir" configuration.
ArtifactFollowTmpDirKey = "artifact.follow.tmpdir"

// ArtifactInstallArtifactsKey is the Viper key for installer "artifacts" configuration.
ArtifactInstallArtifactsKey = "artifact.install.refs"
// ArtifactInstallRulesfilesDirKey is the Viper key for follower "rulesFilesDir" configuration.
// ArtifactInstallRulesfilesDirKey is the Viper key for installer "rulesFilesDir" configuration.
ArtifactInstallRulesfilesDirKey = "artifact.install.rulesfilesdir"
// ArtifactInstallPluginsDirKey is the Viper key for follower "pluginsDir" configuration.
// ArtifactInstallPluginsDirKey is the Viper key for installer "pluginsDir" configuration.
ArtifactInstallPluginsDirKey = "artifact.install.pluginsdir"
// ArtifactInstallAssetsDirKey is the Viper key for follower "pluginsDir" configuration.
// ArtifactInstallAssetsDirKey is the Viper key for installer "pluginsDir" configuration.
ArtifactInstallAssetsDirKey = "artifact.install.assetsdir"
// ArtifactInstallResolveDepsKey is the Viper key for installer "resolveDeps" configuration.
ArtifactInstallResolveDepsKey = "artifact.install.resolveDeps"

// ArtifactAllowedTypesKey is the Viper key for the whitelist of artifacts to be installed in the system.
ArtifactAllowedTypesKey = "artifact.allowedTypes"
// ArtifactNoVerifyKey is the Viper key for skipping signature verification.
Expand Down
2 changes: 1 addition & 1 deletion pkg/oci/pusher/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (p *Pusher) Push(ctx context.Context, artifactType oci.ArtifactType,
}
}

if artifactType != oci.Plugin {
if artifactType == oci.Rulesfile || artifactType == oci.Asset {
// We should have only one manifestDesc for any not arch dependent artifact.
rootDesc = manifestDescs[0]
} else {
Expand Down
3 changes: 2 additions & 1 deletion pkg/options/directory_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
package options

import (
"github.com/falcosecurity/falcoctl/internal/config"
"github.com/spf13/cobra"

"github.com/falcosecurity/falcoctl/internal/config"
)

const (
Expand Down

0 comments on commit 8eb9184

Please sign in to comment.