GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders-community

[kustomize] the installed binary is not in PATH.

Open
#514 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.3k
Forks
848
PR merge metrics
No merged PRs in 30d

Description

Instead of the given _KUSTOMIZE_VERSION, the working version is from gcr.io/cloud-builders/gcloud.

## Affected builder image

`gcr.io/cloud-builders-community/kustomize`

## Expected Behavior

kustomize works with the version in `_KUSTOMIZE_VERSION`.

## Actual Behavior

kustomize works v3.6.1 which from the base image google-cloud-sdk.

## Steps to Reproduce the Problem

1. Build a image following the [README](./kustomize/README.md).

```sh
$ cd kustomize
$ gcloud builds submit . --config=cloudbuild.yaml --substitutions=_KUSTOMIZE_VERSION=v4.1.3
Creating temporary tarball archive of 6 file(s) totalling 6.2 KiB before compression.
...
Starting Step #1
Step #1: Already have image: gcr.io/pokutuna-playground/kustomize:latest
Step #1: {Version:v3.6.1 GitCommit:a0072a2cf92bf5399565e84c621e1e7c5c1f1094 BuildDate:2020-06-15T20:19:11Z GoOs:linux GoArch:amd64}
Finished Step #1
PUSH
```

2. Build with this cloudbuild.yaml

```yaml
steps:
- name: 'gcr.io/$PROJECT_ID/kustomize:v4.1.3'
entrypoint: bash
args:
- '-c'
- 'which kustomize'
- name: 'gcr.io/$PROJECT_ID/kustomize:v4.1.3'
args:
- 'version'
env:
- CLOUDSDK_COMPUTE_ZONE=asia-northeast1
- CLOUDSDK_CONTAINER_CLUSTER=prd
```

output
```
Starting Step #0
Step #0: Pulling image: gcr.io/pokutuna-playground/kustomize:v4.1.3
...
Step #0: gcr.io/pokutuna-playground/kustomize:v4.1.3
Step #0: /builder/google-cloud-sdk/bin//kustomize # this line is from `which kustomize`
Finished Step #0
Starting Step #1
Step #1: Already have image (with digest): gcr.io/pokutuna-playground/kustomize:v4.1.3
Step #1: Running: gcloud container clusters get-credentials --project="pokutuna-playground" --zone="asia-northeast1" "dev"
Step #1: Fetching cluster endpoint and auth data.
Step #1: kubeconfig entry generated for dev.
Step #1: {Version:v3.6.1 GitCommit:a0072a2cf92bf5399565e84c621e1e7c5c1f1094 BuildDate:2020-06-15T20:19:11Z GoOs:linux GoArch:amd64}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.