Add verification of Calico policy setting during upgrade

In order to perform Calico upgrade properly, it's required to
determine whether Calico policy is enabled on the environment already
and to align policy settings for Calico v3.x (that will be running
after upgrade) accordingly.

The following actions are performed:
1. Check CNI config for policy settings.
2. Check Kubernetes addons for calico_policy addon.
3. Check whether kube-controllers pod is running.
4. Remove v2.6.x calico_policy addon on masters to not interfere with
   v3.x kube-controllers.
5. Check consistency between Calico policy entities detected during
   pp.1-3. Show a warning and do not touch policy turn on/off flag in
   case of non-consistency.
6. Check Calico policy setting for v3.x (that will be effective after
   upgrade) if Calico policy was enabled for currently running
   environment (so for Calico v2.6.x) already.
7. Issue a warning message if Calico policy is enabled currently but
   it is going to be disabled after upgrade.

It's safe to enable Calico policy any time, but it may be unsafe to
disable it. So, no need to disable Calico policy for v3.x if it's
not in use currently. But if Calico policy is in use already, it
should be enabled after upgrade as well.

Related-Prod: PROD-25161 (PROD:25161)

Change-Id: I35634adef52c29037b0184440aae9cbb4872ffd5
1 file changed
tree: aec24655c727d53a81a15df7e132f3af42810ceb
  1. .gitignore
  2. .gitreview
  3. abort-long-running-jobs.groovy
  4. aptly-add-packages.groovy
  5. aptly-promote-pipeline.groovy
  6. artifactory-promote-docker-image.groovy
  7. branch-git-repos.groovy
  8. build-debian-packages-influxdb-relay.groovy
  9. build-debian-packages-jmx-exporter.groovy
  10. build-debian-packages-libvirt-exporter.groovy
  11. build-debian-packages-pipeline.groovy
  12. build-debian-packages-prometheus-relay.groovy
  13. build-debian-packages-telegraf.groovy
  14. build-extra-dpdk-pipeline.groovy
  15. build.gradle
  16. ceph-add-node.groovy
  17. ceph-backend-migration.groovy
  18. ceph-remove-node.groovy
  19. ceph-remove-osd.groovy
  20. ceph-replace-failed-osd.groovy
  21. ceph-upgrade.groovy
  22. change-config.groovy
  23. cicd-lab-pipeline.groovy
  24. cleanup-pipeline.groovy
  25. cloud-deploy-pipeline.groovy
  26. cloud-update.groovy
  27. codenarcRules.groovy
  28. create-aptly-patch.groovy
  29. create-debmirror-package.groovy
  30. cvp-func.groovy
  31. cvp-ha.groovy
  32. cvp-perf.groovy
  33. cvp-runner.groovy
  34. cvp-sanity.groovy
  35. cvp-spt.groovy
  36. cvp-stacklight.groovy
  37. delete-broken-stacks-pipeline.groovy
  38. deploy-aws-k8s-kqueen-pipeline.groovy
  39. deploy-heat-k8s-kqueen-pipeline.groovy
  40. deploy-k8s-deployments.groovy
  41. deploy-try-mcp.groovy
  42. deploy-virtual-edge-mom.groovy
  43. docker-build-image-pipeline.groovy
  44. docker-cleanup-pipeline.groovy
  45. docker-mirror-images.groovy
  46. fake-test-pipeline.groovy
  47. gating-pipeline.groovy
  48. generate-cookiecutter-products.groovy
  49. generate-salt-model-docs-pipeline.groovy
  50. git-mirror-2way-pipeline.groovy
  51. git-mirror-pipeline.groovy
  52. ironic-node-provision-pipeline.groovy
  53. k8s-upgrade-pipeline.groovy
  54. kafka-demo.groovy
  55. lab-pipeline.groovy
  56. libvirt-live-snapshots.groovy
  57. LICENSE
  58. mirror-snapshot-pipeline.groovy
  59. mk-k8s-cleanup-pipeline.groovy
  60. mk-k8s-simple-deploy-pipeline.groovy
  61. mk-maaas-deploy-pipeline.groovy
  62. opencontrail-upgrade.groovy
  63. opencontrail40-upgrade.groovy
  64. openstack-compute-install.groovy
  65. openstack-control-upgrade.groovy
  66. openstack-data-upgrade.groovy
  67. promote-mirror-ubuntu-related.groovy
  68. promote-vcp-images.groovy
  69. README.rst
  70. release-mcp-version.groovy
  71. release-salt-formulas-pipeline.groovy
  72. restore-cassandra.groovy
  73. restore-zookeeper.groovy
  74. stacklight-upgrade.groovy
  75. sync-http-to-s3.groovy
  76. tag-git-repos.groovy
  77. tcp-qa-pipeline.groovy
  78. test-cookiecutter-reclass-chunk.groovy
  79. test-cookiecutter-reclass.groovy
  80. test-customers-salt-models.groovy
  81. test-drivetrain.groovy
  82. test-groovy-pipeline.groovy
  83. test-openscap-pipeline.groovy
  84. test-openstack-component-pipeline.groovy
  85. test-reclass-package.groovy
  86. test-run-rally.groovy
  87. test-run-tempest.groovy
  88. test-salt-formulas-env.groovy
  89. test-salt-formulas-pipeline.groovy
  90. test-salt-model-node.groovy
  91. test-salt-model-wrapper.groovy
  92. test-salt-models-pipeline.groovy
  93. test-system-reclass-pipeline.groovy
  94. update-jenkins-master-jobs.groovy
  95. update-mirror-image.groovy
  96. update-package.groovy
  97. update-reclass-metadata.groovy
  98. update-salt-environment.groovy
  99. update-salt-master-formulas.groovy
  100. upgrade-mcp-release.groovy
  101. validate-cloud.groovy
  102. xtrabackup-restore-mysql-db.groovy