diff --git a/build/registry/cmd.go b/build/registry/cmd.go index cf5439ff4..d1bd7343c 100644 --- a/build/registry/cmd.go +++ b/build/registry/cmd.go @@ -86,7 +86,7 @@ func doUploadToS3(registryFilename, gitTag string) error { rulesfileInfo := reg.RulesfileByName(pt.Name) if rulesfileInfo == nil { - return fmt.Errorf("could not find rulesfile %s in registry", pt.Name) + return fmt.Errorf("could not find rulesfile %s in the registry (reserved or archived are ignored)", pt.Name) } tmpDir, err := os.MkdirTemp("", "falco-artifacts-to-upload") @@ -149,7 +149,7 @@ func doPushToOCI(registryFilename, gitTag string) (*string, error) { rulesfileInfo := reg.RulesfileByName(pt.Name) if rulesfileInfo == nil { - return nil, fmt.Errorf("could not find rulesfile %s in registry", pt.Name) + return nil, fmt.Errorf("could not find rulesfile %s in the registry (reserved or archived are ignored)", pt.Name) } // Create the repository object for the ref. diff --git a/build/registry/registry.go b/build/registry/registry.go index 8e6d38412..140d6619f 100644 --- a/build/registry/registry.go +++ b/build/registry/registry.go @@ -42,6 +42,7 @@ type Rulesfile struct { URL string `yaml:"url"` License string `yaml:"license"` Reserved bool `yaml:"reserved"` + Archived bool `yaml:"archived"` } type Registry struct { @@ -67,6 +68,9 @@ func (r *Registry) Validate() error { // RulesfileByName returns the rulesfile in the index with the specified name, or nil if not found func (r *Registry) RulesfileByName(name string) *Rulesfile { for _, rf := range r.Rulesfiles { + if rf.Reserved || rf.Archived { + continue + } if rf.Name == name { return &rf }