From b898b97a3ef095e3cb56418ec6ac24756ed4ffd2 Mon Sep 17 00:00:00 2001 From: Christoph Mewes Date: Tue, 28 Jan 2025 14:27:03 +0100 Subject: [PATCH] s/Loodse/Kubermatic/g, general cleanup (#103) * rename Loodse to Kubermatic, update CoC * remove ex employees from owners list * tidy up readme a bit * fix boilerplates * fix lint issues * align efficiency claims --- CONTRIBUTING.md | 29 +++++++----- NOTICE | 8 ++-- OWNERS | 4 -- README.md | 49 +++++++++++---------- code-of-conduct.md | 4 +- hack/boilerplate/boilerplate.Dockerfile.txt | 3 +- hack/boilerplate/boilerplate.Makefile.txt | 3 +- hack/boilerplate/boilerplate.bzl.txt | 3 +- hack/boilerplate/boilerplate.generatego.txt | 3 +- hack/boilerplate/boilerplate.go | 48 +++++++------------- hack/boilerplate/boilerplate.go.txt | 3 +- hack/boilerplate/boilerplate.py.txt | 2 +- hack/boilerplate/boilerplate.sh.txt | 2 +- hack/boilerplate/boilerplate_test.go | 2 +- hack/boilerplate/test/pass.go | 2 +- hack/boilerplate/test/pass.py | 2 +- hack/verify-boilerplate.sh | 2 +- 17 files changed, 75 insertions(+), 94 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1ec976..2e49c2b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ # How to Contribute -Loodse projects are [Apache 2.0 licensed](LICENSE) and accept contributions via -GitHub pull requests. This document outlines some of the conventions on +Kubermatic projects are [Apache 2.0 licensed](LICENSE) and accept contributions +via GitHub pull requests. This document outlines some of the conventions on development workflow, commit message formatting, contact points and other resources to make it easier to get your contribution accepted. @@ -12,7 +12,8 @@ Origin (DCO). This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution. See the [DCO](DCO) file for details. -Any copyright notices in this repo should specify the authors as "the Loodse XXX project contributors". +Any copyright notices in this repo should specify the authors as "The Kubermatic +fubectl Authors". To sign your work, just add a line like this at the end of your commit message: @@ -22,26 +23,30 @@ Signed-off-by: Joe Example This can easily be done with the `--signoff` option to `git commit`. -Note that we're requiring all commits in a PR to be signed-off. If you already created a PR, you can sign-off all existing commits by rebasing with the `--signoff` flag. +Note that we're requiring all commits in a PR to be signed-off. If you already +created a PR, you can sign-off all existing commits by rebasing with the +`--signoff` flag. ``` git rebase --signoff origin/master ``` -By doing this you state that you can certify the following (from https://developercertificate.org/): +By doing this you state that you can certify the following +(from https://developercertificate.org/): -## Email and Chat +## Chat -The XXX project currently uses the general Loodse email list and Slack channel: -- Email: [loodse-dev](https://groups.google.com/forum/#!forum/loodse-dev) -- Slack: #[Slack](http://slack.kubermatic.io/) on Slack +The fubectl project currently uses the general Kubermatic Slack channel: -Please avoid emailing maintainers found in the MAINTAINERS file directly. They -are very busy and read the mailing lists. +- Slack: #[Slack](http://slack.kubermatic.io/) on Slack ## Reporting a security vulnerability -Due to their public nature, GitHub and mailing lists are not appropriate places for reporting vulnerabilities. If you suspect you have found a security vulnerability, please do not file a GitHub issue, but instead email security@loodse.com with the full details, including steps to reproduce the issue. +Due to their public nature, GitHub and mailing lists are not appropriate places +for reporting vulnerabilities. If you suspect you have found a security +vulnerability, please do not file a GitHub issue, but instead email +security@kubermatic.com with the full details, including steps to reproduce the +issue. ## Getting Started diff --git a/NOTICE b/NOTICE index cfce6d7..eea91ff 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ -Loodse Project -Copyright 2019 Loodse GmbH +fubectl +Copyright 2019 Kubermatic GmbH -This product includes software developed at Loodse GmbH. -(http://www.loodse.com/). +This product includes software developed at Kubermatic GmbH. +(http://www.kubermatic.com/). diff --git a/OWNERS b/OWNERS index ab85fd6..efae635 100644 --- a/OWNERS +++ b/OWNERS @@ -2,16 +2,12 @@ approvers: - toschneck - - thz - - eqrx - scheeles - xrstf - kron4eg reviewers: - toschneck - - thz - - eqrx - scheeles - xrstf - kron4eg diff --git a/README.md b/README.md index cfc7f8b..291a43f 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ Because it's fancy-kubectl ! ## Installation -You can directly download the [`fubectl.source`](https://rawgit.com/kubermatic/fubectl/master/fubectl.source) +You can directly download the [`fubectl.source`](https://rawgit.com/kubermatic/fubectl/main/fubectl.source) and save it in some directory. Download: ```bash -curl -LO https://rawgit.com/kubermatic/fubectl/master/fubectl.source +curl -LO https://rawgit.com/kubermatic/fubectl/main/fubectl.source ``` then add to your .bashrc/.zshrc file: @@ -28,9 +28,9 @@ choice. ## What can it do? -### k - alias for kubectl +### `k` – alias for kubectl -Like g for git but 133% more effective! +Like g for git but 233% more effective! Examples: - `k get nodes` @@ -42,8 +42,7 @@ Usage: --- -### kw - alias for 'watch kubectl' - +### `kw` – alias for 'watch kubectl' Examples: - `kw nodes` @@ -52,7 +51,7 @@ Examples: --- -### kall - All pods in all namespaces +### `kall` – All pods in all namespaces Get all pods @@ -61,7 +60,7 @@ Usage: --- -### kwall - Watch all pods in all namespaces +### `kwall` – Watch all pods in all namespaces Watch all pods in all namespaces every 2 seconds. @@ -70,7 +69,7 @@ Usage: --- -### kdes - Describe a resource +### `kdes` – Describe a resource Examples: - `kdes pod` @@ -82,7 +81,7 @@ Usage: --- -### kdel - Delete a resource +### `kdel` – Delete a resource Examples: - `kdel pod` @@ -94,7 +93,7 @@ Usage: --- -### klog - Print the logs for a container in a pod +### `klog` – Print the logs for a container in a pod Examples: - `klog` - Print the last 10 lines @@ -107,7 +106,7 @@ Usage: --- -### kex - Execute a command in a container +### `kex` – Execute a command in a container Examples: - `kex bash` - Start a bash in a container @@ -118,7 +117,7 @@ Usage: --- -### kfor - Forward one or more local ports to a pod +### `kfor` – Forward one or more local ports to a pod Examples: - `kfor 8000` - Forwards port 8000 to a pod @@ -129,7 +128,7 @@ Usage: --- -### ksearch - Search for string in resources +### `ksearch` – Search for string in resources Examples: - `// TODO` @@ -139,20 +138,23 @@ Usage: --- -### kcl - Displays one or many contexts from the kubeconfig file +### `kcl` – Displays one or many contexts from the kubeconfig file + Context list Usage: ![kGif](./demo_src/kcl.gif) + --- -### kcs - Sets the current context + +### `kcs` – Sets the current context Usage: ![kGif](./demo_src/kcs.gif) --- -### kcns - Switch the default namespace +### `kcns` – Switch the default namespace `kcns` - Set the current default namespace from list `kcns kube-system` - Set kube-system as default namespace immediately @@ -161,20 +163,21 @@ Usage: ![kGif](./demo_src/kcns.gif) --- -### kdebug - Start a debugging Pod in a Cluster +### `kdebug` – Start a debugging Pod in a Cluster Usage: ![kGif](./demo_src/kdebug.gif) --- -### kp - Open the Kubernetes dashboard +### `kp` – Open the Kubernetes dashboard Opens `localhost:8001/ui` in your browser and runs `kubectl proxy` --- ## Extra! + Do you want to have the current kubecontext in your prompt?: ```bash export PS1="\[$(kube_ctx_name)\] $PS1" @@ -189,8 +192,8 @@ export PS1="\[$(kube_ctx_namespace)\] $PS1" `fubectl` can be customized via following environment variables -* `FUBECTL_WATCH_CMD` - alterative `watch` command, e.g. [viddy](https://github.com/sachaos/viddy) -* `FUBECTL_NO_KCL` - disable `kcl` alias, since it may conflict with [KCL language CLI](https://www.kcl-lang.io/) +* `FUBECTL_WATCH_CMD` – alterative `watch` command, e.g. [viddy](https://github.com/sachaos/viddy) +* `FUBECTL_NO_KCL` – disable `kcl` alias, since it may conflict with [KCL language CLI](https://www.kcl-lang.io/) ## Troubleshooting @@ -212,8 +215,8 @@ Feedback and discussion are available on [Kubermatic Slack][15]. * We welcome pull requests. Feel free to dig through the [issues][1] and jump in. [1]: https://github.com/kubermatic/fubectl/issues -[2]: https://github.com/kubermatic/fubectl/blob/master/CONTRIBUTING.md -[4]: https://github.com/kubermatic/fubectl/blob/master/CODE_OF_CONDUCT.md +[2]: https://github.com/kubermatic/fubectl/blob/main/CONTRIBUTING.md +[4]: https://github.com/kubermatic/fubectl/blob/main/code-of-conduct.md [12]: https://kubermatic.slack.com/messages/fubectl [15]: http://slack.kubermatic.io/ diff --git a/code-of-conduct.md b/code-of-conduct.md index a8a0485..4a51271 100644 --- a/code-of-conduct.md +++ b/code-of-conduct.md @@ -1,4 +1,4 @@ -# Loodse Community Code of Conduct +# Kubermatic Community Code of Conduct ## Contributor Code of Conduct @@ -32,6 +32,6 @@ Conduct may be permanently removed from the project team. This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the Loodse Conduct Committee via coc@loodse.com. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the Kubermatic Conduct Committee via coc@kubermatic.com. This Code of Conduct is adapted from the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md) and [Contributor Covenant](http://contributor-covenant.org/version/1/2/0/), version 1.2.0. diff --git a/hack/boilerplate/boilerplate.Dockerfile.txt b/hack/boilerplate/boilerplate.Dockerfile.txt index 505b9b9..9b9dad6 100644 --- a/hack/boilerplate/boilerplate.Dockerfile.txt +++ b/hack/boilerplate/boilerplate.Dockerfile.txt @@ -1,4 +1,4 @@ -# Copyright YEAR The XXX Authors. +# Copyright YEAR The Kubermatic fubectl Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/hack/boilerplate/boilerplate.Makefile.txt b/hack/boilerplate/boilerplate.Makefile.txt index 505b9b9..9b9dad6 100644 --- a/hack/boilerplate/boilerplate.Makefile.txt +++ b/hack/boilerplate/boilerplate.Makefile.txt @@ -1,4 +1,4 @@ -# Copyright YEAR The XXX Authors. +# Copyright YEAR The Kubermatic fubectl Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/hack/boilerplate/boilerplate.bzl.txt b/hack/boilerplate/boilerplate.bzl.txt index 505b9b9..9b9dad6 100644 --- a/hack/boilerplate/boilerplate.bzl.txt +++ b/hack/boilerplate/boilerplate.bzl.txt @@ -1,4 +1,4 @@ -# Copyright YEAR The XXX Authors. +# Copyright YEAR The Kubermatic fubectl Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/hack/boilerplate/boilerplate.generatego.txt b/hack/boilerplate/boilerplate.generatego.txt index e4a44b7..693f9f3 100644 --- a/hack/boilerplate/boilerplate.generatego.txt +++ b/hack/boilerplate/boilerplate.generatego.txt @@ -1,5 +1,5 @@ /* -Copyright The XXX Authors. +Copyright The Kubermatic fubectl Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,4 +13,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ - diff --git a/hack/boilerplate/boilerplate.go b/hack/boilerplate/boilerplate.go index 1f71be0..bbe0fd5 100644 --- a/hack/boilerplate/boilerplate.go +++ b/hack/boilerplate/boilerplate.go @@ -1,5 +1,5 @@ /* -Copyright YEAR The XXX Authors. +Copyright 2025 The Kubermatic fubectl Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import ( "flag" "fmt" "io" - "io/ioutil" "os" "path" "path/filepath" @@ -70,41 +69,24 @@ const ( var ( // skipped files and directories skipped = map[string]struct{}{ - "bin": struct{}{}, - "Godeps": struct{}{}, - ".git": struct{}{}, - "vendor": struct{}{}, - "_gopath": struct{}{}, - "_output": struct{}{}, - "cluster/env.sh": struct{}{}, - "test/e2e/generated/bindata.go": struct{}{}, - "staging/src/k8s.io/kubectl/pkg/generated/bindata.go": struct{}{}, - "hack/boilerplate/test": struct{}{}, - "pkg/apis/kubeadm/v1beta1/bootstraptokenstring.go": struct{}{}, - "pkg/apis/kubeadm/v1beta1/types.go": struct{}{}, - "pkg/apis/kubeadm/v1beta1/zz_generated.deepcopy.go": struct{}{}, - // third_party folders - "third_party": struct{}{}, - "staging/src/k8s.io/apimachinery/third_party": struct{}{}, - "staging/src/k8s.io/client-go/third_party": struct{}{}, - "staging/src/k8s.io/code-generator/third_party": struct{}{}, + ".git": {}, + "hack/boilerplate/test": {}, } // list all the files contain 'DO NOT EDIT', but are not generated skippedUngeneratedFiles = map[string]struct{}{ - "hack/boilerplate/boilerplate.py": struct{}{}, - "hack/lib/swagger.sh": struct{}{}, + "hack/boilerplate/boilerplate.go": {}, } ) func main() { - flag.StringVar(&boilerplateDir, "boilerplate-dir", "./hack/boilerplate", "Directory containing the boilerplate files for file extensions.") + flag.StringVar(&boilerplateDir, "boilerplate-dir", "./hack/boilerplate", "directory containing the boilerplate files for file extensions.") flag.BoolVar(&verbose, "verbose", false, "give verbose output regarding why a file does not pass.") flag.Parse() failed, err := run(os.Stdout, rootDir) if err != nil { - fmt.Fprintf(os.Stderr, err.Error()+"\n") + fmt.Fprintln(os.Stderr, err.Error()) os.Exit(1) } if failed { @@ -117,14 +99,14 @@ func main() { func run(out io.Writer, rootDir string) (failed bool, err error) { boilerplateMap, err := getBoilerplateForExtensions() if err != nil { - return false, fmt.Errorf("getting boilerplate files: %v", err) + return false, fmt.Errorf("getting boilerplate files: %w", err) } files := flag.Args() if len(files) == 0 { files, err = getFiles(rootDir, boilerplateMap) if err != nil { - return false, fmt.Errorf("getting files to check: %v", err) + return false, fmt.Errorf("getting files to check: %w", err) } } @@ -132,7 +114,7 @@ func run(out io.Writer, rootDir string) (failed bool, err error) { for _, file := range files { ok, err := filePasses(file, boilerplateMap, out) if err != nil { - return false, fmt.Errorf("checking file: %v", err) + return false, fmt.Errorf("checking file: %w", err) } if !ok { failedFiles = append(failedFiles, file) @@ -192,9 +174,9 @@ func isGenerated(filename string, content []byte) bool { } func filePasses(filename string, boilerplateMap map[string]string, out io.Writer) (bool, error) { - fileContent, err := ioutil.ReadFile(filename) + fileContent, err := os.ReadFile(filename) if err != nil { - return false, fmt.Errorf("opening file: %v", err) + return false, fmt.Errorf("opening file: %w", err) } // determine if the file is automatically generated @@ -278,7 +260,7 @@ func fileExtension(filename string) string { return "" } - return base[i+1 : len(base)] + return base[i+1:] } // getBoilerplateForExtensions reads the boilerplate.*.txt files in the directory @@ -288,7 +270,7 @@ func getBoilerplateForExtensions() (map[string]string, error) { matches, err := filepath.Glob(path.Join(boilerplateDir, "boilerplate.*.txt")) if err != nil { - return nil, fmt.Errorf("finding files via glob: %v", err) + return nil, fmt.Errorf("finding files via glob: %w", err) } for _, match := range matches { parts := strings.Split(path.Base(match), ".") @@ -296,9 +278,9 @@ func getBoilerplateForExtensions() (map[string]string, error) { return nil, fmt.Errorf("wrong filename for boilerplate file: %q should be \"boilerplate.EXTENSION.txt\"", match) } - content, err := ioutil.ReadFile(match) + content, err := os.ReadFile(match) if err != nil { - return nil, fmt.Errorf("reading file: %v", err) + return nil, fmt.Errorf("reading file: %w", err) } // map file extension to the boilerplate for the file diff --git a/hack/boilerplate/boilerplate.go.txt b/hack/boilerplate/boilerplate.go.txt index bb10695..0ebf1c4 100644 --- a/hack/boilerplate/boilerplate.go.txt +++ b/hack/boilerplate/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright YEAR The XXX Authors. +Copyright YEAR The Kubermatic fubectl Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,4 +13,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ - diff --git a/hack/boilerplate/boilerplate.py.txt b/hack/boilerplate/boilerplate.py.txt index f0703d5..9b9dad6 100644 --- a/hack/boilerplate/boilerplate.py.txt +++ b/hack/boilerplate/boilerplate.py.txt @@ -1,4 +1,4 @@ -# Copyright YEAR The XXX Authors. +# Copyright YEAR The Kubermatic fubectl Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/boilerplate.sh.txt b/hack/boilerplate/boilerplate.sh.txt index f0703d5..9b9dad6 100644 --- a/hack/boilerplate/boilerplate.sh.txt +++ b/hack/boilerplate/boilerplate.sh.txt @@ -1,4 +1,4 @@ -# Copyright YEAR The XXX Authors. +# Copyright YEAR The Kubermatic fubectl Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/boilerplate_test.go b/hack/boilerplate/boilerplate_test.go index e50a9f9..e988c81 100644 --- a/hack/boilerplate/boilerplate_test.go +++ b/hack/boilerplate/boilerplate_test.go @@ -1,5 +1,5 @@ /* -Copyright YEAR The XXX Authors. +Copyright 2025 The Kubermatic fubectl Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/test/pass.go b/hack/boilerplate/test/pass.go index 07efc06..0f5a80a 100644 --- a/hack/boilerplate/test/pass.go +++ b/hack/boilerplate/test/pass.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The XXX Authors. +Copyright 2019 The Kubermatic fubectl Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/test/pass.py b/hack/boilerplate/test/pass.py index 95ef5f8..9358d49 100644 --- a/hack/boilerplate/test/pass.py +++ b/hack/boilerplate/test/pass.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright 2019 The XXX Authors. +# Copyright 2019 The Kubermatic fubectl Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hack/verify-boilerplate.sh b/hack/verify-boilerplate.sh index 99b768d..c4c444e 100755 --- a/hack/verify-boilerplate.sh +++ b/hack/verify-boilerplate.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright YEAR The XXX Authors. +# Copyright 2025 The Kubermatic fubectl Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.