Skip to content

Commit

Permalink
update(build): output full name on push
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <luca@guerra.sh>
  • Loading branch information
LucaGuerra authored and poiana committed Sep 5, 2023
1 parent f195437 commit 28d9d1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions build/registry/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ func doPushToOCI(registryFilename, gitTag string) (*string, error) {
return nil, fmt.Errorf("could not push %s to %s with source %s and tags %v: %w", tgzFile, ociRepoRef, repoGit, tagsToUpdate, err)
}

return digest, nil
// ociRepoDigest is a string that looks like ghcr.io/falcosecurity/rules/falco-rules@sha256:123456...
ociRepoDigest := fmt.Sprintf("%s@%s", ociRepoRef, *digest)

return &ociRepoDigest, nil
}

func rulesOciRepos(registryEntries *Registry, ociRepoPrefix string) (map[string]string, error) {
Expand Down Expand Up @@ -265,11 +268,11 @@ func main() {
Args: cobra.ExactArgs(2),
DisableFlagsInUseLine: true,
RunE: func(c *cobra.Command, args []string) error {
digest, err := doPushToOCI(args[0], args[1])
ociRepoDigest, err := doPushToOCI(args[0], args[1])
if err != nil {
return err
}
fmt.Println(*digest)
fmt.Println(*ociRepoDigest)

return nil
},
Expand Down
1 change: 1 addition & 0 deletions build/registry/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
Expand Down

0 comments on commit 28d9d1f

Please sign in to comment.