diff --git a/chart/flux/README.md b/chart/flux/README.md index d2994253b2..65000171d0 100755 --- a/chart/flux/README.md +++ b/chart/flux/README.md @@ -211,8 +211,8 @@ The following tables lists the configurable parameters of the Flux chart and the | `git.url` | `None` | URL of git repo with Kubernetes manifests | `git.branch` | `master` | Branch of git repo to use for Kubernetes manifests | `git.path` | `None` | Path within git repo to locate Kubernetes manifests (relative path) -| `git.user` | `Weave Flux` | Username to use as git committer -| `git.email` | `support@weave.works` | Email to use as git committer +| `git.user` | `Flux` | Username to use as git committer +| `git.email` | `flux-dev@googlegroups.com` | Email to use as git committer | `git.setAuthor` | `false` | If set, the author of git commits will reflect the user who initiated the commit and will differ from the git committer. | `git.signingKey` | `None` | If set, commits will be signed with this GPG key | `git.verifySignatures` | `false` | If set, the signatures of the sync tag and commits will be verified diff --git a/chart/flux/values.yaml b/chart/flux/values.yaml index 3e1e5744c2..16173e7a8c 100644 --- a/chart/flux/values.yaml +++ b/chart/flux/values.yaml @@ -147,9 +147,9 @@ git: # Path within git repo to locate Kubernetes manifests (relative path) path: "" # Username to use as git committer - user: "Weave Flux" + user: "Flux" # Email to use as git committer - email: "support@weave.works" + email: "flux-dev@googlegroups.com" # If set, commits will be signed with this GPG key. signingKey: "" # If set, the signatures of the sync tag and commits will be verified. diff --git a/cmd/fluxctl/install_cmd.go b/cmd/fluxctl/install_cmd.go index b7a78ed248..732f7ef201 100644 --- a/cmd/fluxctl/install_cmd.go +++ b/cmd/fluxctl/install_cmd.go @@ -1,24 +1,18 @@ package main import ( - "context" - "fmt" - "time" - "github.com/spf13/cobra" - - "github.com/weaveworks/flux/git" ) type installOpts struct { gitURL string gitBranch string - gitFluxPath string + gitPaths []string gitLabel string - timeout time.Duration + gitUser string + gitEmail string namespace string additionalFluxArgs []string - amend bool } func newInstall() *installOpts { @@ -28,74 +22,32 @@ func newInstall() *installOpts { func (opts *installOpts) Command() *cobra.Command { cmd := &cobra.Command{ Use: "install", - Short: "Bootstrap Flux, installing it in the cluster and initializing its manifests in the Git repository", - RunE: opts.RunE, + Short: "Print and tweak Kubernetes manifests needed to install Flux in a Cluster", + Example: `# Install Flux and make it use Git repository git@github.com:<your username>/flux-get-started +fluxctl install --git-url 'git@github.com:<your username>/flux-get-started' | kubectl -f -`, + RunE: opts.RunE, } - cmd.Flags().StringVarP(&opts.gitURL, "git-url", "r", "", + cmd.Flags().StringVarP(&opts.gitURL, "git-url", "", "", "URL of the Git repository to be used by Flux, e.g. git@github.com:<your username>/flux-get-started") - cmd.Flags().StringVarP(&opts.gitBranch, "git-branch", "b", "master", + cmd.Flags().StringVarP(&opts.gitBranch, "git-branch", "", "master", "Git branch to be used by Flux") - cmd.Flags().StringVarP(&opts.gitLabel, "git-label", "l", "flux", - "Git label to keep track of FLux's sync progress; overrides both --git-sync-tag and --git-notes-ref") - cmd.Flags().StringVarP(&opts.gitFluxPath, "git-flux-subdir", "p", "flux/", - "Directory within the Git repository where to commit the Flux manifests") - cmd.Flags().DurationVarP(&opts.timeout, "timeout", "t", 10*time.Second, - "Timeout duration for I/O operations") - cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "flux", + cmd.Flags().StringVarP(&opts.gitLabel, "git-label", "", "flux", + "Git label to keep track of Flux's sync progress; overrides both --git-sync-tag and --git-notes-ref") + cmd.Flags().StringVarP(&opts.gitUser, "git-user", "", "Flux", + "Username to use as git committer") + cmd.Flags().StringVarP(&opts.gitEmail, "git-email", "", "flux-dev@googlegroups.com", + "Email to use as git committer") + cmd.Flags().StringVarP(&opts.namespace, "namespace", "", "flux", "Cluster namespace where to install flux") - cmd.Flags().BoolVarP(&opts.amend, "amend", "a", false, - "Stop for amending the Flux manifests before pushing them to the Git repository") - cmd.Flags().StringSliceVarP(&opts.additionalFluxArgs, "extra-flux-args", "e", []string{}, + cmd.Flags().StringSliceVarP(&opts.additionalFluxArgs, "extra-flux-args", "", []string{}, "Additional arguments for Flux as CSVs, e.g. --extra-flux-arg='--manifest-generation=true,--sync-garbage-collection=true'") return cmd } func (opts *installOpts) RunE(cmd *cobra.Command, args []string) error { - //0. Read and patch embedded deploy/* manifests with what was passed to ops - - // TODO. BTW, it's probably easier to embed chart/flux/* and use `helm template` as a library instead - - //1. Clone repository. In the future we could optionally create the repository automatically for the most - // popular git providers (e.g. GitHub OAuth). - - if opts.gitURL == "" { - fmt.Errorf("no Git repository was provided, please provide a repository through --git-url") - } - - remote := git.Remote{opts.gitURL} - pollInterval := 0 * time.Second // there is no need for polling, We will fetch the repo once, manually - repo := git.NewRepo(remote, git.Branch(opts.gitBranch), git.Timeout(opts.timeout), git.PollInterval(pollInterval)) - checkoutConfig := git.Config{ - Branch: opts.gitBranch, - } - ctx := context.Background() - cloneCtx, cloneCtxCancel := context.WithTimeout(ctx, opts.timeout) - defer cloneCtxCancel() - checkout, err := repo.Clone(cloneCtx, checkoutConfig) - if err != nil { - return fmt.Errorf("cannot clone repository %s: %s", opts.gitURL) - } - cleanCheckout := true - defer func() { - if cleanCheckout { - checkout.Clean() - } - }() - - // 2. Write manifests from (0) to the repository's clone working directory - - // 3. If --amend was passed, stop to let the user edit the manifests, by prompting a shell - - // 4. `kubectl apply` the changes to the cluster - - // 5. commit the local changes and push to the remote repository - - // 6. Make sure that the ssh key is added to the repo. At this point we should probably just print the ssh - // key and telling the user to add it manually. In the future we can do this programatically for the most popular - // Git providers. + //0. Read and patch embedded templates manifests with what was passed to as options - // 7. Confirm that Flux is running (for instance by checking that its own manifests have been synced, this can be - // done by checking that the sync annotations have been added) + //1. Print them return nil } diff --git a/cmd/fluxd/main.go b/cmd/fluxd/main.go index 25e07c2b0f..053168a0a0 100644 --- a/cmd/fluxd/main.go +++ b/cmd/fluxd/main.go @@ -110,8 +110,8 @@ func main() { gitURL = fs.String("git-url", "", "URL of git repo with Kubernetes manifests; e.g., git@github.com:weaveworks/flux-get-started") gitBranch = fs.String("git-branch", "master", "branch of git repo to use for Kubernetes manifests") gitPath = fs.StringSlice("git-path", []string{}, "relative paths within the git repo to locate Kubernetes manifests") - gitUser = fs.String("git-user", "Weave Flux", "username to use as git committer") - gitEmail = fs.String("git-email", "support@weave.works", "email to use as git committer") + gitUser = fs.String("git-user", "Flux", "username to use as git committer") + gitEmail = fs.String("git-email", "flux-dev@googlegroups.com", "email to use as git committer") gitSetAuthor = fs.Bool("git-set-author", false, "if set, the author of git commits will reflect the user who initiated the commit and will differ from the git committer.") gitLabel = fs.String("git-label", "", "label to keep track of sync progress; overrides both --git-sync-tag and --git-notes-ref") gitSecret = fs.Bool("git-secret", false, `if set, git-secret will be run on every git checkout. A gpg key must be imported using --git-gpg-key-import or by mounting a keyring containing it directly`) diff --git a/site/daemon.md b/site/daemon.md index 64007edf05..0b0e82515a 100644 --- a/site/daemon.md +++ b/site/daemon.md @@ -54,8 +54,8 @@ fluxd requires setup and offers customization though a multitude of flags. | --git-ci-skip | false | when set, fluxd will append `\n\n[ci skip]` to its commit messages | --git-ci-skip-message | `""` | if provided, fluxd will append this to commit messages (overrides --git-ci-skip`) | --git-path | | path within git repo to locate Kubernetes manifests (relative path) -| --git-user | `Weave Flux` | username to use as git committer -| --git-email | `support@weave.works` | email to use as git committer +| --git-user | `Flux` | username to use as git committer +| --git-email | `flux-dev@googlegroups.com` | email to use as git committer | --git-set-author | false | if set, the author of git commits will reflect the user who initiated the commit and will differ from the git committer | --git-gpg-key-import | | if set, fluxd will attempt to import the gpg key(s) found on the given path | --git-signing-key | | if set, commits made by fluxd to the user git repo will be signed with the provided GPG key. See [Git commit signing](git-commit-signing.md) to learn how to use this feature diff --git a/site/fluxctl.md b/site/fluxctl.md index 2c779fc075..3c0057111e 100644 --- a/site/fluxctl.md +++ b/site/fluxctl.md @@ -449,8 +449,8 @@ started with several flags that impact the commit information: | flag | purpose | default | -------------- | -------------------------- | --- -| git-user | committer name | `Weave Flux` -| git-email | committer email | `support@weave.works` +| git-user | committer name | `Flux` +| git-email | committer email | `flux-dev@googlegroups.com` | git-set-author | override the commit author | false Actions triggered by a user through the CLI `fluxctl`