Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1354435 - oc apply needs be deprecated
Summary: oc apply needs be deprecated
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OKD
Classification: Red Hat
Component: Command Line Interface
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-11 10:12 UTC by Xingxing Xia
Modified: 2017-07-17 05:57 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-14 18:46:26 UTC


Attachments (Terms of Use)

Description Xingxing Xia 2016-07-11 10:12:43 UTC
Description of problem:
oc apply needs be deprecated. It has nothing more useful than oc create and oc replace. It just makes customer confused that why so many overlapping oc sub-commands.

Version-Release number of selected component (if applicable):
oc v1.3.0-alpha.2-1074-g69bd399
kubernetes v1.3.0-alpha.3-599-g2746284

How reproducible:
Always

Steps to Reproduce:
1. Compare the help info of `oc apply -h` VS `oc create -h`

Take an example of oc apply:
2. 
1> cat svc_test.yaml
apiVersion: v1
kind: Service
metadata:
  name: svc-test
spec:
  ports:
  - targetPort: 8080
    port: 8080
    name: web1
    protocol: TCP
  selector:
    name: database

2> oc apply -f svc_test.yaml

3 Check oc apply's result
1> oc get svc svc-test -o yaml
2> From the output, compare the content in kubectl.kubernetes.io/last-applied-configuration and the content of the resource

4. oc edit resource then check again 
1> oc edit svc svc-test # e.g. change targetPort: 8080 to targetPort: 8081
2> oc get svc svc-test -o yaml
3> From the output, compare the content like step 3.2 again.

Actual results:
3.
2> What `oc apply` does is just to add one new annotation: kubectl.kubernetes.io/last-applied-configuration, the content of which is just as same as the content of the resource. So, the annotation provides nothing useful at all. It just makes the resource content bulky

4.
3> The contents are sync'ed same after any edit, again proving the annotation provides nothing useful at all

Expected results:
Deprecate oc apply from `oc help`

Additional info:
Should deprecate --saved-config from `oc create -h` too, because the flag just adds the annotation: kubectl.kubernetes.io/last-applied-configuration, which is not useful as said above.

Comment 2 Juan Vallejo 2016-07-14 18:44:36 UTC
Related PR: https://github.com/openshift/origin/pull/9859

Comment 3 Juan Vallejo 2016-07-14 18:46:26 UTC
Closed, see: https://github.com/openshift/origin/pull/9859


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