update e2e tests and yaml files

This commit is contained in:
Di Xu 2017-06-18 17:51:10 +08:00
parent 5c45db564f
commit 6f74af94ef
12 changed files with 22 additions and 1 deletions

View File

@ -130,6 +130,8 @@ func (config *KubeletManagedHostConfig) getEtcHostsContent(podName, containerNam
} }
func (config *KubeletManagedHostConfig) createPodSpec(podName string) *v1.Pod { func (config *KubeletManagedHostConfig) createPodSpec(podName string) *v1.Pod {
hostPathType := new(v1.HostPathType)
*hostPathType = v1.HostPathType(string(v1.HostPathFileOrCreate))
pod := &v1.Pod{ pod := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: podName, Name: podName,
@ -176,6 +178,7 @@ func (config *KubeletManagedHostConfig) createPodSpec(podName string) *v1.Pod {
VolumeSource: v1.VolumeSource{ VolumeSource: v1.VolumeSource{
HostPath: &v1.HostPathVolumeSource{ HostPath: &v1.HostPathVolumeSource{
Path: "/etc/hosts", Path: "/etc/hosts",
Type: hostPathType,
}, },
}, },
}, },

View File

@ -74,6 +74,9 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() {
expectedlogFile := logDir + "/" + logPodName + "_" + ns + "_" + logContName + "-" + logConID.ID + ".log" expectedlogFile := logDir + "/" + logPodName + "_" + ns + "_" + logContName + "-" + logConID.ID + ".log"
hostPathType := new(v1.HostPathType)
*hostPathType = v1.HostPathType(string(v1.HostPathFileOrCreate))
checkPod := &v1.Pod{ checkPod := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: checkPodName, Name: checkPodName,
@ -104,6 +107,7 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() {
VolumeSource: v1.VolumeSource{ VolumeSource: v1.VolumeSource{
HostPath: &v1.HostPathVolumeSource{ HostPath: &v1.HostPathVolumeSource{
Path: expectedlogFile, Path: expectedlogFile,
Type: hostPathType,
}, },
}, },
}, },

View File

@ -161,6 +161,8 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() {
}) })
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
By("Create the node problem detector") By("Create the node problem detector")
hostPathType := new(v1.HostPathType)
*hostPathType = v1.HostPathType(string(v1.HostPathFileOrCreate))
f.PodClient().CreateSync(&v1.Pod{ f.PodClient().CreateSync(&v1.Pod{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: name, Name: name,
@ -186,7 +188,10 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() {
{ {
Name: localtimeVolume, Name: localtimeVolume,
VolumeSource: v1.VolumeSource{ VolumeSource: v1.VolumeSource{
HostPath: &v1.HostPathVolumeSource{Path: etcLocaltime}, HostPath: &v1.HostPathVolumeSource{
Path: etcLocaltime,
Type: hostPathType,
},
}, },
}, },
}, },

View File

@ -63,6 +63,7 @@ spec:
name: srvkube name: srvkube
- hostPath: - hostPath:
path: /var/log/kube-apiserver.log path: /var/log/kube-apiserver.log
type: FileOrCreate
name: logfile name: logfile
- hostPath: - hostPath:
path: /etc/ssl path: /etc/ssl

View File

@ -55,6 +55,7 @@ spec:
name: srvkube name: srvkube
- hostPath: - hostPath:
path: /var/log/kube-controller-manager.log path: /var/log/kube-controller-manager.log
type: FileOrCreate
name: logfile name: logfile
- hostPath: - hostPath:
path: /etc/ssl path: /etc/ssl

View File

@ -27,4 +27,5 @@ spec:
volumes: volumes:
- hostPath: - hostPath:
path: /var/log/kube-scheduler.log path: /var/log/kube-scheduler.log
type: FileOrCreate
name: logfile name: logfile

View File

@ -48,3 +48,4 @@ spec:
- name: varlogetcd - name: varlogetcd
hostPath: hostPath:
path: /var/log/etcd-events.log path: /var/log/etcd-events.log
type: FileOrCreate

View File

@ -47,3 +47,4 @@ spec:
- name: varlogetcd - name: varlogetcd
hostPath: hostPath:
path: /var/log/etcd.log path: /var/log/etcd.log
type: FileOrCreate

View File

@ -31,3 +31,4 @@ spec:
- name: varlog - name: varlog
hostPath: hostPath:
path: /var/log/kube-addon-manager.log path: /var/log/kube-addon-manager.log
type: FileOrCreate

View File

@ -56,6 +56,7 @@ spec:
- name: logfile - name: logfile
hostPath: hostPath:
path: /var/log/kube-apiserver.log path: /var/log/kube-apiserver.log
type: FileOrCreate
- name: etcssl - name: etcssl
hostPath: hostPath:
path: /etc/ssl path: /etc/ssl

View File

@ -45,6 +45,7 @@ spec:
- name: logfile - name: logfile
hostPath: hostPath:
path: /var/log/kube-controller-manager.log path: /var/log/kube-controller-manager.log
type: FileOrCreate
- name: etcssl - name: etcssl
hostPath: hostPath:
path: /etc/ssl path: /etc/ssl

View File

@ -40,3 +40,4 @@ spec:
- name: logfile - name: logfile
hostPath: hostPath:
path: /var/log/kube-scheduler.log path: /var/log/kube-scheduler.log
type: FileOrCreate