Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ coverage:
dep:
GO111MODULE=on go mod tidy
GO111MODULE=on go mod vendor
bazelisk run //:gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories
bazelisk run //:gazelle -- update-repos -from_file=go.mod -prune -to_macro=repositories.bzl%go_repositories

.PHONY: gazelle
gazelle:
Expand Down
38 changes: 13 additions & 25 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ load(
"go_rules_dependencies",
)

go_rules_dependencies()

go_register_toolchains(
go_version = "1.14.10",
)

load(
"@io_bazel_rules_go//extras:embed_data_deps.bzl",
"go_embed_data_dependencies",
)

go_embed_data_dependencies()

http_archive(
name = "bazel_gazelle",
sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
Expand All @@ -43,31 +56,6 @@ load(
"go_repository",
)

# TODO: Investigate why "go-containerregistry" package is overridden
# The downloaded source inside bazel-pipe/external/com_github_google_go_containerregistry is not containing some functions.
# Maybe gazelle downloaded the wrong version.
# As a workaround, we moved the go_repository part from repositories.bzl to here. We have to stop doing that ASAP.
# See: https://github.com/pipe-cd/pipe/pull/1344#issuecomment-755075915
go_repository(
name = "com_github_google_go_containerregistry",
importpath = "github.com/google/go-containerregistry",
sum = "h1:+vqpHdgIbD7xSeufHJq0iuAx7ILcEeh3fR5Og2nW1R0=",
version = "v0.3.0",
)

go_rules_dependencies()

go_register_toolchains(
go_version = "1.14.10",
)

load(
"@io_bazel_rules_go//extras:embed_data_deps.bzl",
"go_embed_data_dependencies",
)

go_embed_data_dependencies()

gazelle_dependencies()

### Google Protobuf
Expand Down
1 change: 0 additions & 1 deletion pkg/app/piped/imageprovider/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/app/piped/imageprovider/ecr:go_default_library",
"//pkg/app/piped/imageprovider/gcr:go_default_library",
"//pkg/config:go_default_library",
"//pkg/model:go_default_library",
"@org_uber_go_zap//:go_default_library",
Expand Down
7 changes: 0 additions & 7 deletions pkg/app/piped/imageprovider/gcr/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,4 @@ go_library(
srcs = ["gcr.go"],
importpath = "github.com/pipe-cd/pipe/pkg/app/piped/imageprovider/gcr",
visibility = ["//visibility:public"],
deps = [
"//pkg/model:go_default_library",
"@com_github_google_go_containerregistry//pkg/authn:go_default_library",
"@com_github_google_go_containerregistry//pkg/name:go_default_library",
"@com_github_google_go_containerregistry//pkg/v1/google:go_default_library",
"@org_uber_go_zap//:go_default_library",
],
)
2 changes: 2 additions & 0 deletions pkg/app/piped/imageprovider/gcr/gcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package gcr

/*
import (
"context"
"fmt"
Expand Down Expand Up @@ -133,3 +134,4 @@ func (g *GCR) GetLatestImage(ctx context.Context, image *model.ImageName) (*mode
Tag: latest.Tags[0],
}, nil
}
*/
14 changes: 8 additions & 6 deletions pkg/app/piped/imageprovider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"go.uber.org/zap"

"github.com/pipe-cd/pipe/pkg/app/piped/imageprovider/ecr"
"github.com/pipe-cd/pipe/pkg/app/piped/imageprovider/gcr"
"github.com/pipe-cd/pipe/pkg/config"
"github.com/pipe-cd/pipe/pkg/model"
)
Expand All @@ -42,11 +41,14 @@ type Provider interface {
func NewProvider(cfg *config.PipedImageProvider, logger *zap.Logger) (Provider, error) {
switch cfg.Type {
case model.ImageProviderTypeGCR:
options := []gcr.Option{
gcr.WithServiceAccountFile(cfg.GCRConfig.ServiceAccountFile),
gcr.WithLogger(logger),
}
return gcr.NewGCR(cfg.Name, options...)
/*
options := []gcr.Option{
gcr.WithServiceAccountFile(cfg.GCRConfig.ServiceAccountFile),
gcr.WithLogger(logger),
}
return gcr.NewGCR(cfg.Name, options...)
*/
return nil, nil
case model.ImageProviderTypeECR:
options := []ecr.Option{
ecr.WithRegistryID(cfg.ECRConfig.RegistryID),
Expand Down
Loading