Bug 1480450 - oc expose cannot handle matchExpressions [NEEDINFO]
oc expose cannot handle matchExpressions
Status: ASSIGNED
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.6.0
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Juan Vallejo
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-11 03:09 EDT by Xingxing Xia
Modified: 2017-08-29 10:55 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
jvallejo: needinfo? (ffranz)
jvallejo: needinfo? (ffranz)


Attachments (Terms of Use)

  None (edit)
Description Xingxing Xia 2017-08-11 03:09:17 EDT
Description of problem:
To create svc, oc expose cannot handle matchExpressions

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

How reproducible:
Always

Steps to Reproduce:
1. App file with matchExpressions under spec
$ cat rs.yaml
apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
  labels:
    app: guestbook
    tier: frontend
  name: frontend
spec:
  replicas: 1
  selector:
    matchExpressions:
    - key: tier
      operator: In
      values:
      - frontend
    matchLabels:
      tier: frontend
  template:
    metadata:
      labels:
        app: guestbook
        tier: frontend
    spec:
      containers:
      - env:
        - name: GET_HOSTS_FROM
          value: dns
        image: openshift/hello-openshift
        name: hello-openshift
        ports:
        - containerPort: 8080
          protocol: TCP
        resources:
          limits:
            memory: 256Mi
2. $ oc create -f rs.yaml
3. $ oc expose rs/frontend
4. `oc edit rs/frontend` to remove matchExpressions, then try `oc expose rs/frontend`

Actual results:
3. Get error:
couldn't retrieve selectors via --selector flag or introspection: couldn't convert expressions - "[{Key:tier Operator:In Values:[frontend]}]" to map-based selector format
See 'oc expose -h' for help and examples.

4. Get:
service "frontend" exposed

Expected results:
3. Should succeed as handling matchLabels in step 4

Additional info:
Comment 1 Juan Vallejo 2017-08-25 15:06:08 EDT
It looks like support for matchExpressions for replicasets has not yet been added. Will tag this issue as upcomingrelease for now.

ffranz, fyi
Comment 2 Juan Vallejo 2017-08-25 15:06:26 EDT
It looks like support for matchExpressions for replicasets has not yet been added. Will tag this issue as upcomingrelease for now.

https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/util/factory_client_access.go#L274

ffranz, fyi

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