Skip to content

Commit

Permalink
moved to multi auth config model (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
neel-astro committed Mar 8, 2022
1 parent de6aa6f commit e22843e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 269 deletions.
6 changes: 2 additions & 4 deletions airflow/mocks/PodmanBind.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions airflow/podman_bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package airflow
import (
"context"

podmanImages "github.com/astronomer/astro-cli/pkg/podman"
"github.com/containers/common/pkg/auth"
"github.com/containers/image/v5/types"
"github.com/containers/podman/v3/pkg/api/handlers"
Expand Down Expand Up @@ -32,7 +31,7 @@ type PodmanBind interface {
// Methods to handle image operations
Build(ctx context.Context, containerFiles []string, options entities.BuildOptions) (*entities.BuildReport, error)
Tag(ctx context.Context, nameOrID, tag, repo string, options *images.TagOptions) error
Push(ctx context.Context, source, destination string, options *podmanImages.PushOptions) error
Push(ctx context.Context, source, destination string, options *images.PushOptions) error
Untag(ctx context.Context, nameOrID, tag, repo string, options *images.UntagOptions) error
GetImage(ctx context.Context, nameOrID string, options *images.GetOptions) (*entities.ImageInspectReport, error)
// Method to handle registry operations
Expand Down Expand Up @@ -91,8 +90,8 @@ func (p *PodmanBinder) Tag(ctx context.Context, nameOrID, tag, repo string, opti
return images.Tag(ctx, nameOrID, tag, repo, options)
}

func (p *PodmanBinder) Push(ctx context.Context, source, destination string, options *podmanImages.PushOptions) error {
return podmanImages.Push(ctx, source, destination, options)
func (p *PodmanBinder) Push(ctx context.Context, source, destination string, options *images.PushOptions) error {
return images.Push(ctx, source, destination, options)
}

func (p *PodmanBinder) Untag(ctx context.Context, nameOrID, tag, repo string, options *images.UntagOptions) error {
Expand Down
5 changes: 2 additions & 3 deletions airflow/podman_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import (
"os"
"path/filepath"

podmanImages "github.com/astronomer/astro-cli/pkg/podman"

"github.com/containers/buildah"
"github.com/containers/buildah/imagebuildah"
"github.com/containers/podman/v3/pkg/bindings/images"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -73,7 +72,7 @@ func (p *PodmanImage) Push(cloudDomain, token, remoteImageTag string) error {
if err != nil {
return errors.Wrapf(err, "command 'podman tag %s %s' failed", p.imageName, remoteImage)
}
options := new(podmanImages.PushOptions).WithIdentityToken(token)
options := new(images.PushOptions)
if err := p.podmanBind.Push(p.conn, p.imageName, remoteImage, options); err != nil {
return errors.Wrapf(err, "Error pushing %s image to %s", p.imageName, registry)
}
Expand Down
116 changes: 0 additions & 116 deletions pkg/podman/images.go

This file was deleted.

34 changes: 0 additions & 34 deletions pkg/podman/types_push_options.go

This file was deleted.

108 changes: 0 additions & 108 deletions pkg/podman/utils.go

This file was deleted.

0 comments on commit e22843e

Please sign in to comment.