Skip to content

Commit

Permalink
feat: normalize package name in container package
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadch91 committed Dec 20, 2024
1 parent 136c268 commit 12ce187
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions provider/describer/container_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import (
"context"
"encoding/json"
"fmt"
"strconv"
"strings"

"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/opengovern/og-describer-github/pkg/sdk/models"
"github.com/opengovern/og-describer-github/provider/model"
resilientbridge "github.com/opengovern/resilient-bridge"
"github.com/opengovern/resilient-bridge/adapters"
"strconv"
)

func GetContainerPackageList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error) {
Expand Down Expand Up @@ -47,8 +49,9 @@ func GetContainerPackageList(ctx context.Context, githubClient GitHubClient, org
func getVersionOutput(apiToken, org, packageName string, version model.PackageVersion, stream *models.StreamSender) ([]models.Resource, error) {
// Each version can have multiple tags. We'll produce one output object per tag.
var values []models.Resource
normalizedPackageName := strings.ToLower(packageName)
for _, tag := range version.Metadata.Container.Tags {
imageRef := fmt.Sprintf("ghcr.io/%s/%s:%s", org, packageName, tag)
imageRef := fmt.Sprintf("ghcr.io/%s/%s:%s", org, normalizedPackageName, tag)
ov, err := fetchAndAssembleOutput(apiToken, version, imageRef)
if err != nil {
return nil, err
Expand Down

0 comments on commit 12ce187

Please sign in to comment.