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

Replace google/cloud-sdk with GCR equivalent. #3280

Merged
merged 1 commit into from
Sep 23, 2020
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
4 changes: 2 additions & 2 deletions config/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ spec:
"-pr-image", "ko://github.com/tektoncd/pipeline/cmd/pullrequest-init",
"-build-gcs-fetcher-image", "ko://github.com/tektoncd/pipeline/vendor/github.com/GoogleCloudPlatform/cloud-builders/gcs-fetcher/cmd/gcs-fetcher",

# This is google/cloud-sdk:302.0.0-slim
"-gsutil-image", "google/cloud-sdk@sha256:27b2c22bf259d9bc1a291e99c63791ba0c27a04d2db0a43241ba0f1f20f4067f",
# This is gcr.io/google.com/cloudsdktool/cloud-sdk:302.0.0-slim
"-gsutil-image", "gcr.io/google.com/cloudsdktool/cloud-sdk@sha256:27b2c22bf259d9bc1a291e99c63791ba0c27a04d2db0a43241ba0f1f20f4067f",
# The shell image must be root in order to create directories and copy files to PVCs.
# gcr.io/distroless/base:debug-nonroot as of July 23, 2020
"-shell-image", "gcr.io/distroless/base@sha256:60f5ffe6fc481e9102747b043b3873a01893a5a8138f970c5f5fc06fb7494656"
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/resource/v1alpha1/storage/artifact_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var (
SecretKey: "serviceaccount",
}},
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
}
)

