Skip to content

Export command doesn't honour --mode flag #1087

@dsimansk

Description

@dsimansk

Bug report

When --mode flag is specified for ksvc without --with-revisions flag that output format is plain Knative Service yaml instead of our custom Export type.

➜  ~ kn service export hello -o yaml --mode export                 
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  creationTimestamp: null
  name: hello
spec:
  template:
    metadata:
      annotations:
        client.knative.dev/user-image: docker.io/dsimansk/helloworld
      creationTimestamp: null
      name: hello-djrrc-1
    spec:
      containerConcurrency: 0
      containers:
      - env:
        - name: TARGET
          value: v1
        image: docker.io/dsimansk/helloworld
        name: user-container
        readinessProbe:
          successThreshold: 1
          tcpSocket:
            port: 0
        resources: {}
      enableServiceLinks: false
      timeoutSeconds: 300
status: {}

Expected behavior

kn service export hello -o yaml --mode export - output is printed in requested Export format.

Steps to reproduce the problem

Exec and check the format.

 kn service export hello -o yaml --mode export                 

kn version

HEAD

Knative (serving/eventing) version

Nightly

/kind good-first-issue

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor.kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions