diff --git a/action/README.md b/action/README.md index f2871b76d10805d710f28360a1ea314864558913..daeada31c5e439d8032a580f3210590c9ceed07f 100644 --- a/action/README.md +++ b/action/README.md @@ -97,9 +97,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Flux CLI uses: fluxcd/flux2/action@main + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Generate manifests run: | kustomize build ./manifests/staging > ./deploy/app.yaml @@ -132,7 +138,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Flux CLI uses: fluxcd/flux2/action@main - name: Login to Docker Hub diff --git a/cmd/flux/build_artifact.go b/cmd/flux/build_artifact.go index a7db13f66a959b5114dec1f92cd0d1b4c6f0f719..bf523fa0164d6bf143a05ad1e5bc6a50a9dd00fe 100644 --- a/cmd/flux/build_artifact.go +++ b/cmd/flux/build_artifact.go @@ -28,11 +28,11 @@ import ( var buildArtifactCmd = &cobra.Command{ Use: "artifact", Short: "Build artifact", - Long: `The build artifact command creates an tgz file with the manifests from the given directory.`, + Long: `The build artifact command creates a tgz file with the manifests from the given directory.`, Example: ` # Build the given manifests directory into an artifact flux build artifact --path ./path/to/local/manifests --output ./path/to/artifact.tgz - # List the files bundles in the artifact + # List the files bundled in the artifact tar -ztvf ./path/to/artifact.tgz `, RunE: buildArtifactCmdRun, @@ -47,7 +47,7 @@ var buildArtifactArgs buildArtifactFlags func init() { buildArtifactCmd.Flags().StringVar(&buildArtifactArgs.path, "path", "", "Path to the directory where the Kubernetes manifests are located.") - buildArtifactCmd.Flags().StringVarP(&buildArtifactArgs.output, "output", "0", "artifact.tgz", "Path to where the artifact tgz file should be written.") + buildArtifactCmd.Flags().StringVarP(&buildArtifactArgs.output, "output", "o", "artifact.tgz", "Path to where the artifact tgz file should be written.") buildCmd.AddCommand(buildArtifactCmd) } @@ -57,7 +57,7 @@ func buildArtifactCmdRun(cmd *cobra.Command, args []string) error { } if fs, err := os.Stat(buildArtifactArgs.path); err != nil || !fs.IsDir() { - return fmt.Errorf("invalid path %q", buildArtifactArgs.path) + return fmt.Errorf("invalid path '%s', must point to an existing directory", buildArtifactArgs.path) } logger.Actionf("building artifact from %s", buildArtifactArgs.path) diff --git a/cmd/flux/create_secret_oci.go b/cmd/flux/create_secret_oci.go index 2e86f4618f5023bcfca5a37e7314f33955237a32..b7cb34490c757ca898642672357610cd7c8c84f9 100644 --- a/cmd/flux/create_secret_oci.go +++ b/cmd/flux/create_secret_oci.go @@ -30,8 +30,8 @@ import ( var createSecretOCICmd = &cobra.Command{ Use: "oci [name]", - Short: "Create or update a Kubernetes secret for OCI Registry authentication", - Long: `The create secret oci command generates a Kubernetes secret with `, + Short: "Create or update a Kubernetes image pull secret", + Long: `The create secret oci command generates a Kubernetes secret that can be used for OCIRepository authentication`, Example: ` # Create an OCI authentication secret on disk and encrypt it with Mozilla SOPS flux create secret oci podinfo-auth \ --url=ghcr.io \ @@ -39,7 +39,7 @@ var createSecretOCICmd = &cobra.Command{ --password=password \ --export > repo-auth.yaml - sops --encrypt --encrypted-regex '^(data|stringData)$' \ + sops --encrypt --encrypted-regex '^(data|stringData)$' \ --in-place repo-auth.yaml `, RunE: createSecretOCICmdRun, diff --git a/cmd/flux/create_source_oci.go b/cmd/flux/create_source_oci.go index 2481fe7d033daddad719807956a76230b19dd484..75372a35ce35a2a44ca8a27d3667a0469333668f 100644 --- a/cmd/flux/create_source_oci.go +++ b/cmd/flux/create_source_oci.go @@ -71,7 +71,7 @@ func newSourceOCIFlags() sourceOCIRepositoryFlags { } func init() { - createSourceOCIRepositoryCmd.Flags().Var(&sourceOCIRepositoryArgs.provider, "provider", sourceBucketArgs.provider.Description()) + createSourceOCIRepositoryCmd.Flags().Var(&sourceOCIRepositoryArgs.provider, "provider", sourceOCIRepositoryArgs.provider.Description()) createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.url, "url", "", "the OCI repository URL") createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.tag, "tag", "", "the OCI artifact tag") createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.semver, "tag-semver", "", "the OCI artifact tag semver range") diff --git a/cmd/flux/delete_source_oci.go b/cmd/flux/delete_source_oci.go index 1d641bbf51206710a4c231171fd8439d61d73d0d..8d98e5b03e555c49ade006f1f096a9d35a369186 100644 --- a/cmd/flux/delete_source_oci.go +++ b/cmd/flux/delete_source_oci.go @@ -24,7 +24,7 @@ import ( var deleteSourceOCIRepositoryCmd = &cobra.Command{ Use: "oci [name]", - Short: "Delete a OCIRepository source", + Short: "Delete an OCIRepository source", Long: "The delete source oci command deletes the given OCIRepository from the cluster.", Example: ` # Delete an OCIRepository flux delete source oci podinfo`, diff --git a/cmd/flux/get_source_oci.go b/cmd/flux/get_source_oci.go index 8f948d8122941ccd3a4c59cfe1d2c68f3286c425..b79f73f826b4b06a884298ca2b5ca76a6e961b06 100644 --- a/cmd/flux/get_source_oci.go +++ b/cmd/flux/get_source_oci.go @@ -34,7 +34,7 @@ var getSourceOCIRepositoryCmd = &cobra.Command{ Example: ` # List all OCIRepositories and their status flux get sources oci - # List OCIRepositories from all namespaces + # List OCIRepositories from all namespaces flux get sources oci --all-namespaces`, ValidArgsFunction: resourceNamesCompletionFunc(sourcev1.GroupVersion.WithKind(sourcev1.OCIRepositoryKind)), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/flux/list.go b/cmd/flux/list.go index e89dc149633b3064085b296373b0c4014c05e833..240e69d085a9cb08bc1d6bf64ffd3ac20805c2ed 100644 --- a/cmd/flux/list.go +++ b/cmd/flux/list.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Flux authors +Copyright 2022 The Flux 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/cmd/flux/pull_artifact.go b/cmd/flux/pull_artifact.go index 7f508e53669e5c5759de2f995deb47d4c965e750..f36ab3d0c065b6a7d2d84b77c861a3c587addd78 100644 --- a/cmd/flux/pull_artifact.go +++ b/cmd/flux/pull_artifact.go @@ -31,8 +31,8 @@ var pullArtifactCmd = &cobra.Command{ Short: "Pull artifact", Long: `The pull artifact command downloads and extracts the OCI artifact content to the given path. The pull command uses the credentials from '~/.docker/config.json'.`, - Example: `# Pull an OCI artifact created by flux from GHCR -flux pull artifact oci://ghcr.io/org/manifests/app:v0.0.1 --output ./path/to/local/manifests + Example: ` # Pull an OCI artifact created by flux from GHCR + flux pull artifact oci://ghcr.io/org/manifests/app:v0.0.1 --output ./path/to/local/manifests `, RunE: pullArtifactCmdRun, } @@ -44,7 +44,7 @@ type pullArtifactFlags struct { var pullArtifactArgs pullArtifactFlags func init() { - pullArtifactCmd.Flags().StringVarP(&pullArtifactArgs.output, "output", "o", "", "Path where the artifact content should be extracted.") + pullArtifactCmd.Flags().StringVarP(&pullArtifactArgs.output, "output", "o", "", "path where the artifact content should be extracted.") pullCmd.AddCommand(pullArtifactCmd) } diff --git a/cmd/flux/push.go b/cmd/flux/push.go index 481c6ae9aea05833fceac86fbcf0008d7d171731..eec4882ddc9173794c1dc6d6f86304025a0283ed 100644 --- a/cmd/flux/push.go +++ b/cmd/flux/push.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Flux authors +Copyright 2022 The Flux 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/cmd/flux/push_artifact.go b/cmd/flux/push_artifact.go index 009ba437b4c2a4c538cbed55c9e20021e7822399..6f3186025e91e0340352be7838ec51e7915c3e0c 100644 --- a/cmd/flux/push_artifact.go +++ b/cmd/flux/push_artifact.go @@ -57,9 +57,9 @@ type pushArtifactFlags struct { var pushArtifactArgs pushArtifactFlags func init() { - pushArtifactCmd.Flags().StringVar(&pushArtifactArgs.path, "path", "", "Path to the directory where the Kubernetes manifests are located.") - pushArtifactCmd.Flags().StringVar(&pushArtifactArgs.source, "source", "", "The source address, e.g. the Git URL.") - pushArtifactCmd.Flags().StringVar(&pushArtifactArgs.revision, "revision", "", "The source revision in the format '<branch|tag>/<commit-sha>'") + pushArtifactCmd.Flags().StringVar(&pushArtifactArgs.path, "path", "", "path to the directory where the Kubernetes manifests are located") + pushArtifactCmd.Flags().StringVar(&pushArtifactArgs.source, "source", "", "the source address, e.g. the Git URL") + pushArtifactCmd.Flags().StringVar(&pushArtifactArgs.revision, "revision", "", "the source revision in the format '<branch|tag>/<commit-sha>'") pushCmd.AddCommand(pushArtifactCmd) } diff --git a/cmd/flux/reconcile_source_oci.go b/cmd/flux/reconcile_source_oci.go index 17df7174f82d96c95f8c549f83a2d79d50b8efbb..ffc649f9b3b9f0d92bfbca40794c74cf6f7da149 100644 --- a/cmd/flux/reconcile_source_oci.go +++ b/cmd/flux/reconcile_source_oci.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux authors +Copyright 2022 The Flux 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/cmd/flux/resume_source_oci.go b/cmd/flux/resume_source_oci.go index 42ad48ab1d162acd2c8179ac947fdc4ff0806733..3c121c4733586d86cd3d1fa1527b0888c4ec2fa1 100644 --- a/cmd/flux/resume_source_oci.go +++ b/cmd/flux/resume_source_oci.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux authors +Copyright 2022 The Flux 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/cmd/flux/suspend_source_oci.go b/cmd/flux/suspend_source_oci.go index 06ab4c6c3595a2d03db4bfcdaab433be36629ecf..d656dbf23cca88289638cb0483b1aa1c6342a237 100644 --- a/cmd/flux/suspend_source_oci.go +++ b/cmd/flux/suspend_source_oci.go @@ -24,7 +24,7 @@ import ( var suspendSourceOCIRepositoryCmd = &cobra.Command{ Use: "oci [name]", - Short: "Suspend reconciliation of a OCIRepository", + Short: "Suspend reconciliation of an OCIRepository", Long: "The suspend command disables the reconciliation of an OCIRepository resource.", Example: ` # Suspend reconciliation for an existing OCIRepository flux suspend source oci podinfo`, diff --git a/cmd/flux/tag.go b/cmd/flux/tag.go index 56c9485fb0b85f6c426de7318fcd5ed9dd0d496d..966acef6f719d23fff21620b01005963693273a5 100644 --- a/cmd/flux/tag.go +++ b/cmd/flux/tag.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Flux authors +Copyright 2022 The Flux 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/cmd/flux/tag_artifact.go b/cmd/flux/tag_artifact.go index 4cfed8517759fcb6b3e700a89e0148e959f219f2..65ba121887e8f3d03284cac9434684fb3164af70 100644 --- a/cmd/flux/tag_artifact.go +++ b/cmd/flux/tag_artifact.go @@ -43,7 +43,7 @@ type tagArtifactFlags struct { var tagArtifactArgs tagArtifactFlags func init() { - tagArtifactCmd.Flags().StringSliceVar(&tagArtifactArgs.tags, "tag", nil, "Tag name.") + tagArtifactCmd.Flags().StringSliceVar(&tagArtifactArgs.tags, "tag", nil, "tag name") tagCmd.AddCommand(tagArtifactCmd) }