Commit 6f74af94 authored by Di Xu's avatar Di Xu

update e2e tests and yaml files

parent 5c45db56
...@@ -130,6 +130,8 @@ func (config *KubeletManagedHostConfig) getEtcHostsContent(podName, containerNam ...@@ -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 { ...@@ -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,
}, },
}, },
}, },
......
...@@ -74,6 +74,9 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() { ...@@ -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() { ...@@ -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,
}, },
}, },
}, },
......
...@@ -161,6 +161,8 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() { ...@@ -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() { ...@@ -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,
},
}, },
}, },
}, },
......
...@@ -63,6 +63,7 @@ spec: ...@@ -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
......
...@@ -55,6 +55,7 @@ spec: ...@@ -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
......
...@@ -27,4 +27,5 @@ spec: ...@@ -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
...@@ -48,3 +48,4 @@ spec: ...@@ -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
...@@ -47,3 +47,4 @@ spec: ...@@ -47,3 +47,4 @@ spec:
- name: varlogetcd - name: varlogetcd
hostPath: hostPath:
path: /var/log/etcd.log path: /var/log/etcd.log
type: FileOrCreate
...@@ -31,3 +31,4 @@ spec: ...@@ -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
...@@ -56,6 +56,7 @@ spec: ...@@ -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
......
...@@ -45,6 +45,7 @@ spec: ...@@ -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
......
...@@ -40,3 +40,4 @@ spec: ...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment