MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / pushManifest

Function pushManifest

cli/internal/publish/plugins.go:564–586  ·  view source on GitHub ↗
(ctx context.Context, pkgJSON PackageJSONV1, dockerToken string, insecureSkipVerify bool)

Source from the content-addressed store, hash-verified

562}
563
564func pushManifest(ctx context.Context, pkgJSON PackageJSONV1, dockerToken string, insecureSkipVerify bool) error {
565 imageName, repository, err := getManifestParams(pkgJSON.SupportedTargets[0].DockerImageTag)
566 if err != nil {
567 return err
568 }
569
570 manifestService, err := getManifestService(ctx, imageName, repository, dockerToken, insecureSkipVerify)
571 if err != nil {
572 return err
573 }
574
575 manifestList, err := getManifestList(ctx, manifestService, pkgJSON)
576 if err != nil {
577 return err
578 }
579
580 digest, err := manifestService.Put(ctx, manifestList, distribution.WithTag(pkgJSON.Version))
581 if err != nil {
582 return fmt.Errorf("failed to create Docker manifest: %v", err)
583 }
584 fmt.Println("Created manifest:", digest.String())
585 return nil
586}
587
588func PublishToDockerRegistry(ctx context.Context, token, distDir string, pkgJSON PackageJSONV1, popts Opts) error {
589 // We use a mix of the Docker Go SDK that implements the Docker Engine API https://docs.docker.com/engine/api/latest/

Callers 1

PublishToDockerRegistryFunction · 0.85

Calls 6

getManifestParamsFunction · 0.85
getManifestServiceFunction · 0.85
getManifestListFunction · 0.85
ErrorfMethod · 0.80
PrintlnMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected