Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fixup! feat: Unattended Flu…
Browse files Browse the repository at this point in the history
…x installation
  • Loading branch information
mumoshu committed May 31, 2020
1 parent 4b1ceca commit 18f7d76
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
5 changes: 4 additions & 1 deletion pkg/apis/eksctl.io/v1alpha5/assets/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Profile"
},
"readOnly": {
"commitOperatorManifests": {
"type": "boolean"
}
},
Expand Down Expand Up @@ -827,6 +827,9 @@
},
"withHelm": {
"type": "boolean"
},
"readOnly": {
"type": "boolean"
}
},
"additionalProperties": false,
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ func SetDefaultGitSettings(c *ClusterConfig) {
return
}

if c.Git.CommitOperatorManifests == nil {
c.Git.CommitOperatorManifests = Enabled()
}

if c.Git.Operator.Label == "" {
c.Git.Operator.Label = "flux"
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/eksctl.io/v1alpha5/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/apis/eksctl.io/v1alpha5/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ type Git struct {
// +optional
BootstrapProfile *Profile `json:"bootstrapProfile,omitempty"` // one or many profiles to enable on this cluster once it is created
// +optional
ReadOnly bool `json:"readOnly,omitempty"` // Instruct Flux to read-only mode and create the deploy key as read-only
CommitOperatorManifests *bool `json:"commitOperatorManifests,omitempty"` // Commit and push Flux manifests to the Git Repo on install
}

// NewGit returns a new empty Git configuration
Expand Down Expand Up @@ -751,6 +751,8 @@ type Operator struct {
Namespace string `json:"namespace,omitempty"` // e.g. flux
// +optional
WithHelm *bool `json:"withHelm,omitempty"` // whether to install the Flux Helm Operator or not
// +optional
ReadOnly bool `json:"readOnly,omitempty"` // Instruct Flux to read-only mode and create the deploy key as read-only
}

// Profile groups all details on a quickstart profile to enable on the cluster
Expand Down
6 changes: 5 additions & 1 deletion pkg/ctl/cmdutils/gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const (
readOnly = "read-only"
withHelm = "with-helm"

commitOperatorManifests = "commit-operator-manifests"

profileName = "profile-source"
profileRevision = "profile-revision"
)
Expand All @@ -52,8 +54,10 @@ func AddCommonFlagsForFlux(fs *pflag.FlagSet, opts *api.Git) {
"Directory within the Git repository where to commit the Flux manifests")
fs.StringVar(&opts.Operator.Namespace, namespace, "flux",
"Cluster namespace where to install Flux, the Helm Operator and Tiller")
fs.BoolVar(&opts.ReadOnly, readOnly, false,
fs.BoolVar(&opts.Operator.ReadOnly, readOnly, false,
"Instruct Flux to read-only mode and create the deploy key as read-only")
opts.CommitOperatorManifests = fs.Bool(commitOperatorManifests, true,
"Commit and push Flux manifests to the Git Repo on install")
opts.Operator.WithHelm = fs.Bool(withHelm, true, "Install the Helm Operator and Tiller")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/gitops/deploykey/deploykey.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func ForCluster(cluster *v1alpha5.ClusterConfig) GitProvider {
repoURL = repo.URL
}

readOnly = git.ReadOnly
readOnly = git.Operator.ReadOnly
}

if repoURL == "" {
Expand Down
Loading

0 comments on commit 18f7d76

Please sign in to comment.