Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1388404

Summary: [networking_public_213] Should add --local option in oc set resources
Product: OpenShift Container Platform Reporter: Yan Du <yadu>
Component: NetworkingAssignee: Jacob Tanenbaum <jtanenba>
Status: CLOSED ERRATA QA Contact: Meng Bo <bmeng>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.4.0CC: aos-bugs, bbennett, ffranz, jokerman, mmccomas, tdawson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-18 12:44:43 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 Yan Du 2016-10-25 09:23:08 UTC
Description of problem:
Should add --local option in oc set resources help page

Version-Release number of selected component (if applicable):
openshift v3.4.0.15+9c963ec
kubernetes v1.4.0+776c994
etcd 3.1.0-alpha.1


How reproducible:
Always

Steps to Reproduce:
1. # oc set resources -h
<------------------------snip---------------------->
  # Print the result (in yaml format) of updating nginx container limits from a local, without hitting the server
  
  oc set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml
<------------------------snip---------------------->
2. Prepare a rc or dc yaml file
3. # oc set resources -f tmp/rc.yaml --limits=cpu=200m,memory=512Mi --local -o yaml

Actual results:
# oc set resources -f tmp/rc.yaml --limits=cpu=200m,memory=512Mi --local -o yaml
Error: unknown flag: --local


Expected results:
Should add --local option in oc set resources

Comment 1 Yan Du 2016-10-25 09:25:36 UTC
If we run the cmd without --local option, then we got below result:

# oc set resources -f /tmp/rc.yaml --limits=cpu=200m,memory=512Mi -o yaml 
Error from server: replicationcontrollers "test-rc" not found

Comment 2 Jacob Tanenbaum 2016-11-01 14:26:27 UTC
https://github.com/openshift/origin/pull/11694

Comment 3 Troy Dawson 2016-11-07 19:45:03 UTC
This has been merged into ose and is in OSE v3.4.0.23 or newer.

Comment 5 Yan Du 2016-11-08 01:57:37 UTC
Issue have been fixed.
oc v3.4.0.23+24b1a58
kubernetes v1.4.0+776c994

# oc set resources -f list.yaml --limits=cpu=200m,memory=512Mi --local -o yaml
apiVersion: v1
kind: ReplicationController
metadata:
  creationTimestamp: null
  generation: 1
  labels:
    name: test-rc
  name: test-rc
  namespace: default
spec:
  replicas: 2
  selector:
    name: test-pods
  template:
    metadata:
      creationTimestamp: null
      labels:
        name: test-pods
    spec:
      containers:
      - image: bmeng/hello-openshift
        imagePullPolicy: Always
        name: test-pod
        resources:
          limits:
            cpu: 200m
            memory: 512Mi
        terminationMessagePath: /dev/termination-log
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      securityContext: {}
      terminationGracePeriodSeconds: 30
status:
  replicas: 0

Comment 7 errata-xmlrpc 2017-01-18 12:44:43 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-2017:0066