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

Some generated files are not well-formated #149

Closed
lichuqiang opened this issue May 14, 2018 · 2 comments
Closed

Some generated files are not well-formated #149

lichuqiang opened this issue May 14, 2018 · 2 comments

Comments

@lichuqiang
Copy link
Contributor

lichuqiang commented May 14, 2018

When walking through the files generated through kubebuilder, I found codes in some files are not well-aligned, for example in cmd/controller-manager/main.go:

import (
        "flag"
        "log"
    
    // Import auth/gcp to connect to GKE clusters remotely
    _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
    
    configlib "github.com/kubernetes-sigs/kubebuilder/pkg/config"
        "github.com/kubernetes-sigs/kubebuilder/pkg/inject/run"
        "github.com/kubernetes-sigs/kubebuilder/pkg/install"
    "github.com/kubernetes-sigs/kubebuilder/pkg/signals"
        extensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
    
    "example.com/pkg/inject"
    "example.com/pkg/inject/args"
)

var installCRDs = flag.Bool("install-crds", true, "install the CRDs used by the controller as part of startup")

// Controller-manager main.
func main() {
        flag.Parse()

    stopCh := signals.SetupSignalHandler()

Of course a user can easily format the files via go fmt, but for better experience, I think we'd better

  1. modify existing templates and the place to generate files, to ensure the generated codes are well-formated
  2. or maybe we can exec go format for output files automatically

@pwittrock WDYT?

@Liujingfang1
Copy link
Contributor

@lichuqiang I found a recent comment #147 exec go format on the generated codes.

@lichuqiang
Copy link
Contributor Author

@Liujingfang1 Thanks!
Closing the issue since it's already fixed by #147

luffyao pushed a commit to luffyao/kubebuilder that referenced this issue Aug 6, 2020
…al/cert-manager

翻译 1.9.1 Deploying the cert manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants