-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
core v1: deprecate the gitRepo volume type #63445
core v1: deprecate the gitRepo volume type #63445
Conversation
5d912f9
to
b493c9e
Compare
cc @kubernetes/sig-storage-pr-reviews |
/lgtm |
as much as I'd be happy to see this deprecated/removed, just dropping the field from v1 would fall outside of kube deprecation policies. in additional to deciding if this is an acceptable deviation (@kubernetes/sig-storage-api-reviews @kubernetes/api-approvers), and documenting why, we should think through how this removal would actually be accomplished without breaking existing data (simply dropping the field would leave previously valid objects as invalid pod templates with volumes with no source) |
Sent a docs only PR for the meantime kubernetes/website#8429 |
What do you think about at least marking this as deprecated in 1.11, even if it takes a long time to get it removed? |
@tallclair I still have a PR open to strike it from the docs. kubernetes/website#8429 I think that's good enough. |
This will also need an "action required" release note. |
/test pull-kubernetes-kubemark-e2e-gce-big |
/retest |
/test pull-kubernetes-kubemark-e2e-gce-big |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ericchiang, liggitt, msau42 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process Pull Request Labels
|
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue (batch tested with PRs 63445, 63820). If you want to cherry-pick this change to another branch, please follow the instructions here. |
@ericchiang: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
fwiw in @ericchiang example at the top, |
Typo fixed: apiVersion: v1
kind: ConfigMap
metadata:
name: git-clone
data:
git-clone.sh: |
#!/bin/sh -e
REPO=$1
REF=$2
DIR=$3
# Init Containers will re-run on Pod restart. Remove the directory's contents
# and reprovision when this happens.
if [ -d "$DIR" ]; then
rm -rf $( find $DIR -mindepth 1 )
fi
git clone $REPO $DIR
cd $DIR
git reset --hard $REF
---
apiVersion: v1
kind: Pod
metadata:
name: server
spec:
initContainers:
- name: git-clone
image: alpine/git # Any image with git will do
command:
- /usr/local/git/git-clone.sh
args:
- "https://somewhere/me/my-git-repository.git"
- "22f1d8406d464b0c0874075539c1f2e96c253775"
- "/repo"
volumeMounts:
- name: git-clone
mountPath: /usr/local/git
- name: git-repo
mountPath: /repo
containers:
- image: nginx
name: nginx
volumeMounts:
- mountPath: /mypath/to/my/repo
name: git-repo
volumes:
- name: git-repo
emptyDir: {}
- name: git-clone
configMap:
name: git-clone
defaultMode: 0755 |
gitRepo stopped accepting new features nearly 2 years ago #17676 (comment) and today this behavior can easily be achieved through an init container. The kubelet shelling out to git in the host namespace can also be a security issue on un-trusted repos, as was demonstrated by CVE-2017-1000117. Our own documentation even alludes to this volume type being removed in the future:
https://kubernetes.io/docs/concepts/storage/volumes/#gitrepo
Edit: CVE 2018-11235 which also impacts this volume type was announced while this PR was open.
Closes #60999
/release-note-action-required
Instead of this:
Do this: