Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command "fmt" is deprecated - Declare a formatting transformer in your kustomization instead #4339

Closed
whyvez opened this issue Dec 9, 2021 · 8 comments
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@whyvez
Copy link

whyvez commented Dec 9, 2021

When using kustomize cfg fmt I got this warning.

Command "fmt" is deprecated, imperative formatting will no longer be available in kustomize v5.
Declare a formatting transformer in your kustomization instead.

I don't understand the suggestion, "Declare a formatting transformer in your kustomization instead.".

Can someone explain what this means?

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 9, 2021
@natasha41575
Copy link
Contributor

Apologies for the cryptic and confusing warning. We have decided that commands such as kustomize cfg fmt are out of scope for builtin kustomize and would encourage you to instead create a plugin transformer to format your resources instead. You can follow the guides here: https://kubectl.docs.kubernetes.io/guides/extending_kustomize/ to create a plugin transformer, add the formatting transformer to the transformers field of your kustomization file, and run kustomize build to invoke it.

We would appreciate feedback if either:

  • It is difficult to create your own extension for kustomize to format your resources
  • This feature is popular enough for us to create a formatting transformer under an official CNCF plugin repo.

Please comment back if you have any further questions!

/kind support
/triage accepted

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 29, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 30, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 29, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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/test-infra repository.

@greenkiwi
Copy link

@natasha41575 we just ran across this issue and were wondering whether there were any good examples to follow. We have attempted to have all of our "code" use strong formatting. Google-java-formatter for java, black for python, etc. This has improved our code review as there are fewer style discussions and users are less likely to miss or change large chunks of code. For k8s objects, having a standard order makes looking at and reviewing diffs much easier.

We don't really want to build our whole system around a feature that will be removed in kustomize v5, but the alternative seems to be pretty heavy-handed. Needing to add a new formatter argument to every kustomization.yaml file. It also seems a bit strange for users to run kustomize build to have their source formatted.

Cheer,
Adam

@matthewhembree
Copy link

matthewhembree commented Sep 13, 2022

I agree that kustomize build is the wrong place to do formatting. I don't think formatting should be in-band. I can't think of a programming language that does formatting that way.

@goutkannan
Copy link

I agree with the last 2 comments, I wrote a couple of go/exec plugins and they go deprecated in favor of KRM plugins. KRM plugins are still in the Alpha stage, I am worried that those types of plugins would be temporary too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

7 participants