Skip to content

Commit

Permalink
update the default location of output images
Browse files Browse the repository at this point in the history
- fix some docs and comments
  • Loading branch information
nader-ziada committed May 16, 2019
1 parent 9f34452 commit ba45ca6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion cmd/imagedigestexporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (

"github.com/google/go-containerregistry/pkg/v1/layout"
v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)

var (
Expand Down
7 changes: 7 additions & 0 deletions docs/developers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,10 @@ with the binary and file(s) is mounted.

If the image is a private registry, the service account should include an
[ImagePullSecret](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#add-imagepullsecrets-to-a-service-account)

## Builder namespace on containers

The `/builder/` namespace is reserved on containers for various system tools, such as the following:

- The environment variable HOME is set to `/builder/home`, used by the builder tools and injected on into all of the step containers
- Default location for output-images `/builder/output-images`
2 changes: 1 addition & 1 deletion docs/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ spec:
outputImageDir: /workspace/builtImage
steps: ...
```
If no value is specified for `outputImageDir`, it will default to `/tools/image-outputs/{resource-name}`.
If no value is specified for `outputImageDir`, it will default to `/builder/image-outputs/{resource-name}`.

*Please check the builder tool used on how to pass this path to create the output file.*

Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/pipeline/v1alpha1/image_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ func (s *ImageResource) GetOutputImageDir() string {
}

func (s ImageResource) String() string {
// the String() func works as a toString func to return the contents as a string
// and has to follow the interface and therefore cannot return an error
// the String() func implements the Stringer interface, and therefore
// cannot return an error
// if the Marshal func gives an error, the returned string will be empty
json, _ := json.Marshal(s)
return string(json)
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1alpha1/task_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (ts *TaskSpec) SetDefaults(ctx context.Context) {
for i, o := range ts.Outputs.Resources {
if o.Type == PipelineResourceTypeImage {
if o.OutputImageDir == "" {
ts.Outputs.Resources[i].OutputImageDir = fmt.Sprintf("/tools/image-outputs/%s", o.Name)
ts.Outputs.Resources[i].OutputImageDir = fmt.Sprintf("/builder/image-outputs/%s", o.Name)
}
}
}
Expand Down

0 comments on commit ba45ca6

Please sign in to comment.