client icon indicating copy to clipboard operation
client copied to clipboard

`kn apply` ignores revision name

Open jwilner opened this issue 4 years ago • 10 comments
trafficstars

Bug report

Revision name is discarded -- note the revision name in the output below:

$ kn service apply --filename service.yaml --revision-name="foo-iamrevision"
Creating service 'foo' in namespace 'default':
...
Service 'foo' created to latest revision 'foo-00001' is available at URL:
http://foo.default.cluster.auth.dev

Expected behavior

Expected it to behave like create in this scenario (note the revision name).

kn service create --filename service.yaml --revision-name="foo-iamrevision"
Creating service 'foo' in namespace 'default':
...
Service 'foo' created to latest revision 'foo-iamrevision' is available at URL:
http://foo.default.cluster.auth.dev

Steps to reproduce the problem

Pretty much the steps above.

kn version

go installed from f128d045ba2139d1113b46427a09366e131c6b7c

Version:      
Build Date:   
Git Revision: 
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v0.19.0)
* Eventing
  - sources.knative.dev/v1alpha2 (knative-eventing v0.19.0)
  - eventing.knative.dev/v1beta1 (knative-eventing v0.19.0)

Knative (serving/eventing) version

0.19.x

jwilner avatar Jan 08 '21 17:01 jwilner

Oh and the issue is pretty clearly here: https://github.com/knative/client/blob/release-0.19/pkg/kn/commands/service/apply.go#L69

jwilner avatar Jan 08 '21 17:01 jwilner

The issue here is, that we don't support BYO revision name with kn service apply. The reason is that we can't make that idem-potent, e.g. calling kn service apply a second time with the same arguments has to be a no-op and don't provide an error. Also I remember other issues with BYO revision names.

@jwilner Actually, what is your use case with providing a revision name with kn service apply ? Always curious to learn the usefulness of --revision-name which I think make more trouble than it helps.

rhuss avatar Feb 02 '21 13:02 rhuss

@rhuss I don't immediately remember what my need for revision-name was. I can dig into it some more and get back to you. In the meanwhile, you can see our current usage in the pasted bash snippet in https://github.com/knative/client/pull/1187#issuecomment-771729924

jwilner avatar Feb 02 '21 15:02 jwilner

Checking your script, I think you don't have to set the revision name anymore explicitly as by default kn is using server-side generated revision names now since 0.21. If you update, could you try if your use case would work without setting an explicit --revision-name ?

rhuss avatar Mar 09 '21 17:03 rhuss

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jun 08 '21 01:06 github-actions[bot]

/remove-lifecycle stale

rhuss avatar Jul 05 '21 12:07 rhuss

/assign

vyasgun avatar Jul 29 '21 11:07 vyasgun

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Oct 28 '21 01:10 github-actions[bot]

/remove-lifecycle stale

rhuss avatar Nov 04 '21 08:11 rhuss

We should decide what to do with this issue when we revisit https://github.com/knative/client/pull/1187 and how to progress there. @vyasgun if you don't mind I would assign this issue to myself.

/assign rhuss

rhuss avatar Jan 04 '22 14:01 rhuss