Skip to content

Commit 18f7d76

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! fixup! feat: Unattended Flux installation
1 parent 4b1ceca commit 18f7d76

File tree

7 files changed

+22
-9
lines changed

7 files changed

+22
-9
lines changed

pkg/apis/eksctl.io/v1alpha5/assets/schema.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@
411411
"$schema": "http://json-schema.org/draft-04/schema#",
412412
"$ref": "#/definitions/Profile"
413413
},
414-
"readOnly": {
414+
"commitOperatorManifests": {
415415
"type": "boolean"
416416
}
417417
},
@@ -827,6 +827,9 @@
827827
},
828828
"withHelm": {
829829
"type": "boolean"
830+
},
831+
"readOnly": {
832+
"type": "boolean"
830833
}
831834
},
832835
"additionalProperties": false,

pkg/apis/eksctl.io/v1alpha5/defaults.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ func SetDefaultGitSettings(c *ClusterConfig) {
248248
return
249249
}
250250

251+
if c.Git.CommitOperatorManifests == nil {
252+
c.Git.CommitOperatorManifests = Enabled()
253+
}
254+
251255
if c.Git.Operator.Label == "" {
252256
c.Git.Operator.Label = "flux"
253257
}

pkg/apis/eksctl.io/v1alpha5/schema.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/eksctl.io/v1alpha5/types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ type Git struct {
713713
// +optional
714714
BootstrapProfile *Profile `json:"bootstrapProfile,omitempty"` // one or many profiles to enable on this cluster once it is created
715715
// +optional
716-
ReadOnly bool `json:"readOnly,omitempty"` // Instruct Flux to read-only mode and create the deploy key as read-only
716+
CommitOperatorManifests *bool `json:"commitOperatorManifests,omitempty"` // Commit and push Flux manifests to the Git Repo on install
717717
}
718718

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

756758
// Profile groups all details on a quickstart profile to enable on the cluster

pkg/ctl/cmdutils/gitops.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const (
2626
readOnly = "read-only"
2727
withHelm = "with-helm"
2828

29+
commitOperatorManifests = "commit-operator-manifests"
30+
2931
profileName = "profile-source"
3032
profileRevision = "profile-revision"
3133
)
@@ -52,8 +54,10 @@ func AddCommonFlagsForFlux(fs *pflag.FlagSet, opts *api.Git) {
5254
"Directory within the Git repository where to commit the Flux manifests")
5355
fs.StringVar(&opts.Operator.Namespace, namespace, "flux",
5456
"Cluster namespace where to install Flux, the Helm Operator and Tiller")
55-
fs.BoolVar(&opts.ReadOnly, readOnly, false,
57+
fs.BoolVar(&opts.Operator.ReadOnly, readOnly, false,
5658
"Instruct Flux to read-only mode and create the deploy key as read-only")
59+
opts.CommitOperatorManifests = fs.Bool(commitOperatorManifests, true,
60+
"Commit and push Flux manifests to the Git Repo on install")
5761
opts.Operator.WithHelm = fs.Bool(withHelm, true, "Install the Helm Operator and Tiller")
5862
}
5963

pkg/gitops/deploykey/deploykey.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func ForCluster(cluster *v1alpha5.ClusterConfig) GitProvider {
2525
repoURL = repo.URL
2626
}
2727

28-
readOnly = git.ReadOnly
28+
readOnly = git.Operator.ReadOnly
2929
}
3030

3131
if repoURL == "" {

0 commit comments

Comments
 (0)