diff options
author | Scott Dodson <sdodson@redhat.com> | 2017-03-07 20:19:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-07 20:19:04 -0500 |
commit | 36af6a92b5a211667e68c03cfcd6532c9ef8299a (patch) | |
tree | 0d57617b3985031501c2165ec4784c7f7ff822a7 | |
parent | 766128bf66cbc45cb2c2539dec0472e7d378a3fb (diff) | |
parent | acc27900faf0501a22e9c20da27bd7f103392636 (diff) | |
download | openshift-36af6a92b5a211667e68c03cfcd6532c9ef8299a.tar.gz openshift-36af6a92b5a211667e68c03cfcd6532c9ef8299a.tar.bz2 openshift-36af6a92b5a211667e68c03cfcd6532c9ef8299a.tar.xz openshift-36af6a92b5a211667e68c03cfcd6532c9ef8299a.zip |
Merge pull request #3585 from tbielawa/petset_early_fail
Petset early fail
3 files changed, 53 insertions, 3 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_5/validator.yml b/playbooks/common/openshift-cluster/upgrades/v3_5/validator.yml index 13fd917c5..9c126033c 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_5/validator.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_5/validator.yml @@ -16,3 +16,52 @@ tasks: - name: Check for invalid namespaces and SDN errors oc_objectvalidator: + + # What's all this PetSet business about? + # + # 'PetSets' were ALPHA resources in Kube <= 3.4. In >= 3.5 they are + # no longer supported. The BETA resource 'StatefulSets' replaces + # them. We can't migrate clients PetSets to + # StatefulSets. Additionally, Red Hat has never officially supported + # these resource types. Sorry users, but if you were using + # unsupported resources from the Kube documentation then we can't + # help you at this time. + # + # Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1428229 + - name: Check if legacy PetSets exist + oc_obj: + state: list + all_namespaces: true + kind: petsets + register: l_do_petsets_exist + + - name: FAIL ON Resource migration 'PetSets' unsupported + fail: + msg: > + PetSet objects were detected in your cluster. These are an + Alpha feature in upstream Kubernetes 1.4 and are not supported + by Red Hat. In Kubernetes 1.5, they are replaced by the Beta + feature StatefulSets. Red Hat currently does not offer support + for either PetSets or StatefulSets. + + Automatically migrating PetSets to StatefulSets in OpenShift + Container Platform (OCP) 3.5 is not supported. See the + Kubernetes "Upgrading from PetSets to StatefulSets" + documentation for additional information: + + https://kubernetes.io/docs/tasks/manage-stateful-set/upgrade-pet-set-to-stateful-set/ + + PetSets MUST be removed before upgrading to OCP 3.5. Red Hat + strongly recommends reading the above referenced documentation + in its entirety before taking any destructive actions. + + If you want to simply remove all PetSets without manually + migrating to StatefulSets, run this command as a user with + cluster-admin privileges: + + $ oc get petsets --all-namespaces -o yaml | oc delete -f - --cascale=false + when: + # Search did not fail, valid resource type found + - l_do_petsets_exist.results.returncode == "0" + # Items do exist in the search results + - l_do_petsets_exist.results.results.0['items'] | length > 0 diff --git a/roles/openshift_logging/filter_plugins/openshift_logging.py b/roles/openshift_logging/filter_plugins/openshift_logging.py index f0007dfc7..9beffaef7 100644 --- a/roles/openshift_logging/filter_plugins/openshift_logging.py +++ b/roles/openshift_logging/filter_plugins/openshift_logging.py @@ -28,10 +28,11 @@ def entry_from_named_pair(register_pairs, key): def map_from_pairs(source, delim="="): ''' Returns a dict given the source and delim delimited ''' if source == '': - return dict() + return dict() return dict(source.split(delim) for item in source.split(",")) + # pylint: disable=too-few-public-methods class FilterModule(object): ''' OpenShift Logging Filters ''' diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml index 1beff3bfc..83b68fa77 100644 --- a/roles/openshift_logging/tasks/install_logging.yaml +++ b/roles/openshift_logging/tasks/install_logging.yaml @@ -77,8 +77,8 @@ loop_control: loop_var: sa_account when: - - openshift_logging_image_pull_secret is defined - - openshift_logging_image_pull_secret != '' + - openshift_logging_image_pull_secret is defined + - openshift_logging_image_pull_secret != '' failed_when: link_pull_secret.rc != 0 - name: Scaling up cluster |