Skip to content

Commit

Permalink
Fetch source creds from Vault
Browse files Browse the repository at this point in the history
  • Loading branch information
vstarostin committed Nov 24, 2023
1 parent 1fd506c commit 3a7826d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
17 changes: 15 additions & 2 deletions cmd/imagePushToRegistry_generated.go

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

6 changes: 0 additions & 6 deletions pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
cranecmd "github.com/google/go-containerregistry/cmd/crane/cmd"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/crane"
"github.com/google/go-containerregistry/pkg/logs"
"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/remote"
Expand All @@ -31,11 +30,6 @@ type AuthEntry struct {
Auth string `json:"auth,omitempty"`
}

func init() {
logs.Warn.SetOutput(os.Stderr)
logs.Progress.SetOutput(os.Stderr)
}

// MergeDockerConfigJSON merges two docker config.json files.
func MergeDockerConfigJSON(sourcePath, targetPath string, utils piperutils.FileUtils) error {
if exists, _ := utils.FileExists(sourcePath); !exists {
Expand Down
11 changes: 9 additions & 2 deletions resources/metadata/imagePushToRegistry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ metadata:
In case you want to pull an existing image from a remote container registry, a source image and source registry needs to be specified.<br />
This makes it possible to move an image from one registry to another.
imagePushToRegistry is not similar in functionality to containerPushToRegistry (which is currently a groovy based step and only be used in jenkins). currently imagePushToRegistry only
The imagePushToRegistry is not similar in functionality to containerPushToRegistry (which is currently a groovy based step and only be used in jenkins).
Currently the imagePushToRegistry only supports copying a local image or image from source remote registry to destination registry.
spec:
inputs:
Expand All @@ -32,7 +33,7 @@ spec:
param: container/imageNameTag
- name: sourceImage
type: string
description: Defines the name (incl. tag) of the source image to be pushed to a new image defined in `targetDockerImage`. This is helpful for moving images from one location to another.
description: Defines the name (incl. tag) of the source image to be pushed to a new image defined in `targetImage`. This is helpful for moving images from one location to another.
mandatory: true
scope:
- PARAMETERS
Expand Down Expand Up @@ -62,6 +63,9 @@ spec:
resourceRef:
- name: commonPipelineEnvironment
param: container/repositoryUsername
- type: vaultSecret
name: registryCredentialsVaultSecretName
default: docker-registry
- name: sourceRegistryPassword
type: string
description: Password of the source registry where the image should be pushed pulled from.
Expand All @@ -72,6 +76,9 @@ spec:
resourceRef:
- name: commonPipelineEnvironment
param: container/repositoryPassword
- type: vaultSecret
name: registryCredentialsVaultSecretName
default: docker-registry
- name: targetRegistryUrl
description: Defines a registry url from where the image should optionally be pushed to, incl. the protocol like `https://my.registry.com`*"
type: string
Expand Down

0 comments on commit 3a7826d

Please sign in to comment.