Skip to content

Clearer responsibility of kosli create command #560

@dangrondahl

Description

@dangrondahl

Going through the CLI reference, and with a background in Kubernetes, I am a bit confused on the impact and functionality of kosli create having both create and update functionality.

I was wondering if it at some point would make sense to consider introducing kosli apply <resource> as a more clear update method for resources.
This also implies changing kosli create <resource> to only cover creation of new resources. This will cause a breaking change.

To elaborate: Users that are familiar with Kubernetes would know that the different between these two commands are:

  • kubectl create (imperative): Creates a new resource, fails if already present.
  • kubectl apply (declarative): Creates a resource if not existing, otherwise it updates the resource.

Moreover kubectl apply is idempotent, meaning state doesn't change upon applying the same resource several times. As a kosli user, it is bit unclear to me if e.g. kosli create flow is actually idempotent when recreating the exact same resource, i.e. does state change?

To recap perceived outcome would be:

  • Better aligned with already established Kubernetes practices, similar to how kubectl, GitOps, etc. works.
  • Clearer functionality: I'm more in control of what I actually want kosli create/apply to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions