Exporting Knative Service when requested in the CLI using --dry-run
As discussed in this issue: https://github.com/knative-sandbox/kn-plugin-func/issues/817 As discussed in the weekly meeting
The func CLI should:
- Allow the user to export the Knative Service that is being created programmatically using --dry-run
This will allow users to save the resource and apply it manually if they want to override some configurations.
After trying to create my own --dry-run printers I've realized that there is a "similar" functionality in kn that we can/should use.
The kn cli already provides a sort of dry run with the --target parameter which dumps the output of commands into a file. They also have knServingGitOpsClient which is an alternative implementation of the Knative serving clients that do all the dumping resources to files.
@zroubalik I am not sure if you have looked into the on-cluster build dry runs.. but so far I think that we should reuse the kn cli mechanisms.
I've started to think that my first implementation will follow the same approach of asking for a --target flag which points to a file where the resources are going to be written. This in my opinion is not very "gitops-y", but I do understand some of the reasons why this might have been designed in this way. From what I understand looking at the kn code when --target is provided nothing is applied to the cluster.
Internally this is using &printers.YAMLPrinter{} to print YAMLs with different options.
@lance @lkingland @matejvasek any thoughts?
Quick update, I've written a comment on the client issue linked above to see if we can expand the kn client capabilities so we can reuse them here in func. I will create a draft PR in the meantime.
https://github.com/knative/client/issues/1195
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.
/remove-lifecycle stale
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.
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.
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.
/remove-lifecycle stale
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.