Bug 1574299

Summary: Undeploy logging(enabled ops cluster), ansible throws out error "field is immutable, try updating the namespace"
Product: OpenShift Container Platform Reporter: Junqi Zhao <juzhao>
Component: LoggingAssignee: ewolinet
Status: CLOSED ERRATA QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.10.0CC: aos-bugs, ewolinet, rmeggins
Target Milestone: ---   
Target Release: 3.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: When uninstalling logging, the role was attempting to modify the 'project' api object Consequence: The task failed to remove an annotation on the project. Fix: Updated the role to modify the 'namespace' object instead. Result: The task completes successfully, as intended.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-30 19:14:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Junqi Zhao 2018-05-03 03:17:25 UTC
Description of problem:
Deploy logging with OPS enabled cluster firstly and undeploy logging later,ansible throws out error "field is immutable, try updating the namespace", although this error, acutually logging is undeployed.

it does not have this issue when uninstall logging without ops cluster enabled.

failed: [host-8-249-35.host.centralci.eng.rdu2.redhat.com] (item=default) => {"changed": true, "cmd": ["oc", "--config=/etc/origin/master/admin.kubeconfig", "annotate", "project/default", "openshift.io/logging.ui.hostname-"], "delta": "0:00:00.150766", "end": "2018-05-02 22:49:53.563247", "failed": true, "msg": "non-zero return code", "project": "default", "rc": 1, "start": "2018-05-02 22:49:53.412481", "stderr": "The Project \"default\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace", "stderr_lines": ["The Project \"default\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace"], "stdout": "", "stdout_lines": []}
failed: [host-8-249-35.host.centralci.eng.rdu2.redhat.com] (item=default) => {"changed": true, "cmd": ["oc", "--config=/etc/origin/master/admin.kubeconfig", "annotate", "project/kube-system", "openshift.io/logging.ui.hostname-"], "delta": "0:00:00.160766", "end": "2018-05-02 22:49:53.872717", "failed": true, "msg": "non-zero return code", "project": "kube-system", "rc": 1, "start": "2018-05-02 22:49:53.711951", "stderr": "The Project \"kube-system\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace", "stderr_lines": ["The Project \"kube-system\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace"], "stdout": "", "stdout_lines": []}
failed: [host-8-249-35.host.centralci.eng.rdu2.redhat.com] (item=default) => {"changed": true, "cmd": ["oc", "--config=/etc/origin/master/admin.kubeconfig", "annotate", "project/openshift", "openshift.io/logging.ui.hostname-"], "delta": "0:00:00.144843", "end": "2018-05-02 22:49:54.166567", "failed": true, "msg": "non-zero return code", "project": "openshift", "rc": 1, "start": "2018-05-02 22:49:54.021724", "stderr": "The Project \"openshift\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace", "stderr_lines": ["The Project \"openshift\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace"], "stdout": "", "stdout_lines": []}
failed: [host-8-249-35.host.centralci.eng.rdu2.redhat.com] (item=default) => {"changed": true, "cmd": ["oc", "--config=/etc/origin/master/admin.kubeconfig", "annotate", "project/openshift-infra", "openshift.io/logging.ui.hostname-"], "delta": "0:00:00.143219", "end": "2018-05-02 22:49:54.449129", "failed": true, "msg": "non-zero return code", "project": "openshift-infra", "rc": 1, "start": "2018-05-02 22:49:54.305910", "stderr": "The Project \"openshift-infra\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace", "stderr_lines": ["The Project \"openshift-infra\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace"], "stdout": "", "stdout_lines": []}
failed: [host-8-249-35.host.centralci.eng.rdu2.redhat.com] (item=default) => {"changed": true, "cmd": ["oc", "--config=/etc/origin/master/admin.kubeconfig", "annotate", "project/openshift-logging", "openshift.io/logging.ui.hostname-"], "delta": "0:00:00.142494", "end": "2018-05-02 22:49:54.734202", "failed": true, "msg": "non-zero return code", "project": "openshift-logging", "rc": 1, "start": "2018-05-02 22:49:54.591708", "stderr": "The Project \"openshift-logging\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace", "stderr_lines": ["The Project \"openshift-logging\" is invalid: metadata.annotations[openshift.io/logging.ui.hostname]: Invalid value: \"kibana-ops.apps.0502-x-a.qe.rhcloud.com\": field is immutable, try updating the namespace"], "stdout": "", "stdout_lines": []}

Version-Release number of selected component (if applicable):
openshift-ansible-3.10.0-0.32.0.git.0.bb50d68.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. Deploy logging with OPS enabled cluster firstly
2. Undeploy logging
3.

Actual results:
Failed to uninstall logging

Expected results:
Should be no error when uninstall logging

Additional info:

Comment 1 Junqi Zhao 2018-05-03 03:20:25 UTC
it trying to update the annotations of project: default,kube-system,openshift,openshift-infra,openshift-logging

Comment 4 Junqi Zhao 2018-05-16 02:27:25 UTC
Tested with openshift-ansible-3.10.0-0.46.0.git.0.85c3afd.el7.noarch,  Undeploy logging(enabled ops cluster) is successful.

Note:
annotation openshift.io/logging.ui.hostname is removed from project: default,kube-system,openshift,openshift-infra,openshift-logging

Comment 6 errata-xmlrpc 2018-07-30 19:14:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1816