Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Docs for Image Resources #6263

Merged
merged 1 commit into from
Mar 1, 2023
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
88 changes: 0 additions & 88 deletions docs/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ For example:
- [Optional Resources](#optional-resources)
- [Resource types](#resource-types)
- [Git Resource](#git-resource)
- [Image Resource](#image-resource)
- [Storage Resource](#storage-resource)
- [GCS Storage Resource](#gcs-storage-resource)
- [Why Aren't PipelineResources in Beta?](#why-aren-t-pipelineresources-in-beta)
Expand Down Expand Up @@ -454,93 +453,6 @@ spec:
```

Note: `httpProxy`, `httpsProxy`, and `noProxy` are all optional but no validation done if all three are specified.

### Image Resource

An `image` resource represents an image that lives in a remote repository. It is
usually used as [a `Task` `output`](tasks.md#outputs) for `Tasks` that build
images. This allows the same `Tasks` to be used to generically push to any
registry.

Params that can be added are the following:

1. `url`: The complete path to the image, including the registry and the image
tag
1. `digest`: The
[image digest](https://success.docker.com/article/images-tagging-vs-digests)
which uniquely identifies a particular build of an image with a particular
tag. _While this can be provided as a parameter, there is not yet a way to
update this value after an image is built, but this is planned in
[#216](https://github.com/tektoncd/pipeline/issues/216)._

For example:

```yaml
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: kritis-resources-image
namespace: default
spec:
type: image
params:
- name: url
value: gcr.io/staging-images/kritis
```

#### Surfacing the image digest built in a task

To surface the image digest in the output of the `taskRun` the builder tool
should produce this information in a
[OCI Image Layout](https://github.com/opencontainers/image-spec/blob/master/image-layout.md)
`index.json` file. This file should be placed on a location as specified in the
task definition under the default resource directory, or the specified
`targetPath`. If there is only one image in the `index.json` file, the digest of
that image is exported; otherwise, the digest of the whole image index would be
exported. For example this build-push task defines the `outputImageDir` for the
`builtImage` resource in `/workspace/buildImage`

```yaml
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-push
spec:
resources:
inputs:
- name: workspace
type: git
outputs:
- name: builtImage
type: image
targetPath: /workspace/builtImage
steps: ...
```

If no value is specified for `targetPath`, it will default to
`/workspace/output/{resource-name}`.

_Please check the builder tool used on how to pass this path to create the
output file._

The `taskRun` will include the image digest and URL in the `resourcesResult` field that
is part of the `taskRun.Status`

for example:

```yaml
status:
# ...
resourcesResult:
- key: "digest"
value: "sha256:eed29cd0b6feeb1a92bc3c4f977fd203c63b376a638731c88cacefe3adb1c660"
resourceName: skaffold-image-leeroy-web
# ...
```

If the `index.json` file is not produced, the image digest will not be included
in the `taskRun` output.

### Storage Resource

The `storage` resource represents blob storage, that contains either an object
Expand Down
9 changes: 0 additions & 9 deletions docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,6 @@ variable via `resources.inputs.<resourceName>.<variableName>` or
| `httpsProxy` | The value of the resource's `httpsProxy` parameter. |
| `noProxy` | The value of the resource's `noProxy` parameter. |

#### Variables for the `Image` type

| Variable | Description |
| -------- | ----------- |
| `name` | The name of the resource. |
| `type` | Type value of `"image"`. |
| `url` | The complete path to the image. |
| `digest` | The digest of the image. |

#### Variables for the `GCS` type

| Variable | Description |
Expand Down