Skip to content

Conversation

@markoskandylis
Copy link
Contributor

Add Create Command with Dry-Run Functionality to KRO CLI

Description

Adds the create command to the KRO CLI with dry-run functionality. This enhancement allows users to preview RGD (Resource Graph Definition) changes before applying them to the cluster.

Features

  • Added create rgd command
  • Implemented --dry-run flag option
  • Shows delta comparison of changes to be applied

Implementation Details

  • Command syntax:
    • Basic usage: kro create rgd [FILE]
    • With dry-run: kro create rgd [FILE] --dry-run
  • Shows detailed resource changes including:
    • Path modifications
    • Old vs New value comparisons
    • Resource definition updates
Screenshot 2025-05-30 at 10 19 20

Demo

smaller.mov

@markoskandylis markoskandylis changed the title kro cli: Create and dry run command WIP - kro cli: Create and dry run command for RGD May 30, 2025
@markoskandylis markoskandylis changed the title WIP - kro cli: Create and dry run command for RGD kro cli: Create and dry run command for RGD May 30, 2025
@barney-s
Copy link
Contributor

barney-s commented Aug 8, 2025

Kubectl has a diff. Would this add more functionality than what is available in kubectl ?
https://kubernetes.io/docs/reference/kubectl/generated/kubectl_diff/

Also we would need to rebase this to conform to the new cli directory structure.

We see value in showing diff in the rendered objects for an RGD instances. Thats not what this PR seems to be doing.

@markoskandylis
Copy link
Contributor Author

Hi @barney-s, thanks for the feedback!
The end goal is to have something like a terraform plan built into the Kro CLI — a Kro-aware preview of all changes before apply.
This PR is just the first step (diffing the RGD definition) before extending it to instance-level, rendered-object diffs.
From a DevOps perspective, I’d like this available in the CLI so it can be easily used in pipelines as part of the deployment process.
Since you also see value in showing diffs at the rendered object level, I can start working on the instance-level extension next — which will be particularly important when Kro orchestrates cloud resources (ACK/Config Connector/ASO) so users can see potential creates, updates, or destroys before they happen.

@barney-s
Copy link
Contributor

@markoskandylis - Would you be inclined to implement the terraform plan like capability instead of this PR ? You can do it in a new PR or replace this PR code with the plan like functionality.

Copy link
Contributor

@barney-s barney-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would like to have the plan equivalent. Essentially diff of generated resources. Diffing instance or RGD is not desirable atm. Simple git diff or kubectl diff would work for those cases.

@k8s-triage-robot
Copy link

Unknown CLA label state. Rechecking for CLA labels.

Send feedback to sig-contributor-experience at kubernetes/community.

/check-cla
/easycla

@linux-foundation-easycla
Copy link

CLA Not Signed

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 12, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants