Skip to content

Commit

Permalink
fix(CI): use the repo URL as source of truth for plugin's owner
Browse files Browse the repository at this point in the history
Signed-off-by: Aldo Lacuku <[email protected]>
  • Loading branch information
alacuku authored and poiana committed May 14, 2024
1 parent 0e7ef76 commit 04f6e54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build/registry/cmd/validateRegistry/validateRegistryFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package validateRegistry
import (
"context"
"fmt"

"github.com/falcosecurity/falcoctl/pkg/oci/authn"
ocipuller "github.com/falcosecurity/falcoctl/pkg/oci/puller"
"github.com/falcosecurity/plugins/build/registry/pkg/oci"
"github.com/falcosecurity/plugins/build/registry/pkg/registry"
"github.com/spf13/cobra"
"k8s.io/klog/v2"
"strings"
)

func NewValidateRegistry(ctx context.Context) *cobra.Command {
Expand Down Expand Up @@ -38,7 +38,7 @@ func validateRegistry(ctx context.Context, registryFile string) error {
// For each plugin in the registry index, look for new ones to be released, and publish them.
for _, plugin := range reg.Plugins {
// Filter out plugins that are not owned by falcosecurity.
if plugin.Authors != oci.FalcoAuthors {
if !strings.HasPrefix(plugin.URL, oci.PluginsRepo) {
klog.V(2).Infof("skipping plugin %q with authors %q: it is not maintained by %q",
plugin.Name, plugin.Authors, oci.FalcoAuthors)
continue
Expand Down
1 change: 1 addition & 0 deletions build/registry/pkg/oci/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
RegistryOCI = "REGISTRY"
RepoGithub = "REPO_GITHUB"
FalcoAuthors = "The Falco Authors"
PluginsRepo = "https://github.com/falcosecurity/plugins"
archiveSuffix = ".tar.gz"
amd64Platform = "linux/amd64"
arm64Platform = "linux/arm64"
Expand Down
6 changes: 3 additions & 3 deletions build/registry/pkg/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ func tagsFromVersion(version *semver.Version) []string {
func handleArtifact(ctx context.Context, cfg *config, plugin *registry.Plugin, ociClient remote.Client,
pluginsAMD64, pluginsARM64, rulesfiles, devTag string) ([]registry.ArtifactPushMetadata, []registry.ArtifactPushMetadata, error) {
// Filter out plugins that are not owned by falcosecurity.
if plugin.Authors != FalcoAuthors {
if !strings.HasPrefix(plugin.URL, PluginsRepo) {
sepString := strings.Repeat("#", 15)
klog.V(2).Info("%s %s %s", sepString, plugin.Name, sepString)
klog.V(2).Infof("skipping plugin %q with authors %q: it is not maintained by %q",
klog.Info("%s %s %s", sepString, plugin.Name, sepString)
klog.Infof("skipping plugin %q with authors %q: it is not maintained by %q",
plugin.Name, plugin.Authors, FalcoAuthors)
return nil, nil, nil
}
Expand Down

0 comments on commit 04f6e54

Please sign in to comment.