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

Mark Downward API VolumeMount as readonly. #4236

Merged
merged 1 commit into from
Sep 21, 2021
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
3 changes: 3 additions & 0 deletions pkg/pod/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ var (
downwardMount = corev1.VolumeMount{
Name: downwardVolumeName,
MountPath: downwardMountPoint,
// Marking this volume mount readonly is technically redundant,
// since the volume itself is readonly, but including for completeness.
ReadOnly: true,
}
)

Expand Down
26 changes: 13 additions & 13 deletions pkg/reconciler/taskrun/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ func TestReconcile_ExplicitDefaultSA(t *testing.T) {
),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -564,7 +564,7 @@ func TestReconcile_ExplicitDefaultSA(t *testing.T) {
),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -704,7 +704,7 @@ func TestReconcile_FeatureFlags(t *testing.T) {
tb.EnvVar("foo", "bar"),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -755,7 +755,7 @@ func TestReconcile_FeatureFlags(t *testing.T) {
),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -1111,7 +1111,7 @@ func TestReconcile(t *testing.T) {
),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -1164,7 +1164,7 @@ func TestReconcile(t *testing.T) {
),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -1246,7 +1246,7 @@ func TestReconcile(t *testing.T) {
"/workspace/output/myimage"),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -1416,7 +1416,7 @@ func TestReconcile(t *testing.T) {
tb.WorkingDir("/workspace"),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -1493,7 +1493,7 @@ func TestReconcile(t *testing.T) {
),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -1556,7 +1556,7 @@ func TestReconcile(t *testing.T) {
tb.WorkingDir("/workspace"),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -1631,7 +1631,7 @@ func TestReconcile(t *testing.T) {
"--"),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -1683,7 +1683,7 @@ func TestReconcile(t *testing.T) {
"--"),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down Expand Up @@ -1736,7 +1736,7 @@ func TestReconcile(t *testing.T) {
),
tb.VolumeMount("tekton-internal-bin", "/tekton/bin", tb.VolumeMountRO),
tb.VolumeMount("tekton-internal-run", "/tekton/run"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward"),
tb.VolumeMount("tekton-internal-downward", "/tekton/downward", tb.VolumeMountRO),
tb.VolumeMount("tekton-creds-init-home-0", "/tekton/creds"),
tb.VolumeMount("tekton-internal-workspace", workspaceDir),
tb.VolumeMount("tekton-internal-home", "/tekton/home"),
Expand Down