cleanup.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. # Copyright 2014 The Kubernetes Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # Cleans up resources from the example, assumed to be run from Kubernetes repo root
  16. echo
  17. echo
  18. export OPENSHIFT_EXAMPLE=$(pwd)/examples/openshift-origin
  19. export OPENSHIFT_CONFIG=${OPENSHIFT_EXAMPLE}/config
  20. echo "===> Removing the OpenShift namespace:"
  21. kubectl delete namespace openshift-origin
  22. echo
  23. echo "===> Removing local files:"
  24. rm -rf ${OPENSHIFT_CONFIG}
  25. rm ${OPENSHIFT_EXAMPLE}/openshift-startup.log
  26. rm ${OPENSHIFT_EXAMPLE}/secret.json
  27. touch ${OPENSHIFT_EXAMPLE}/secret.json
  28. echo
  29. echo "===> Restoring changed YAML specifcations:"
  30. if [ -f "${OPENSHIFT_EXAMPLE}/etcd-controller.yaml.bak" ]; then
  31. rm ${OPENSHIFT_EXAMPLE}/etcd-controller.yaml
  32. mv -v ${OPENSHIFT_EXAMPLE}/etcd-controller.yaml.bak ${OPENSHIFT_EXAMPLE}/etcd-controller.yaml
  33. else
  34. echo "No changed specifications found."
  35. fi
  36. echo
  37. echo Done.