openshift / oc

The OpenShift Command Line, part of OKD
https://www.openshift.org
Apache License 2.0
199 stars 382 forks source link

passing incorrect command-line flags doesn't return an error #93

Closed p0lyn0mial closed 5 years ago

p0lyn0mial commented 5 years ago

I suspect the issue is not tied up to a single command but I run into it when I tried to create a new release from an existing image.

  1. running the following command (notice incorrect —from-release flag)

    oc  adm release new —from-release=registry.svc.ci.openshift.org/origin/release:4.2 cluster-kube-apiserver-operator=quay.io/polynomial/origin-cluster-kube-apiserver-operator:latest --to-image=quay.io/polynomial/origin-release:latest

    gives me the following output

    info: Loading override quay.io/polynomial/origin-cluster-kube-apiserver-operator:latest 
    cluster-kube-apiserver-operator
    info: Included 1 images from 1 input operators into the release
    error: unable to create a release: operator "cluster-kube-apiserver-operator" contained an 
    invalid image-references file: no input image tag named "hypershift"
  2. running (notice incorrect -from-release flag)

    oc adm release new -from-release=registry.svc.ci.openshift.org/origin/release:4.2 cluster-kube-apiserver-operator=quay.io/polynomial/origin-cluster-kube-apiserver-operator:latest --to-image=quay.io/polynomial/origin-release:latest

    is better but not perfect

    error: open rom-release=registry.svc.ci.openshift.org/origin/release:4.2: no such file or 
    directory
  3. however the following command

    oc adm release new --key=val --from-release=registry.svc.ci.openshift.org/origin/release:4.2 cluster-kube-apiserver-operator=quay.io/polynomial/origin-cluster-kube-apiserver-operator:latest --to-image=quay.io/polynomial/origin-release:latest

    reports an unknow flag

    Error: unknown flag: --key
    
    Usage:
      oc adm release new [SRC=DST ...] [flags]
    
    Examples:
     # Create a release from the latest origin images and push to a DockerHub repo
      oc adm release new --from-image-stream=4.1 -n origin --to-image 
    docker.io/mycompany/myrepo:latest
    ....

I would expect that cases 1 and 2 would behave the same way as 3.

p0lyn0mial commented 5 years ago

/cc @sttts

p0lyn0mial commented 5 years ago

closing as i opened a BZ issue.