diff --git a/packaging/rpm/microshift.spec b/packaging/rpm/microshift.spec index 7bc1affb99..76676ae341 100644 --- a/packaging/rpm/microshift.spec +++ b/packaging/rpm/microshift.spec @@ -164,6 +164,7 @@ install -p -m644 packaging/crio.conf.d/microshift.conf %{buildroot}%{_sysconfdir install -d -m755 %{buildroot}/%{_unitdir} install -p -m644 packaging/systemd/microshift.service %{buildroot}%{_unitdir}/microshift.service +install -p -m644 packaging/systemd/hostpath-provisioner.service %{buildroot}%{_unitdir}/hostpath-provisioner.service mkdir -p -m755 %{buildroot}/var/run/flannel mkdir -p -m755 %{buildroot}/var/run/kubelet @@ -202,6 +203,7 @@ fi %preun +%systemd_preun hostpath-provisioner.service %systemd_preun microshift.service @@ -221,8 +223,12 @@ fi /var/run/secrets/kubernetes.io/serviceaccount %{_datadir}/selinux/packages/%{selinuxtype}/microshift.pp.bz2 %ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/microshift +%{_unitdir}/hostpath-provisioner.service %changelog +* Tue May 24 2022 Ricardo Noriega . 4.10.0-0.microshift-2022-04-23-131357_2 +- Adding hostpath-provisioner.service to set SElinux policies to the volumes directory + * Fri May 7 2022 Sally O'Malley . 4.10.0-0.microshift-2022-04-23-131357 - Update required golang version to 1.17 diff --git a/packaging/systemd/hostpath-provisioner.service b/packaging/systemd/hostpath-provisioner.service new file mode 100644 index 0000000000..544a4571fa --- /dev/null +++ b/packaging/systemd/hostpath-provisioner.service @@ -0,0 +1,9 @@ +[Unit] +Description=Set SELinux chcon for hostpath-provisioner + +[Service] +ExecStart=/usr/bin/chcon -Rt container_file_t /var/hpvolumes +Type=oneshot + +[Install] +WantedBy=multi-user.target \ No newline at end of file