1
0
mirror of synced 2026-02-06 19:05:55 +00:00

Rename gotk binary to flux

Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
Hidde Beydals
2020-10-29 14:37:07 +01:00
parent 9916a53761
commit e2752e4508
168 changed files with 767 additions and 887 deletions

View File

@@ -43,22 +43,22 @@ the bootstrap command will perform an upgrade if needed.`,
export GITHUB_TOKEN=<my-token>
# Run bootstrap for a private repo owned by a GitHub organization
gotk bootstrap github --owner=<organization> --repository=<repo name>
flux bootstrap github --owner=<organization> --repository=<repo name>
# Run bootstrap for a private repo and assign organization teams to it
gotk bootstrap github --owner=<organization> --repository=<repo name> --team=<team1 slug> --team=<team2 slug>
flux bootstrap github --owner=<organization> --repository=<repo name> --team=<team1 slug> --team=<team2 slug>
# Run bootstrap for a repository path
gotk bootstrap github --owner=<organization> --repository=<repo name> --path=dev-cluster
flux bootstrap github --owner=<organization> --repository=<repo name> --path=dev-cluster
# Run bootstrap for a public repository on a personal account
gotk bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true
flux bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true
# Run bootstrap for a private repo hosted on GitHub Enterprise
gotk bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain>
flux bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain>
# Run bootstrap for a an existing repository with a branch named main
gotk bootstrap github --owner=<organization> --repository=<repo name> --branch=main
flux bootstrap github --owner=<organization> --repository=<repo name> --branch=main
`,
RunE: bootstrapGitHubCmdRun,
}
@@ -105,7 +105,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
return err
}
repository, err := git.NewRepository(ghRepository, ghOwner, ghHostname, ghToken, "gotk", ghOwner+"@users.noreply.github.com")
repository, err := git.NewRepository(ghRepository, ghOwner, ghHostname, ghToken, "flux", ghOwner+"@users.noreply.github.com")
if err != nil {
return err
}
@@ -214,9 +214,9 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("generating deploy key failed: %w", err)
}
keyName := "gotk"
keyName := "flux"
if ghPath != "" {
keyName = fmt.Sprintf("gotk-%s", ghPath)
keyName = fmt.Sprintf("flux-%s", ghPath)
}
if changed, err := provider.AddDeployKey(ctx, repository, key, keyName); err != nil {

View File

@@ -45,22 +45,22 @@ the bootstrap command will perform an upgrade if needed.`,
export GITLAB_TOKEN=<my-token>
# Run bootstrap for a private repo using HTTPS token authentication
gotk bootstrap gitlab --owner=<group> --repository=<repo name>
flux bootstrap gitlab --owner=<group> --repository=<repo name>
# Run bootstrap for a private repo using SSH authentication
gotk bootstrap gitlab --owner=<group> --repository=<repo name> --ssh-hostname=gitlab.com
flux bootstrap gitlab --owner=<group> --repository=<repo name> --ssh-hostname=gitlab.com
# Run bootstrap for a repository path
gotk bootstrap gitlab --owner=<group> --repository=<repo name> --path=dev-cluster
flux bootstrap gitlab --owner=<group> --repository=<repo name> --path=dev-cluster
# Run bootstrap for a public repository on a personal account
gotk bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal=true
flux bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal=true
# Run bootstrap for a private repo hosted on a GitLab server
gotk bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain>
flux bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain>
# Run bootstrap for a an existing repository with a branch named main
gotk bootstrap gitlab --owner=<organization> --repository=<repo name> --branch=main
flux bootstrap gitlab --owner=<organization> --repository=<repo name> --branch=main
`,
RunE: bootstrapGitLabCmdRun,
}
@@ -99,7 +99,7 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
return err
}
repository, err := git.NewRepository(glRepository, glOwner, glHostname, glToken, "gotk", glOwner+"@users.noreply.gitlab.com")
repository, err := git.NewRepository(glRepository, glOwner, glHostname, glToken, "flux", glOwner+"@users.noreply.gitlab.com")
if err != nil {
return err
}
@@ -195,9 +195,9 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("generating deploy key failed: %w", err)
}
keyName := "gotk"
keyName := "flux"
if glPath != "" {
keyName = fmt.Sprintf("gotk-%s", glPath)
keyName = fmt.Sprintf("flux-%s", glPath)
}
if changed, err := provider.AddDeployKey(ctx, repository, key, keyName); err != nil {

View File

@@ -37,10 +37,10 @@ var checkCmd = &cobra.Command{
Long: `The check command will perform a series of checks to validate that
the local environment is configured correctly and if the installed components are healthy.`,
Example: ` # Run pre-installation checks
gotk check --pre
flux check --pre
# Run installation checks
gotk check
flux check
`,
RunE: runCheckCmd,
}

View File

@@ -27,12 +27,12 @@ var completionBashCmd = &cobra.Command{
Short: "Generates bash completion scripts",
Example: `To load completion run
. <(gotk completion bash)
. <(flux completion bash)
To configure your bash shell to load completions for each session add to your bashrc
# ~/.bashrc or ~/.profile
command -v gotk >/dev/null && . <(gotk completion bash)
command -v flux >/dev/null && . <(flux completion bash)
`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenBashCompletion(os.Stdout)

View File

@@ -27,11 +27,11 @@ var completionFishCmd = &cobra.Command{
Short: "Generates fish completion scripts",
Example: `To load completion run
. <(gotk completion fish)
. <(flux completion fish)
To configure your fish shell to load completions for each session write this script to your completions dir:
gotk completion fish > ~/.config/fish/completions/gotk
flux completion fish > ~/.config/fish/completions/flux
See http://fishshell.com/docs/current/index.html#completion-own for more details
`,

View File

@@ -27,19 +27,19 @@ var completionPowerShellCmd = &cobra.Command{
Short: "Generates powershell completion scripts",
Example: `To load completion run
. <(gotk completion powershell)
. <(flux completion powershell)
To configure your powershell shell to load completions for each session add to your powershell profile
Windows:
cd "$env:USERPROFILE\Documents\WindowsPowerShell\Modules"
gotk completion >> gotk-completion.ps1
flux completion >> flux-completion.ps1
Linux:
cd "${XDG_CONFIG_HOME:-"$HOME/.config/"}/powershell/modules"
gotk completion >> gotk-completions.ps1
flux completion >> flux-completions.ps1
`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenPowerShellCompletion(os.Stdout)

View File

@@ -27,20 +27,20 @@ var completionZshCmd = &cobra.Command{
Short: "Generates zsh completion scripts",
Example: `To load completion run
. <(gotk completion zsh) && compdef _gotk gotk
. <(flux completion zsh) && compdef _flux flux
To configure your zsh shell to load completions for each session add to your zshrc
# ~/.zshrc or ~/.profile
command -v gotk >/dev/null && . <(gotk completion zsh) && compdef _gotk gotk
command -v flux >/dev/null && . <(flux completion zsh) && compdef _flux flux
or write a cached file in one of the completion directories in your ${fpath}:
echo "${fpath// /\n}" | grep -i completion
gotk completions zsh > _gotk
flux completions zsh > _flux
mv _gotk ~/.oh-my-zsh/completions # oh-my-zsh
mv _gotk ~/.zprezto/modules/completion/external/src/ # zprezto
mv _flux ~/.oh-my-zsh/completions # oh-my-zsh
mv _flux ~/.zprezto/modules/completion/external/src/ # zprezto
`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenZshCompletion(os.Stdout)

View File

@@ -39,7 +39,7 @@ var createAlertCmd = &cobra.Command{
Short: "Create or update a Alert resource",
Long: "The create alert command generates a Alert resource.",
Example: ` # Create an Alert for kustomization events
gotk create alert \
flux create alert \
--event-severity info \
--event-source Kustomization/flux-system \
--provider-ref slack \

View File

@@ -38,14 +38,14 @@ var createAlertProviderCmd = &cobra.Command{
Short: "Create or update a Provider resource",
Long: "The create alert-provider command generates a Provider resource.",
Example: ` # Create a Provider for a Slack channel
gotk create alert-provider slack \
flux create alert-provider slack \
--type slack \
--channel general \
--address https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK \
--secret-ref webhook-url
# Create a Provider for a Github repository
gotk create alert-provider github-podinfo \
flux create alert-provider github-podinfo \
--type github \
--address https://github.com/stefanprodan/podinfo \
--secret-ref github-token

View File

@@ -43,44 +43,44 @@ var createHelmReleaseCmd = &cobra.Command{
Short: "Create or update a HelmRelease resource",
Long: "The helmrelease create command generates a HelmRelease resource for a given HelmRepository source.",
Example: ` # Create a HelmRelease with a chart from a HelmRepository source
gotk create hr podinfo \
flux create hr podinfo \
--interval=10m \
--source=HelmRepository/podinfo \
--chart=podinfo \
--chart-version=">4.0.0"
# Create a HelmRelease with a chart from a GitRepository source
gotk create hr podinfo \
flux create hr podinfo \
--interval=10m \
--source=GitRepository/podinfo \
--chart=./charts/podinfo
# Create a HelmRelease with a chart from a Bucket source
gotk create hr podinfo \
flux create hr podinfo \
--interval=10m \
--source=Bucket/podinfo \
--chart=./charts/podinfo
# Create a HelmRelease with values from a local YAML file
gotk create hr podinfo \
flux create hr podinfo \
--source=HelmRepository/podinfo \
--chart=podinfo \
--values=./my-values.yaml
# Create a HelmRelease with a custom release name
gotk create hr podinfo \
flux create hr podinfo \
--release-name=podinfo-dev
--source=HelmRepository/podinfo \
--chart=podinfo \
# Create a HelmRelease targeting another namespace than the resource
gotk create hr podinfo \
flux create hr podinfo \
--target-namespace=default \
--source=HelmRepository/podinfo \
--chart=podinfo
# Create a HelmRelease definition on disk without applying it on the cluster
gotk create hr podinfo \
flux create hr podinfo \
--source=HelmRepository/podinfo \
--chart=podinfo \
--values=./values.yaml \

View File

@@ -43,7 +43,7 @@ var createKsCmd = &cobra.Command{
Short: "Create or update a Kustomization resource",
Long: "The kustomization source create command generates a Kustomize resource for a given source.",
Example: ` # Create a Kustomization resource from a source at a given path
gotk create kustomization contour \
flux create kustomization contour \
--source=contour \
--path="./examples/contour/" \
--prune=true \
@@ -54,7 +54,7 @@ var createKsCmd = &cobra.Command{
--health-check-timeout=3m
# Create a Kustomization resource that depends on the previous one
gotk create kustomization webapp \
flux create kustomization webapp \
--depends-on=contour \
--source=webapp \
--path="./deploy/overlays/dev" \
@@ -63,7 +63,7 @@ var createKsCmd = &cobra.Command{
--validation=client
# Create a Kustomization resource that references a Bucket
gotk create kustomization secrets \
flux create kustomization secrets \
--source=Bucket/secrets \
--prune=true \
--interval=5m

View File

@@ -38,7 +38,7 @@ var createReceiverCmd = &cobra.Command{
Short: "Create or update a Receiver resource",
Long: "The create receiver command generates a Receiver resource.",
Example: ` # Create a Receiver
gotk create receiver github-receiver \
flux create receiver github-receiver \
--type github \
--event ping \
--event push \

View File

@@ -42,7 +42,7 @@ var createSourceBucketCmd = &cobra.Command{
The create source bucket command generates a Bucket resource and waits for it to be downloaded.
For Buckets with static authentication, the credentials are stored in a Kubernetes secret.`,
Example: ` # Create a source from a Buckets using static authentication
gotk create source bucket podinfo \
flux create source bucket podinfo \
--bucket-name=podinfo \
--endpoint=minio.minio.svc.cluster.local:9000 \
--insecure=true \
@@ -51,7 +51,7 @@ For Buckets with static authentication, the credentials are stored in a Kubernet
--interval=10m
# Create a source from an Amazon S3 Bucket using IAM authentication
gotk create source bucket podinfo \
flux create source bucket podinfo \
--bucket-name=podinfo \
--provider=aws \
--endpoint=s3.amazonaws.com \

View File

@@ -50,35 +50,35 @@ The create source git command generates a GitRepository resource and waits for i
For Git over SSH, host and SSH keys are automatically generated and stored in a Kubernetes secret.
For private Git repositories, the basic authentication credentials are stored in a Kubernetes secret.`,
Example: ` # Create a source from a public Git repository master branch
gotk create source git podinfo \
flux create source git podinfo \
--url=https://github.com/stefanprodan/podinfo \
--branch=master
# Create a source from a Git repository pinned to specific git tag
gotk create source git podinfo \
flux create source git podinfo \
--url=https://github.com/stefanprodan/podinfo \
--tag="3.2.3"
# Create a source from a public Git repository tag that matches a semver range
gotk create source git podinfo \
flux create source git podinfo \
--url=https://github.com/stefanprodan/podinfo \
--tag-semver=">=3.2.0 <3.3.0"
# Create a source from a Git repository using SSH authentication
gotk create source git podinfo \
flux create source git podinfo \
--url=ssh://git@github.com/stefanprodan/podinfo \
--branch=master
# Create a source from a Git repository using SSH authentication and an
# ECDSA P-521 curve public key
gotk create source git podinfo \
flux create source git podinfo \
--url=ssh://git@github.com/stefanprodan/podinfo \
--branch=master \
--ssh-key-algorithm=ecdsa \
--ssh-ecdsa-curve=p521
# Create a source from a Git repository using basic authentication
gotk create source git podinfo \
flux create source git podinfo \
--url=https://github.com/stefanprodan/podinfo \
--username=username \
--password=password

View File

@@ -42,18 +42,18 @@ var createSourceHelmCmd = &cobra.Command{
The create source helm command generates a HelmRepository resource and waits for it to fetch the index.
For private Helm repositories, the basic authentication credentials are stored in a Kubernetes secret.`,
Example: ` # Create a source from a public Helm repository
gotk create source helm podinfo \
flux create source helm podinfo \
--url=https://stefanprodan.github.io/podinfo \
--interval=10m
# Create a source from a Helm repository using basic authentication
gotk create source helm podinfo \
flux create source helm podinfo \
--url=https://stefanprodan.github.io/podinfo \
--username=username \
--password=password
# Create a source from a Helm repository using TLS authentication
gotk create source helm podinfo \
flux create source helm podinfo \
--url=https://stefanprodan.github.io/podinfo \
--cert-file=./cert.crt \
--key-file=./key.crt \

View File

@@ -41,12 +41,12 @@ var createTenantCmd = &cobra.Command{
The create tenant command generates namespaces and role bindings to limit the
reconcilers scope to the tenant namespaces.`,
Example: ` # Create a tenant with access to a namespace
gotk create tenant dev-team \
flux create tenant dev-team \
--with-namespace=frontend \
--label=environment=dev
# Generate tenant namespaces and role bindings in YAML format
gotk create tenant dev-team \
flux create tenant dev-team \
--with-namespace=frontend \
--with-namespace=backend \
--export > dev-team.yaml

View File

@@ -33,7 +33,7 @@ var deleteAlertCmd = &cobra.Command{
Short: "Delete a Alert resource",
Long: "The delete alert command removes the given Alert from the cluster.",
Example: ` # Delete an Alert and the Kubernetes resources created by it
gotk delete alert main
flux delete alert main
`,
RunE: deleteAlertCmdRun,
}

View File

@@ -33,7 +33,7 @@ var deleteAlertProviderCmd = &cobra.Command{
Short: "Delete a Provider resource",
Long: "The delete alert-provider command removes the given Provider from the cluster.",
Example: ` # Delete a Provider and the Kubernetes resources created by it
gotk delete alert-provider slack
flux delete alert-provider slack
`,
RunE: deleteAlertProviderCmdRun,
}

View File

@@ -34,7 +34,7 @@ var deleteHelmReleaseCmd = &cobra.Command{
Short: "Delete a HelmRelease resource",
Long: "The delete helmrelease command removes the given HelmRelease from the cluster.",
Example: ` # Delete a Helm release and the Kubernetes resources created by it
gotk delete hr podinfo
flux delete hr podinfo
`,
RunE: deleteHelmReleaseCmdRun,
}

View File

@@ -33,7 +33,7 @@ var deleteKsCmd = &cobra.Command{
Short: "Delete a Kustomization resource",
Long: "The delete kustomization command deletes the given Kustomization from the cluster.",
Example: ` # Delete a kustomization and the Kubernetes resources created by it
gotk delete kustomization podinfo
flux delete kustomization podinfo
`,
RunE: deleteKsCmdRun,
}

View File

@@ -33,7 +33,7 @@ var deleteReceiverCmd = &cobra.Command{
Short: "Delete a Receiver resource",
Long: "The delete receiver command removes the given Receiver from the cluster.",
Example: ` # Delete an Receiver and the Kubernetes resources created by it
gotk delete receiver main
flux delete receiver main
`,
RunE: deleteReceiverCmdRun,
}

View File

@@ -32,7 +32,7 @@ var deleteSourceBucketCmd = &cobra.Command{
Short: "Delete a Bucket source",
Long: "The delete source bucket command deletes the given Bucket from the cluster.",
Example: ` # Delete a Bucket source
gotk delete source bucket podinfo
flux delete source bucket podinfo
`,
RunE: deleteSourceBucketCmdRun,
}

View File

@@ -32,7 +32,7 @@ var deleteSourceGitCmd = &cobra.Command{
Short: "Delete a GitRepository source",
Long: "The delete source git command deletes the given GitRepository from the cluster.",
Example: ` # Delete a Git repository
gotk delete source git podinfo
flux delete source git podinfo
`,
RunE: deleteSourceGitCmdRun,
}

View File

@@ -32,7 +32,7 @@ var deleteSourceHelmCmd = &cobra.Command{
Short: "Delete a HelmRepository source",
Long: "The delete source helm command deletes the given HelmRepository from the cluster.",
Example: ` # Delete a Helm repository
gotk delete source helm podinfo
flux delete source helm podinfo
`,
RunE: deleteSourceHelmCmdRun,
}

View File

@@ -35,10 +35,10 @@ var exportAlertCmd = &cobra.Command{
Short: "Export Alert resources in YAML format",
Long: "The export alert command exports one or all Alert resources in YAML format.",
Example: ` # Export all Alert resources
gotk export alert --all > alerts.yaml
flux export alert --all > alerts.yaml
# Export a Alert
gotk export alert main > main.yaml
flux export alert main > main.yaml
`,
RunE: exportAlertCmdRun,
}

View File

@@ -35,10 +35,10 @@ var exportAlertProviderCmd = &cobra.Command{
Short: "Export Provider resources in YAML format",
Long: "The export alert-provider command exports one or all Provider resources in YAML format.",
Example: ` # Export all Provider resources
gotk export alert-provider --all > alert-providers.yaml
flux export alert-provider --all > alert-providers.yaml
# Export a Provider
gotk export alert-provider slack > slack.yaml
flux export alert-provider slack > slack.yaml
`,
RunE: exportAlertProviderCmdRun,
}

View File

@@ -36,10 +36,10 @@ var exportHelmReleaseCmd = &cobra.Command{
Short: "Export HelmRelease resources in YAML format",
Long: "The export helmrelease command exports one or all HelmRelease resources in YAML format.",
Example: ` # Export all HelmRelease resources
gotk export helmrelease --all > kustomizations.yaml
flux export helmrelease --all > kustomizations.yaml
# Export a HelmRelease
gotk export hr my-app > app-release.yaml
flux export hr my-app > app-release.yaml
`,
RunE: exportHelmReleaseCmdRun,
}

View File

@@ -36,10 +36,10 @@ var exportKsCmd = &cobra.Command{
Short: "Export Kustomization resources in YAML format",
Long: "The export kustomization command exports one or all Kustomization resources in YAML format.",
Example: ` # Export all Kustomization resources
gotk export kustomization --all > kustomizations.yaml
flux export kustomization --all > kustomizations.yaml
# Export a Kustomization
gotk export kustomization my-app > kustomization.yaml
flux export kustomization my-app > kustomization.yaml
`,
RunE: exportKsCmdRun,
}

View File

@@ -35,10 +35,10 @@ var exportReceiverCmd = &cobra.Command{
Short: "Export Receiver resources in YAML format",
Long: "The export receiver command exports one or all Receiver resources in YAML format.",
Example: ` # Export all Receiver resources
gotk export receiver --all > receivers.yaml
flux export receiver --all > receivers.yaml
# Export a Receiver
gotk export receiver main > main.yaml
flux export receiver main > main.yaml
`,
RunE: exportReceiverCmdRun,
}

View File

@@ -36,10 +36,10 @@ var exportSourceBucketCmd = &cobra.Command{
Short: "Export Bucket sources in YAML format",
Long: "The export source git command exports on or all Bucket sources in YAML format.",
Example: ` # Export all Bucket sources
gotk export source bucket --all > sources.yaml
flux export source bucket --all > sources.yaml
# Export a Bucket source including the static credentials
gotk export source bucket my-bucket --with-credentials > source.yaml
flux export source bucket my-bucket --with-credentials > source.yaml
`,
RunE: exportSourceBucketCmdRun,
}

View File

@@ -36,10 +36,10 @@ var exportSourceGitCmd = &cobra.Command{
Short: "Export GitRepository sources in YAML format",
Long: "The export source git command exports on or all GitRepository sources in YAML format.",
Example: ` # Export all GitRepository sources
gotk export source git --all > sources.yaml
flux export source git --all > sources.yaml
# Export a GitRepository source including the SSH key pair or basic auth credentials
gotk export source git my-private-repo --with-credentials > source.yaml
flux export source git my-private-repo --with-credentials > source.yaml
`,
RunE: exportSourceGitCmdRun,
}

View File

@@ -36,10 +36,10 @@ var exportSourceHelmCmd = &cobra.Command{
Short: "Export HelmRepository sources in YAML format",
Long: "The export source git command exports on or all HelmRepository sources in YAML format.",
Example: ` # Export all HelmRepository sources
gotk export source helm --all > sources.yaml
flux export source helm --all > sources.yaml
# Export a HelmRepository source including the basic auth credentials
gotk export source helm my-private-repo --with-credentials > source.yaml
flux export source helm my-private-repo --with-credentials > source.yaml
`,
RunE: exportSourceHelmCmdRun,
}

View File

@@ -36,7 +36,7 @@ var getAlertCmd = &cobra.Command{
Short: "Get Alert statuses",
Long: "The get alert command prints the statuses of the resources.",
Example: ` # List all Alerts and their status
gotk get alerts
flux get alerts
`,
RunE: getAlertCmdRun,
}

View File

@@ -34,7 +34,7 @@ var getAlertProviderCmd = &cobra.Command{
Short: "Get Provider statuses",
Long: "The get alert-provider command prints the statuses of the resources.",
Example: ` # List all Providers and their status
gotk get alert-providers
flux get alert-providers
`,
RunE: getAlertProviderCmdRun,
}

View File

@@ -38,7 +38,7 @@ var getHelmReleaseCmd = &cobra.Command{
Short: "Get HelmRelease statuses",
Long: "The get helmreleases command prints the statuses of the resources.",
Example: ` # List all Helm releases and their status
gotk get helmreleases
flux get helmreleases
`,
RunE: getHelmReleaseCmdRun,
}

View File

@@ -37,7 +37,7 @@ var getKsCmd = &cobra.Command{
Short: "Get Kustomization statuses",
Long: "The get kustomizations command prints the statuses of the resources.",
Example: ` # List all kustomizations and their status
gotk get kustomizations
flux get kustomizations
`,
RunE: getKsCmdRun,
}

View File

@@ -36,7 +36,7 @@ var getReceiverCmd = &cobra.Command{
Short: "Get Receiver statuses",
Long: "The get receiver command prints the statuses of the resources.",
Example: ` # List all Receiver and their status
gotk get receivers
flux get receivers
`,
RunE: getReceiverCmdRun,
}

View File

@@ -34,7 +34,7 @@ var getSourceBucketCmd = &cobra.Command{
Short: "Get Bucket source statuses",
Long: "The get sources bucket command prints the status of the Bucket sources.",
Example: ` # List all Buckets and their status
gotk get sources bucket
flux get sources bucket
`,
RunE: getSourceBucketCmdRun,
}

View File

@@ -34,7 +34,7 @@ var getSourceGitCmd = &cobra.Command{
Short: "Get GitRepository source statuses",
Long: "The get sources git command prints the status of the GitRepository sources.",
Example: ` # List all Git repositories and their status
gotk get sources git
flux get sources git
`,
RunE: getSourceGitCmdRun,
}

View File

@@ -34,7 +34,7 @@ var getSourceHelmCmd = &cobra.Command{
Short: "Get HelmRepository source statuses",
Long: "The get sources helm command prints the status of the HelmRepository sources.",
Example: ` # List all Helm repositories and their status
gotk get sources helm
flux get sources helm
`,
RunE: getSourceHelmCmdRun,
}

View File

@@ -37,16 +37,16 @@ var installCmd = &cobra.Command{
Long: `The install command deploys the toolkit components in the specified namespace.
If a previous version is installed, then an in-place upgrade will be performed.`,
Example: ` # Install the latest version in the flux-system namespace
gotk install --version=latest --namespace=flux-system
flux install --version=latest --namespace=flux-system
# Dry-run install for a specific version and a series of components
gotk install --dry-run --version=v0.0.7 --components="source-controller,kustomize-controller"
flux install --dry-run --version=v0.0.7 --components="source-controller,kustomize-controller"
# Dry-run install with manifests preview
gotk install --dry-run --verbose
flux install --dry-run --verbose
# Write install manifests to file
gotk install --export > flux-system.yaml
flux install --export > flux-system.yaml
`,
RunE: installCmdRun,
}

View File

@@ -26,42 +26,42 @@ import (
"github.com/spf13/cobra/doc"
_ "k8s.io/client-go/plugin/pkg/client/auth"
gotklog "github.com/fluxcd/toolkit/pkg/log"
fluxlog "github.com/fluxcd/toolkit/pkg/log"
"github.com/fluxcd/toolkit/pkg/manifestgen/install"
)
var VERSION = "0.0.0-dev.0"
var rootCmd = &cobra.Command{
Use: "gotk",
Use: "flux",
Version: VERSION,
SilenceUsage: true,
SilenceErrors: true,
Short: "Command line utility for assembling Kubernetes CD pipelines",
Long: `Command line utility for assembling Kubernetes CD pipelines the GitOps way.`,
Example: ` # Check prerequisites
gotk check --pre
flux check --pre
# Install the latest version of the toolkit
gotk install --version=master
flux install --version=master
# Create a source from a public Git repository
gotk create source git webapp-latest \
flux create source git webapp-latest \
--url=https://github.com/stefanprodan/podinfo \
--branch=master \
--interval=3m
# List GitRepository sources and their status
gotk get sources git
flux get sources git
# Trigger a GitRepository source reconciliation
gotk reconcile source git flux-system
flux reconcile source git flux-system
# Export GitRepository sources in YAML format
gotk export source git --all > sources.yaml
flux export source git --all > sources.yaml
# Create a Kustomization for deploying a series of microservices
gotk create kustomization webapp-dev \
flux create kustomization webapp-dev \
--source=webapp-latest \
--path="./deploy/webapp/" \
--prune=true \
@@ -72,25 +72,25 @@ var rootCmd = &cobra.Command{
--health-check-timeout=2m
# Trigger a git sync of the Kustomization's source and apply changes
gotk reconcile kustomization webapp-dev --with-source
flux reconcile kustomization webapp-dev --with-source
# Suspend a Kustomization reconciliation
gotk suspend kustomization webapp-dev
flux suspend kustomization webapp-dev
# Export Kustomizations in YAML format
gotk export kustomization --all > kustomizations.yaml
flux export kustomization --all > kustomizations.yaml
# Resume a Kustomization reconciliation
gotk resume kustomization webapp-dev
flux resume kustomization webapp-dev
# Delete a Kustomization
gotk delete kustomization webapp-dev
flux delete kustomization webapp-dev
# Delete a GitRepository source
gotk delete source git webapp-latest
flux delete source git webapp-latest
# Uninstall the toolkit and delete CRDs
gotk uninstall --crds
flux uninstall --crds
`,
}
@@ -100,7 +100,7 @@ var (
timeout time.Duration
verbose bool
pollInterval = 2 * time.Second
logger gotklog.Logger = printLogger{}
logger fluxlog.Logger = printLogger{}
defaults = install.MakeDefaultOptions()
)

View File

@@ -36,7 +36,7 @@ var reconcileAlertCmd = &cobra.Command{
Short: "Reconcile an Alert",
Long: `The reconcile alert command triggers a reconciliation of an Alert resource and waits for it to finish.`,
Example: ` # Trigger a reconciliation for an existing alert
gotk reconcile alert main
flux reconcile alert main
`,
RunE: reconcileAlertCmdRun,
}

View File

@@ -36,7 +36,7 @@ var reconcileAlertProviderCmd = &cobra.Command{
Short: "Reconcile a Provider",
Long: `The reconcile alert-provider command triggers a reconciliation of a Provider resource and waits for it to finish.`,
Example: ` # Trigger a reconciliation for an existing provider
gotk reconcile alert-provider slack
flux reconcile alert-provider slack
`,
RunE: reconcileAlertProviderCmdRun,
}

View File

@@ -42,10 +42,10 @@ var reconcileHrCmd = &cobra.Command{
Long: `
The reconcile kustomization command triggers a reconciliation of a HelmRelease resource and waits for it to finish.`,
Example: ` # Trigger a HelmRelease apply outside of the reconciliation interval
gotk reconcile hr podinfo
flux reconcile hr podinfo
# Trigger a reconciliation of the HelmRelease's source and apply changes
gotk reconcile hr podinfo --with-source
flux reconcile hr podinfo --with-source
`,
RunE: reconcileHrCmdRun,
}

View File

@@ -42,10 +42,10 @@ var reconcileKsCmd = &cobra.Command{
Long: `
The reconcile kustomization command triggers a reconciliation of a Kustomization resource and waits for it to finish.`,
Example: ` # Trigger a Kustomization apply outside of the reconciliation interval
gotk reconcile kustomization podinfo
flux reconcile kustomization podinfo
# Trigger a sync of the Kustomization's source and apply changes
gotk reconcile kustomization podinfo --with-source
flux reconcile kustomization podinfo --with-source
`,
RunE: reconcileKsCmdRun,
}

View File

@@ -36,7 +36,7 @@ var reconcileReceiverCmd = &cobra.Command{
Short: "Reconcile a Receiver",
Long: `The reconcile receiver command triggers a reconciliation of a Receiver resource and waits for it to finish.`,
Example: ` # Trigger a reconciliation for an existing receiver
gotk reconcile receiver main
flux reconcile receiver main
`,
RunE: reconcileReceiverCmdRun,
}

View File

@@ -38,7 +38,7 @@ var reconcileSourceBucketCmd = &cobra.Command{
Short: "Reconcile a Bucket source",
Long: `The reconcile source command triggers a reconciliation of a Bucket resource and waits for it to finish.`,
Example: ` # Trigger a reconciliation for an existing source
gotk reconcile source bucket podinfo
flux reconcile source bucket podinfo
`,
RunE: reconcileSourceBucketCmdRun,
}

View File

@@ -36,7 +36,7 @@ var reconcileSourceGitCmd = &cobra.Command{
Short: "Reconcile a GitRepository source",
Long: `The reconcile source command triggers a reconciliation of a GitRepository resource and waits for it to finish.`,
Example: ` # Trigger a git pull for an existing source
gotk reconcile source git podinfo
flux reconcile source git podinfo
`,
RunE: reconcileSourceGitCmdRun,
}

View File

@@ -38,7 +38,7 @@ var reconcileSourceHelmCmd = &cobra.Command{
Short: "Reconcile a HelmRepository source",
Long: `The reconcile source command triggers a reconciliation of a HelmRepository resource and waits for it to finish.`,
Example: ` # Trigger a reconciliation for an existing source
gotk reconcile source helm podinfo
flux reconcile source helm podinfo
`,
RunE: reconcileSourceHelmCmdRun,
}

View File

@@ -38,7 +38,7 @@ var resumeAlertCmd = &cobra.Command{
Long: `The resume command marks a previously suspended Alert resource for reconciliation and waits for it to
finish the apply.`,
Example: ` # Resume reconciliation for an existing Alert
gotk resume alert main
flux resume alert main
`,
RunE: resumeAlertCmdRun,
}

View File

@@ -39,7 +39,7 @@ var resumeHrCmd = &cobra.Command{
Long: `The resume command marks a previously suspended HelmRelease resource for reconciliation and waits for it to
finish the apply.`,
Example: ` # Resume reconciliation for an existing Helm release
gotk resume hr podinfo
flux resume hr podinfo
`,
RunE: resumeHrCmdRun,
}

View File

@@ -38,7 +38,7 @@ var resumeKsCmd = &cobra.Command{
Long: `The resume command marks a previously suspended Kustomization resource for reconciliation and waits for it to
finish the apply.`,
Example: ` # Resume reconciliation for an existing Kustomization
gotk resume ks podinfo
flux resume ks podinfo
`,
RunE: resumeKsCmdRun,
}

View File

@@ -38,7 +38,7 @@ var resumeReceiverCmd = &cobra.Command{
Long: `The resume command marks a previously suspended Receiver resource for reconciliation and waits for it to
finish the apply.`,
Example: ` # Resume reconciliation for an existing Receiver
gotk resume receiver main
flux resume receiver main
`,
RunE: resumeReceiverCmdRun,
}

View File

@@ -32,7 +32,7 @@ var suspendAlertCmd = &cobra.Command{
Short: "Suspend reconciliation of Alert",
Long: "The suspend command disables the reconciliation of a Alert resource.",
Example: ` # Suspend reconciliation for an existing Alert
gotk suspend alert main
flux suspend alert main
`,
RunE: suspendAlertCmdRun,
}

View File

@@ -33,7 +33,7 @@ var suspendHrCmd = &cobra.Command{
Short: "Suspend reconciliation of HelmRelease",
Long: "The suspend command disables the reconciliation of a HelmRelease resource.",
Example: ` # Suspend reconciliation for an existing Helm release
gotk suspend hr podinfo
flux suspend hr podinfo
`,
RunE: suspendHrCmdRun,
}

View File

@@ -32,7 +32,7 @@ var suspendKsCmd = &cobra.Command{
Short: "Suspend reconciliation of Kustomization",
Long: "The suspend command disables the reconciliation of a Kustomization resource.",
Example: ` # Suspend reconciliation for an existing Kustomization
gotk suspend ks podinfo
flux suspend ks podinfo
`,
RunE: suspendKsCmdRun,
}

View File

@@ -32,7 +32,7 @@ var suspendReceiverCmd = &cobra.Command{
Short: "Suspend reconciliation of Receiver",
Long: "The suspend command disables the reconciliation of a Receiver resource.",
Example: ` # Suspend reconciliation for an existing Receiver
gotk suspend receiver main
flux suspend receiver main
`,
RunE: suspendReceiverCmdRun,
}

View File

@@ -37,10 +37,10 @@ var uninstallCmd = &cobra.Command{
Short: "Uninstall the toolkit components",
Long: "The uninstall command removes the namespace, cluster roles, cluster role bindings and CRDs from the cluster.",
Example: ` # Dry-run uninstall of all components
gotk uninstall --dry-run --namespace=flux-system
flux uninstall --dry-run --namespace=flux-system
# Uninstall all components and delete custom resource definitions
gotk uninstall --resources --crds --namespace=flux-system
flux uninstall --resources --crds --namespace=flux-system
`,
RunE: uninstallCmdRun,
}