From ec7d1b04ef91a3d10675efe1c53a88ef100437b8 Mon Sep 17 00:00:00 2001 From: Jeff Cantrill Date: Thu, 17 Aug 2017 16:21:58 -0400 Subject: bug 1482661. Preserve ES dc nodeSelector and supplementalGroups (cherry picked from commit 601e35cbf4410972c7fa0a1d3d5c6327b82353ac) --- roles/openshift_logging/library/openshift_logging_facts.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'roles/openshift_logging/library') diff --git a/roles/openshift_logging/library/openshift_logging_facts.py b/roles/openshift_logging/library/openshift_logging_facts.py index 35accfb78..01c0408d8 100644 --- a/roles/openshift_logging/library/openshift_logging_facts.py +++ b/roles/openshift_logging/library/openshift_logging_facts.py @@ -171,12 +171,17 @@ class OpenshiftLoggingFacts(OCBaseCommand): if comp is not None: spec = dc_item["spec"]["template"]["spec"] facts = dict( + name=name, selector=dc_item["spec"]["selector"], replicas=dc_item["spec"]["replicas"], serviceAccount=spec["serviceAccount"], containers=dict(), volumes=dict() ) + if "nodeSelector" in spec: + facts["nodeSelector"] = spec["nodeSelector"] + if "supplementalGroups" in spec["securityContext"]: + facts["storageGroups"] = spec["securityContext"]["supplementalGroups"] if "volumes" in spec: for vol in spec["volumes"]: clone = copy.deepcopy(vol) -- cgit v1.2.3 From f4c7d5e064fad263f618fb633d5c0d37c0a2a553 Mon Sep 17 00:00:00 2001 From: Jeff Cantrill Date: Sun, 1 Oct 2017 14:54:22 -0400 Subject: Bug 1496271 - Perserve SCC for ES local persistent storage ES can be modified to use node local persistent storage. This requires changing SCC and is described in docs: https://docs.openshift.com/container-platform/3.6/install_config/aggregate_logging.html During an upgrade, SCC defined by the user is ignored. This fix fetches SCC user defined as a fact and adds it to the ES DC which is later used. --- roles/openshift_logging/library/openshift_logging_facts.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'roles/openshift_logging/library') diff --git a/roles/openshift_logging/library/openshift_logging_facts.py b/roles/openshift_logging/library/openshift_logging_facts.py index 01c0408d8..f10df8da5 100644 --- a/roles/openshift_logging/library/openshift_logging_facts.py +++ b/roles/openshift_logging/library/openshift_logging_facts.py @@ -182,16 +182,14 @@ class OpenshiftLoggingFacts(OCBaseCommand): facts["nodeSelector"] = spec["nodeSelector"] if "supplementalGroups" in spec["securityContext"]: facts["storageGroups"] = spec["securityContext"]["supplementalGroups"] + facts["spec"] = spec if "volumes" in spec: for vol in spec["volumes"]: clone = copy.deepcopy(vol) clone.pop("name", None) facts["volumes"][vol["name"]] = clone for container in spec["containers"]: - facts["containers"][container["name"]] = dict( - image=container["image"], - resources=container["resources"], - ) + facts["containers"][container["name"]] = container self.add_facts_for(comp, "deploymentconfigs", name, facts) def facts_for_services(self, namespace): -- cgit v1.2.3