Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup "kn service export" data #1586

Open
Tracked by #1585
rhuss opened this issue Jan 27, 2022 · 0 comments
Open
Tracked by #1585

Cleanup "kn service export" data #1586

rhuss opened this issue Jan 27, 2022 · 0 comments
Labels
triage/accepted Issues which should be fixed (post-triage)

Comments

@rhuss
Copy link
Contributor

rhuss commented Jan 27, 2022

Currentl kn service export export services, but does not cleanup everything. Some default values are still contained like in:

apiVersion: client.knative.dev/v1alpha1
kind: Export
metadata:
  creationTimestamp: null
spec:
  revisions: null
  service:
    apiVersion: serving.knative.dev/v1
    kind: Service
    metadata:
      creationTimestamp: null
      name: demo
    spec:
      template:
        metadata:
          annotations:
            client.knative.dev/user-image: rhuss/random:1.0
          creationTimestamp: null
        spec:
          containerConcurrency: 0
          containers:
          - env:
            - name: foo
              value: bar
            - name: blub
              value: bla
            image: index.docker.io/rhuss/random@sha256:946b7ca7f880ca38e4930cd625d4533616bba75f5fafde132cc3b7e7ae3a18b5
            name: user-container
            readinessProbe:
              successThreshold: 1
              tcpSocket:
                port: 0
            resources: {}
          enableServiceLinks: false
          timeoutSeconds: 300
    status: {}
  • creationTimestamp should be removed
  • Remove status: section
  • Readiness Probe can be removed, too, if its the default (tricky)
  • user-container name can be removed
  • revisions: section can be removed

For the "replay" format:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  creationTimestamp: null
  name: demo
spec:
  template:
    metadata:
      annotations:
        client.knative.dev/user-image: rhuss/random:1.0
      creationTimestamp: null
    spec:
      containerConcurrency: 0
      containers:
      - env:
        - name: foo
          value: bar
        - name: blub
          value: bla
        image: index.docker.io/rhuss/random@sha256:946b7ca7f880ca38e4930cd625d4533616bba75f5fafde132cc3b7e7ae3a18b5
        name: user-container
        readinessProbe:
          successThreshold: 1
          tcpSocket:
            port: 0
        resources: {}
      enableServiceLinks: false
      timeoutSeconds: 300
status: {}

As above, plus

  • enableServiceLinks and timeoutSeconds could be removed if they reflect the default. Again, this is tricky as how should we know when this is default or not ?
  • the empty resources: can be removed
@rhuss rhuss added the triage/accepted Issues which should be fixed (post-triage) label Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/accepted Issues which should be fixed (post-triage)
Projects
Status: Backlog
Development

No branches or pull requests

1 participant