Skip to content

Commit

Permalink
Merge pull request #167 from kajinamit/hostpath
Browse files Browse the repository at this point in the history
Remove HostPath volume mounts
  • Loading branch information
openshift-merge-robot authored Jun 23, 2023
2 parents efd4186 + 4b08c49 commit 9899c31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
26 changes: 0 additions & 26 deletions pkg/neutronapi/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,6 @@ func GetAPIVolumes(name string, extraVol []neutronv1beta1.NeutronExtraVolMounts,
var config0640AccessMode int32 = 0640

res := []corev1.Volume{
{
Name: "etc-machine-id",
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/etc/machine-id",
},
},
},
{
Name: "etc-localtime",
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/etc/localtime",
},
},
},
{
Name: "scripts",
VolumeSource: corev1.VolumeSource{
Expand Down Expand Up @@ -99,16 +83,6 @@ func GetAPIVolumes(name string, extraVol []neutronv1beta1.NeutronExtraVolMounts,
// GetAPIVolumeMounts - Neutron API VolumeMounts
func GetAPIVolumeMounts(extraVol []neutronv1beta1.NeutronExtraVolMounts, svc []storage.PropagationType) []corev1.VolumeMount {
res := []corev1.VolumeMount{
{
Name: "etc-machine-id",
MountPath: "/etc/machine-id",
ReadOnly: true,
},
{
Name: "etc-localtime",
MountPath: "/etc/localtime",
ReadOnly: true,
},
{
Name: "scripts",
MountPath: "/usr/local/bin/container-scripts",
Expand Down
4 changes: 2 additions & 2 deletions test/functional/neutronapi_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,13 @@ var _ = Describe("NeutronAPI controller", func() {
},
)
Expect(int(*deployment.Spec.Replicas)).To(Equal(1))
Expect(deployment.Spec.Template.Spec.Volumes).To(HaveLen(5))
Expect(deployment.Spec.Template.Spec.Volumes).To(HaveLen(3))
Expect(deployment.Spec.Template.Spec.Containers).To(HaveLen(1))

container := deployment.Spec.Template.Spec.Containers[0]
Expect(container.LivenessProbe.HTTPGet.Port.IntVal).To(Equal(int32(9696)))
Expect(container.ReadinessProbe.HTTPGet.Port.IntVal).To(Equal(int32(9696)))
Expect(container.VolumeMounts).To(HaveLen(4))
Expect(container.VolumeMounts).To(HaveLen(2))
Expect(container.Image).To(Equal("test-neutron-container-image"))

Expect(container.LivenessProbe.HTTPGet.Port.IntVal).To(Equal(int32(9696)))
Expand Down
2 changes: 1 addition & 1 deletion test/kuttl/common/assert_sample_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ apiVersion: v1
kind: Pod
metadata:
annotations:
openshift.io/scc: privileged
openshift.io/scc: anyuid
labels:
service: neutron
---
Expand Down

0 comments on commit 9899c31

Please sign in to comment.