func icon indicating copy to clipboard operation
func copied to clipboard

Exporting Knative Service when requested in the CLI using --dry-run

Open salaboy opened this issue 3 years ago • 10 comments

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.

salaboy avatar Jun 14 '22 12:06 salaboy

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?

salaboy avatar Jul 01 '22 09:07 salaboy

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.

salaboy avatar Jul 05 '22 09:07 salaboy

https://github.com/knative/client/issues/1195

salaboy avatar Jul 12 '22 14:07 salaboy

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 Jan 03 '23 01:01 github-actions[bot]

/remove-lifecycle stale

zroubalik avatar Jan 03 '23 08:01 zroubalik

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 Aug 16 '23 01:08 github-actions[bot]

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 Mar 06 '24 01:03 github-actions[bot]

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 21 '24 01:06 github-actions[bot]

/remove-lifecycle stale

matejvasek avatar Jun 21 '24 11:06 matejvasek

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 Sep 20 '24 01:09 github-actions[bot]