From d10f2a49a5f8e6b52713add6e1f40f203cbe33e2 Mon Sep 17 00:00:00 2001 From: Tom Chauveau Date: Mon, 28 Jun 2021 14:48:49 +0200 Subject: [PATCH] Rename field according to @shykes review Signed-off-by: Tom Chauveau --- docs/reference/universe/docker/README.md | 12 ++++++------ stdlib/docker/docker.cue | 8 ++++---- stdlib/docker/tests/push-invalid-creds/push.cue | 8 +++++--- stdlib/docker/tests/push/push.cue | 8 +++++--- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/docs/reference/universe/docker/README.md b/docs/reference/universe/docker/README.md index 4473c994..29e8a01e 100644 --- a/docs/reference/universe/docker/README.md +++ b/docs/reference/universe/docker/README.md @@ -74,12 +74,12 @@ Push a docker image to a remote registry ### docker.#Push Inputs -| Name | Type | Description | -| ------------- |:-------------: |:-------------: | -|*name* | `string` |Remote name (example: "index.docker.io/alpine:latest") | -|*source* | `dagger.#Artifact` |Image source | -|*auth.username* | `string` |Username | -|*auth.secret* | `string` |Password or secret | +| Name | Type | Description | +| ------------- |:-------------: |:-------------: | +|*target* | `string` |Remote target (example: "index.docker.io/alpine:latest") | +|*source* | `dagger.#Artifact` |Image source | +|*auth.username* | `string` |Username | +|*auth.secret* | `string` |Password or secret | ### docker.#Push Outputs diff --git a/stdlib/docker/docker.cue b/stdlib/docker/docker.cue index 1a37324f..79e2905a 100644 --- a/stdlib/docker/docker.cue +++ b/stdlib/docker/docker.cue @@ -30,8 +30,8 @@ import ( // Push a docker image to a remote registry #Push: { - // Remote name (example: "index.docker.io/alpine:latest") - name: string @dagger(input) + // Remote target (example: "index.docker.io/alpine:latest") + target: string @dagger(input) // Image source source: dagger.#Artifact @dagger(input) @@ -50,13 +50,13 @@ import ( if auth != _|_ { op.#DockerLogin & { - target: name + "target": target username: auth.username secret: auth.secret } }, - op.#PushContainer & {ref: name}, + op.#PushContainer & {ref: target}, op.#Subdir & {dir: "/dagger"}, ] diff --git a/stdlib/docker/tests/push-invalid-creds/push.cue b/stdlib/docker/tests/push-invalid-creds/push.cue index e995aab0..1c5ab6c0 100644 --- a/stdlib/docker/tests/push-invalid-creds/push.cue +++ b/stdlib/docker/tests/push-invalid-creds/push.cue @@ -10,9 +10,11 @@ TestRegistry: { } TestPush: { + // Generate a random string + // Seed is used to force buildkit execution and not simply use a previous generated string. tag: random.#String & {seed: "docker push and pull should fail"} - name: "daggerio/ci-test:\(tag.out)" + target: "daggerio/ci-test:\(tag.out)" image: #ImageFromDockerfile & { dockerfile: """ @@ -23,8 +25,8 @@ TestPush: { } push: #Push & { - "name": name - source: image + "target": target + source: image auth: { username: TestRegistry.username secret: TestRegistry.secret diff --git a/stdlib/docker/tests/push/push.cue b/stdlib/docker/tests/push/push.cue index 4f2315b4..83d7da71 100644 --- a/stdlib/docker/tests/push/push.cue +++ b/stdlib/docker/tests/push/push.cue @@ -35,9 +35,11 @@ TestRegistry: { } TestPush: { + // Generate a random string + // Seed is used to force buildkit execution and not simply use a previous generated string. tag: random.#String & {seed: "docker push"} - name: "daggerio/ci-test:\(tag.out)" + target: "daggerio/ci-test:\(tag.out)" secret: #TestGetSecret & { secret: TestRegistry.secret @@ -52,8 +54,8 @@ TestPush: { } push: #Push & { - "name": name - source: image + "target": target + source: image auth: { username: TestRegistry.username "secret": secret.out