Expand All @@ -56,7 +56,7 @@ func TestBucketGetCopyFromContainerSpec(t *testing.T) {
Command: []string{"mkdir", "-p", "/workspace/destination"},
}}, {Container: corev1.Container{
Name: "artifact-copy-from-workspace-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "-P", "-r", "gs://fake-bucket/src-path/*", "/workspace/destination"},
Env: []corev1.EnvVar{{Name: "GOOGLE_APPLICATION_CREDENTIALS", Value: fmt.Sprintf("/var/bucketsecret/%s/serviceaccount", secretName)}},
Expand All @@ -73,7 +73,7 @@ func TestBucketGetCopyToContainerSpec(t *testing.T) {
names.TestingSeed()
want := []v1alpha1.Step{{Container: corev1.Container{
Name: "artifact-copy-to-workspace-9l9zj",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "-P", "-r", "src-path", "gs://fake-bucket/workspace/destination"},
Env: []corev1.EnvVar{{Name: "GOOGLE_APPLICATION_CREDENTIALS", Value: fmt.Sprintf("/var/bucketsecret/%s/serviceaccount", secretName)}},
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/resource/v1alpha1/storage/build_gcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var images = pipeline.Images{
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
BuildGCSFetcherImage: "gcr.io/cloud-builders/gcs-fetcher:latest",
PRImage: "override-with-pr:latest",
ImageDigestExporterImage: "override-with-imagedigest-exporter-image:latest",
Expand Down
22 changes: 11 additions & 11 deletions pkg/apis/resource/v1alpha1/storage/gcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestValidNewGCSResource(t *testing.T) {
FieldName: "GOOGLE_APPLICATION_CREDENTIALS",
}},
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
}

gcsRes, err := storage.NewGCSResource("test-resource", images, pr)
Expand Down Expand Up @@ -167,7 +167,7 @@ func TestGetInputSteps(t *testing.T) {
SecretKey: "key.json",
}},
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
wantSteps: []v1beta1.Step{{Container: corev1.Container{
Name: "create-dir-gcs-valid-9l9zj",
Expand All @@ -183,7 +183,7 @@ gsutil rsync -d -r gs://some-bucket /workspace
`,
Container: corev1.Container{
Name: "fetch-gcs-valid-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Env: []corev1.EnvVar{{
Name: "GOOGLE_APPLICATION_CREDENTIALS",
Value: "/var/secret/secretName/key.json",
Expand All @@ -209,7 +209,7 @@ gsutil rsync -d -r gs://some-bucket /workspace
FieldName: "GOOGLE_APPLICATION_CREDENTIALS",
}},
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
wantSteps: []v1beta1.Step{{Container: corev1.Container{
Name: "create-dir-gcs-valid-mssqb",
Expand All @@ -225,7 +225,7 @@ gsutil cp gs://some-bucket /workspace
`,
Container: corev1.Container{
Name: "fetch-gcs-valid-78c5n",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Env: []corev1.EnvVar{{
Name: "GOOGLE_APPLICATION_CREDENTIALS",
Value: "/var/secret/secretName/key.json",
Expand Down Expand Up @@ -269,11 +269,11 @@ func TestGetOutputTaskModifier(t *testing.T) {
FieldName: "GOOGLE_APPLICATION_CREDENTIALS",
SecretKey: "key.json",
}},
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
wantSteps: []v1beta1.Step{{Container: corev1.Container{
Name: "upload-gcs-valid-9l9zj",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"rsync", "-d", "-r", "/workspace/", "gs://some-bucket"},
Env: []corev1.EnvVar{{Name: "GOOGLE_APPLICATION_CREDENTIALS", Value: "/var/secret/secretName/key.json"}},
Expand All @@ -296,11 +296,11 @@ func TestGetOutputTaskModifier(t *testing.T) {
SecretName: "secretName",
FieldName: "GOOGLE_APPLICATION_CREDENTIALS",
}},
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
wantSteps: []v1beta1.Step{{Container: corev1.Container{
Name: "upload-gcs-valid-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "/workspace/*", "gs://some-bucket"},
Env: []corev1.EnvVar{
Expand All @@ -317,11 +317,11 @@ func TestGetOutputTaskModifier(t *testing.T) {
Name: "gcs-valid",
Location: "gs://some-bucket",
TypeDir: false,
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
wantSteps: []v1beta1.Step{{Container: corev1.Container{
Name: "upload-gcs-valid-mssqb",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "/workspace/*", "gs://some-bucket"},
}}},
Expand Down
10 changes: 5 additions & 5 deletions pkg/artifacts/artifact_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var (
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
BuildGCSFetcherImage: "gcr.io/cloud-builders/gcs-fetcher:latest",
PRImage: "override-with-pr:latest",
ImageDigestExporterImage: "override-with-imagedigest-exporter-image:latest",
Expand Down Expand Up @@ -211,7 +211,7 @@ func TestInitializeArtifactStorage(t *testing.T) {
SecretName: "secret1",
}},
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
}, {
desc: "location empty",
Expand Down Expand Up @@ -256,7 +256,7 @@ func TestInitializeArtifactStorage(t *testing.T) {
expectedArtifactStorage: &storage.ArtifactBucket{
Location: "gs://fake-bucket",
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
}, {
desc: "valid bucket with boto config",
Expand All @@ -270,7 +270,7 @@ func TestInitializeArtifactStorage(t *testing.T) {
expectedArtifactStorage: &storage.ArtifactBucket{
Location: "s3://fake-bucket",
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Secrets: []resourcev1alpha1.SecretParam{{
FieldName: "BOTO_CONFIG",
SecretKey: "sakey",
Expand Down Expand Up @@ -524,7 +524,7 @@ func TestGetArtifactStorageWithConfig(t *testing.T) {
SecretName: "secret1",
}},
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
}, {
desc: "location empty",
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var (
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
BuildGCSFetcherImage: "gcr.io/cloud-builders/gcs-fetcher:latest",
PRImage: "override-with-pr:latest",
ImageDigestExporterImage: "override-with-imagedigest-exporter-image:latest",
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/taskrun/resources/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer-image:latest",
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
BuildGCSFetcherImage: "gcr.io/cloud-tbs/gcs-fetcher:latest",
PRImage: "override-with-pr:latest",
ImageDigestExporterImage: "override-with-imagedigest-exporter-image:latest",
Expand Down
16 changes: 8 additions & 8 deletions pkg/reconciler/taskrun/resources/input_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var (
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
BuildGCSFetcherImage: "gcr.io/cloud-builders/gcs-fetcher:latest",
PRImage: "override-with-pr:latest",
ImageDigestExporterImage: "override-with-imagedigest-exporter-image:latest",
Expand Down Expand Up @@ -683,7 +683,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir
`,
Container: corev1.Container{
Name: "fetch-storage1-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
}},
Resources: &v1beta1.TaskResources{
Expand Down Expand Up @@ -1075,7 +1075,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-input-resource
`,
Container: corev1.Container{
Name: "fetch-gcs-input-resource-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
},
}},
Resources: &v1beta1.TaskResources{
Expand Down Expand Up @@ -1145,7 +1145,7 @@ gsutil rsync -d -r gs://fake-bucket/rules.zip /workspace/gcs-input-resource
`,
Container: corev1.Container{
Name: "fetch-storage-gcs-keys-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
VolumeMounts: []corev1.VolumeMount{
{Name: "volume-storage-gcs-keys-secret-name", MountPath: "/var/secret/secret-name"},
},
Expand Down Expand Up @@ -1300,7 +1300,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) {
Command: []string{"mkdir", "-p", "/workspace/gitspace"},
}}, {Container: corev1.Container{
Name: "artifact-copy-from-gitspace-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "-P", "-r", "gs://fake-bucket/prev-task-path/*", "/workspace/gitspace"},
Env: gcsEnv,
Expand Down Expand Up @@ -1344,7 +1344,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) {
Command: []string{"mkdir", "-p", "/workspace/gcs-dir"},
}}, {Container: corev1.Container{
Name: "artifact-copy-from-workspace-78c5n",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "-P", "-r", "gs://fake-bucket/prev-task-path/*", "/workspace/gcs-dir"},
Env: gcsEnv,
Expand Down Expand Up @@ -1396,7 +1396,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) {
Command: []string{"mkdir", "-p", "/workspace/gcs-dir"},
}}, {Container: corev1.Container{
Name: "artifact-copy-from-workspace-l22wn",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "-P", "-r", "gs://fake-bucket/prev-task-path/*", "/workspace/gcs-dir"},
Env: gcsEnv,
Expand All @@ -1407,7 +1407,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) {
Command: []string{"mkdir", "-p", "/workspace/gcs-dir"},
}}, {Container: corev1.Container{
Name: "artifact-copy-from-workspace2-j2tds",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "-P", "-r", "gs://fake-bucket/prev-task-path2/*", "/workspace/gcs-dir"},
Env: gcsEnv,
Expand Down
26 changes: 13 additions & 13 deletions pkg/reconciler/taskrun/resources/output_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ func TestValidOutputResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "upload-source-gcs-78c5n",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
VolumeMounts: []corev1.VolumeMount{{
Name: "volume-source-gcs-sname",
MountPath: "/var/secret/sname",
Expand Down Expand Up @@ -576,7 +576,7 @@ func TestValidOutputResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "upload-source-gcs-78c5n",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
VolumeMounts: []corev1.VolumeMount{{
Name: "volume-source-gcs-sname", MountPath: "/var/secret/sname",
}},
Expand Down Expand Up @@ -647,7 +647,7 @@ func TestValidOutputResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "upload-source-gcs-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
VolumeMounts: []corev1.VolumeMount{{
Name: "volume-source-gcs-sname", MountPath: "/var/secret/sname",
}},
Expand Down Expand Up @@ -708,7 +708,7 @@ func TestValidOutputResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "upload-source-gcs-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
VolumeMounts: []corev1.VolumeMount{{
Name: "volume-source-gcs-sname", MountPath: "/var/secret/sname",
}},
Expand Down Expand Up @@ -1000,7 +1000,7 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) {
Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"},
}}, {Container: corev1.Container{
Name: "artifact-copy-to-source-git-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "-P", "-r", "/workspace/output/source-workspace", "gs://fake-bucket/pipeline-task-name"},
}}},
Expand Down Expand Up @@ -1051,7 +1051,7 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) {
Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"},
}}, {Container: corev1.Container{
Name: "artifact-copy-to-source-git-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "-P", "-r", "/workspace/output/source-workspace", "gs://fake-bucket/pipeline-task-name"},
}}},
Expand Down Expand Up @@ -1448,7 +1448,7 @@ func TestInputOutputBucketResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "artifact-copy-from-source-workspace-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{
"cp",
Expand All @@ -1467,7 +1467,7 @@ func TestInputOutputBucketResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "upload-source-gcs-bucket-78c5n",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
VolumeMounts: nil,
Command: []string{"gsutil"},
Args: []string{"rsync", "-d", "-r", "/workspace/output/source-workspace", "gs://some-bucket"},
Expand Down Expand Up @@ -1562,7 +1562,7 @@ func TestInputOutputBucketResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "artifact-copy-from-source-workspace-78c5n",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{
"cp",
Expand All @@ -1588,7 +1588,7 @@ func TestInputOutputBucketResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "artifact-copy-from-source-workspace-2-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"cp", "-P", "-r", "gs://fake-bucket/pipeline-task-path-2/*", "/workspace/faraway-disk-2"},
Env: []corev1.EnvVar{
Expand All @@ -1600,7 +1600,7 @@ func TestInputOutputBucketResources(t *testing.T) {
VolumeMounts: []corev1.VolumeMount{{Name: "volume-bucket-sname", MountPath: "/var/bucketsecret/sname"}},
}}, {Container: corev1.Container{
Name: "upload-source-gcs-bucket-3-j2tds",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{"rsync", "-d", "-r", "/workspace/output/source-workspace-3", "gs://some-bucket-3"},
}},
Expand Down Expand Up @@ -1677,7 +1677,7 @@ func TestInputOutputBucketResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "upload-source-gcs-bucket-mz4c7",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
Command: []string{"gsutil"},
Args: []string{
"rsync",
Expand All @@ -1689,7 +1689,7 @@ func TestInputOutputBucketResources(t *testing.T) {
}},
{Container: corev1.Container{
Name: "upload-source-gcs-bucket-2-78c5n",
Image: "google/cloud-sdk",
Image: "gcr.io/google.com/cloudsdktool/cloud-sdk",
VolumeMounts: nil,
Command: []string{"gsutil"},
Args: []string{"rsync", "-d", "-r", "/workspace/output/source-workspace-2", "gs://some-bucket-2"},
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/taskrun/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var (
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
ShellImage: "busybox",
GsutilImage: "google/cloud-sdk",
GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk",
BuildGCSFetcherImage: "gcr.io/cloud-builders/gcs-fetcher:latest",
PRImage: "override-with-pr:latest",
ImageDigestExporterImage: "override-with-imagedigest-exporter-image:latest",
Expand Down
Loading