Browse code

Merge pull request #6257 from sdodson/fix-sdn-upgrade

[RPMs] Cleanup kubeplugin path from old sdn-ovs installs

Troy Dawson authored on 2015/12/15 02:13:40
Showing 1 changed files
... ...
@@ -3,6 +3,8 @@
3 3
 %global gopath      %{_datadir}/gocode
4 4
 %global import_path github.com/openshift/origin
5 5
 %global sdn_import_path github.com/openshift/openshift-sdn
6
+# The following should only be used for cleanup of sdn-ovs upgrades
7
+%global kube_plugin_path /usr/libexec/kubernetes/kubelet-plugins/net/exec/redhat~openshift-ovs-subnet
6 8
 
7 9
 # docker_version is the version of docker requires by packages
8 10
 %global docker_version 1.8.2
... ...
@@ -403,6 +405,14 @@ fi
403 403
 %{_unitdir}/%{name}-node.service.d/openshift-sdn-ovs.conf
404 404
 %{_unitdir}/docker.service.d/docker-sdn-ovs.conf
405 405
 
406
+%posttrans sdn-ovs
407
+# This path was installed by older packages but the directory wasn't owned by
408
+# RPM so we need to clean it up otherwise kubelet throws an error trying to
409
+# load the directory as a plugin
410
+if [ -d %{kube_plugin_path} ]; then
411
+  rmdir %{kube_plugin_path}
412
+fi
413
+
406 414
 %files -n tuned-profiles-%{name}-node
407 415
 %license LICENSE
408 416
 %{_prefix}/lib/tuned/%{name}-node-host