Skip to content

Commit c5ece91

Browse files
authored
Merge branch 'master' into pipelinespec
2 parents 3788230 + bcbba97 commit c5ece91

File tree

141 files changed

+2593
-2450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+2593
-2450
lines changed

.github/pull_request_template.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,11 @@ _See [the contribution guide](https://github.com/tektoncd/pipeline/blob/master/C
1919
Double check this list of stuff that's easy to miss:
2020

2121
- If you are adding [a new binary/image to the `cmd` dir](../cmd), please update
22-
[the release Task](../tekton/publish.yaml) and [TaskRun](../tekton/publish-run.yaml) to build and release this image
22+
[the release Task](../tekton/publish.yaml) to build and release this image.
2323

2424
## Reviewer Notes
2525

26-
If [API changes](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md)
27-
are included, [additive changes](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md#additive-changes)
28-
must be approved by at least two [OWNERS](https://github.com/tektoncd/pipeline/blob/master/OWNERS)
29-
and [backwards incompatible changes](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md#backwards-incompatible-changes)
30-
must be approved by [more than 50% of the OWNERS](https://github.com/tektoncd/pipeline/blob/master/OWNERS),
31-
and they must first be added
32-
[in a backwards compatible way](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md#backwards-compatible-changes-first).
26+
If [API changes](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md) are included, [additive changes](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md#additive-changes) must be approved by at least two [OWNERS](https://github.com/tektoncd/pipeline/blob/master/OWNERS) and [backwards incompatible changes](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md#backwards-incompatible-changes) must be approved by [more than 50% of the OWNERS](https://github.com/tektoncd/pipeline/blob/master/OWNERS), and they must first be added [in a backwards compatible way](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md#backwards-compatible-changes-first).
3327

3428
# Release Notes
3529

@@ -41,4 +35,4 @@ Examples of user facing changes:
4135
- Bug fixes
4236
- Any changes in behavior
4337
44-
```
38+
```

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# MacOS file viewer garbage.
2+
.DS_Store
3+
14
# Compiled Object files
25
*.slo
36
*.lo
@@ -39,3 +42,7 @@
3942

4043
# Python
4144
*.pyc
45+
46+
# Release-generated source archives, just in case they get committed
47+
# accidentally.
48+
cmd/*/kodata/source.tar.gz

DEVELOPMENT.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ developing and running Pipelines. The recommended configuration is:
9898
- Node autoscaling, up to 3 nodes
9999
- API scopes for cloud-platform
100100

101+
To setup a cluster with Docker on Desktop:
102+
103+
To use minikube:
104+
```bash
105+
minikube start
106+
eval $(minikube docker-env)
107+
```
108+
109+
To use the Kubernetes that comes with Docker for Desktop:
110+
1. First go into the Docker For Desktop preferences. Under the resource tabs ensure that you have at least 4 CPUs, 8.0 GiB Memory, and 1.0 GiB Swap.
111+
1. Under the Kubernetes tab, enable Kubernetes.
112+
1. Click the Apply and Restart button to save the preferences.
113+
1. Switch the proper `kubectl` config context:
114+
```bash
115+
kubectl config get-contexts
116+
# You should see docker-for-desktop in the previous command output
117+
kubectl config use-context docker-for-desktop
118+
```
101119
To setup a cluster with GKE:
102120

103121
1. [Install required tools and setup GCP project](https://github.com/knative/docs/blob/master/docs/install/Knative-with-GKE.md#before-you-begin)

Gopkg.lock

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Tekton Pipelines are **Typed**:
3434
| Version | Docs | Examples |
3535
| ------- | ---- | -------- |
3636
| [HEAD](DEVELOPMENT.md#install-pipeline) | [Docs @ HEAD](/docs/README.md) | [Examples @ HEAD](/examples) |
37+
| [v0.7.0](https://github.com/tektoncd/pipeline/releases/tag/v0.7.0) | [Docs @ v0.7.0](https://github.com/tektoncd/pipeline/tree/v0.7.0/docs#tekton-pipelines) | [Examples @ v0.7.0](https://github.com/tektoncd/pipeline/tree/v0.7.0/examples#examples) |
3738
| [v0.6.0](https://github.com/tektoncd/pipeline/releases/tag/v0.6.0) | [Docs @ v0.6.0](https://github.com/tektoncd/pipeline/tree/release-v0.6.x/docs#tekton-pipelines) | [Examples @ v0.6.0](https://github.com/tektoncd/pipeline/tree/v0.6.0/examples#examples) |
3839
| [v0.5.2](https://github.com/tektoncd/pipeline/releases/tag/v0.5.2) | [Docs @ v0.5.2](https://github.com/tektoncd/pipeline/tree/v0.5.2/docs#tekton-pipelines) | [Examples @ v0.5.2](https://github.com/tektoncd/pipeline/tree/v0.5.2/examples#examples) |
3940
| [v0.5.1](https://github.com/tektoncd/pipeline/releases/tag/v0.5.1) | [Docs @ v0.5.1](https://github.com/tektoncd/pipeline/tree/v0.5.1/docs#tekton-pipelines) | [Examples @ v0.5.1](https://github.com/tektoncd/pipeline/tree/v0.5.1/examples#examples) |

api_compatibility_policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ Backwards incompatible changes change the API, e.g. by removing fields from a CR
7272
spec. These changes will mean that folks using a previous version of the API will need
7373
to adjust their usage in order to use the new version.
7474

75-
These changes must be make [in a backwards compatible manner first](#backwards-compatible-changes-first),
76-
and they must be improved by [more than half of the project OWNERS](OWNERS)
75+
These changes must be made [in a backwards compatible manner first](#backwards-compatible-changes-first),
76+
and the changes must be approved by [more than half of the project OWNERS](OWNERS)
7777
(i.e. 50% + 1).

cmd/bash/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ package main
4242

4343
import (
4444
"flag"
45-
"log"
4645
"os/exec"
46+
"strings"
4747

4848
"github.com/tektoncd/pipeline/pkg/logging"
4949
)
@@ -59,8 +59,7 @@ func main() {
5959
cmd := exec.Command("sh", "-c", *args)
6060
stdoutStderr, err := cmd.CombinedOutput()
6161
if err != nil {
62-
logger.Errorf("Error executing command %q with arguments %s", *args, stdoutStderr)
63-
log.Fatal(err)
62+
logger.Fatalf("Error executing command %q ; error %s; cmd_output %s", strings.Join(cmd.Args, " "), err.Error(), stdoutStderr)
6463
}
65-
logger.Infof("Successfully executed command %q", *args)
64+
logger.Infof("Successfully executed command %q; output %s", strings.Join(cmd.Args, " "), stdoutStderr)
6665
}

cmd/creds-init/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ git credential [`.git-credentials`]() file (with `-basic-git` flag).
1414

1515
### `-ssh-git`
1616

17-
This uses the `ssh-privatekey` and `know_hosts` keys of the secret to generate:
17+
This uses the `ssh-privatekey` and `known_hosts` keys of the secret to generate:
1818
- a `~/.ssh/id_{secret}` private key
1919
- a `~/.ssh/config` file
20-
- a `~/.ssh/known hosts`
20+
- a `~/.ssh/known_hosts`
2121

2222
With a `Secret` that looks like:
2323

@@ -46,7 +46,7 @@ The flag `-ssh-git=ssh-key=github.com` (with the environment variable
4646
Port 22
4747
```
4848
- `~/.ssh/id_rsa` with the content of `ssh-privatekey` decoded
49-
- `~/.ssh/known_hosts` with the content of `ssh-privatekey` decoded
49+
- `~/.ssh/known_hosts` with the content of `known_hosts` decoded
5050

5151

5252
### `-basic-git`
@@ -143,7 +143,7 @@ This uses the `config.json` key from a secret of type
143143
`kubernetes.io/dockerconfigjson` to populate the generated docker's
144144
`config.json` file.
145145

146-
### `-dokcer-cfg`
146+
### `-docker-cfg`
147147

148148
This uses the `.dockercfg` key from a secret of type
149149
`kubernetes.io/dockercfg` to populate the generated docker's

cmd/imagedigestexporter/digest.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package main
2+
3+
import (
4+
v1 "github.com/google/go-containerregistry/pkg/v1"
5+
)
6+
7+
// GetDigest returns the digest of an OCI image index. If there is only one image in the index, the
8+
// digest of the image is returned; otherwise, the digest of the whole index is returned.
9+
func GetDigest(ii v1.ImageIndex) (v1.Hash, error) {
10+
im, err := ii.IndexManifest()
11+
if err != nil {
12+
return v1.Hash{}, err
13+
}
14+
if len(im.Manifests) == 1 {
15+
return im.Manifests[0].Digest, nil
16+
}
17+
return ii.Digest()
18+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package main
2+
3+
import (
4+
"testing"
5+
6+
"github.com/google/go-cmp/cmp"
7+
v1 "github.com/google/go-containerregistry/pkg/v1"
8+
"github.com/google/go-containerregistry/pkg/v1/empty"
9+
"github.com/google/go-containerregistry/pkg/v1/random"
10+
)
11+
12+
func TestGetDigest(t *testing.T) {
13+
mustGetIndex := func(ii v1.ImageIndex, err error) v1.ImageIndex {
14+
if err != nil {
15+
t.Fatalf("must get image: %s", err)
16+
}
17+
return ii
18+
}
19+
mustGetManifest := func(im *v1.IndexManifest, err error) *v1.IndexManifest {
20+
if err != nil {
21+
t.Fatalf("must get manifest: %s", err)
22+
}
23+
return im
24+
}
25+
mustGetDigest := func(h v1.Hash, err error) v1.Hash {
26+
if err != nil {
27+
t.Fatalf("must get digest: %s", err)
28+
}
29+
return h
30+
}
31+
indexSingleImage := mustGetIndex(random.Index(1024, 4, 1))
32+
indexMultipleImages := mustGetIndex(random.Index(1024, 4, 4))
33+
tests := []struct {
34+
name string
35+
index v1.ImageIndex
36+
expected v1.Hash
37+
}{
38+
{
39+
name: "empty index",
40+
index: empty.Index,
41+
expected: mustGetDigest(empty.Index.Digest()),
42+
},
43+
{
44+
name: "index with single image",
45+
index: indexSingleImage,
46+
expected: mustGetManifest(indexSingleImage.IndexManifest()).Manifests[0].Digest,
47+
},
48+
{
49+
name: "index with multiple images",
50+
index: indexMultipleImages,
51+
expected: mustGetDigest(indexMultipleImages.Digest()),
52+
},
53+
}
54+
for _, test := range tests {
55+
t.Run(test.name, func(t *testing.T) {
56+
digest, err := GetDigest(test.index)
57+
if err != nil {
58+
t.Fatalf("cannot get digest: %s", err)
59+
}
60+
if diff := cmp.Diff(digest, test.expected); diff != "" {
61+
t.Errorf("get digest: -want +got: %s", diff)
62+
}
63+
})
64+
}
65+
}

0 commit comments

Comments
 (0)