Bug 1729444 - spec.initContainers cannot be updated
Summary: spec.initContainers cannot be updated
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.7.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 3.7.z
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-12 09:55 UTC by Juan Luis de Sousa-Valadas
Modified: 2023-03-24 15:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-01 16:44:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Juan Luis de Sousa-Valadas 2019-07-12 09:55:01 UTC
Description of problem:
dc.spec.template.spec.initContainers cannot be updated with oc replace, oc edit or oc apply.

Also there is no way to completely remove them, so the only workaround is to delete the deploymentconfig (replication controller or whatever).

This issue was fixed here: https://github.com/kubernetes/kubernetes/issues/47264

Version-Release number of selected component (if applicable):
v3.7.119

How reproducible:
Always

Steps to Reproduce:
1. Create a dc with an initContainer
2. Try to modify the initContainer image or to delete the initContainer.

Actual results:
Cannot be modified

Expected results:
Can be modified

Additional info:
There is an impactbecause  this means the rolling release capcity is lost

Comment 1 Stefan Schimanski 2019-07-23 09:01:21 UTC
What is the output of the oc replace/edit/apply commands?

Comment 2 Juan Luis de Sousa-Valadas 2019-07-23 09:44:35 UTC
Possible workarounds:
1- use /apis/apps.openshift.io/v1/namespaces/<ns>/deploymentconfigs/<dc> instead of /oapi/v1/namespaces/<ns>/deploymentconfigs/<dc>
2- Use a deploymentconfig. Because the deploymentConfig updates the image on /apis/apps.openshift.io/v1/namespaces/<ns>/deploymentconfigs/<dc> it seems to be updating the image sucessfully.

Proof of the workaround:
1- Create a dc with an init container
$ oc get dc hello-openshift -o yaml | grep initContainers: -A5
      initContainers:
      - command:
        - sh
        - -c
        - sleep 50
        image: busybox:1.28

$ curl \
     --cacert /etc/origin/master/ca-bundle.crt \
     --key /etc/origin/master/openshift-master.key \
     --cert /etc/origin/master/openshift-master.crt \
     -H 'Content-Type: application/strategic-merge-patch+json'  \
     -X PATCH \
     --data "$(oc get dc hello-openshift -o json | sed 's/busybox:1.28/busybox/')" https://<server>//apis/apps.openshift.io/v1/namespaces/<ns>/deploymentconfigs/<dc>
[...]

$ oc get dc hello-openshift -o yaml | grep initContainers: -A5
      initContainers:
      - command:
        - sh
        - -c
        - sleep 50
        image: busybox

Comment 3 Maciej Szulik 2019-08-16 14:24:18 UTC
This was apparently fixed in the next oc release, is there a chance customer can update to a newer version?

Comment 5 Juan Luis de Sousa-Valadas 2019-08-17 16:57:14 UTC
It's not on the table, however there is a suitable workaround.

Comment 6 Maciej Szulik 2019-10-01 15:51:43 UTC
(In reply to Juan Luis de Sousa-Valadas from comment #5)
> It's not on the table, however there is a suitable workaround.

Based on that, can we then close this issue?

Comment 8 Maciej Szulik 2019-10-01 16:44:12 UTC
Closing per previous comment.


Note You need to log in before you can comment on or make changes to this bug.