diff --git a/cli/cmd/dev/dev.go b/cli/cmd/dev/dev.go index 42be20a..d3ab73a 100644 --- a/cli/cmd/dev/dev.go +++ b/cli/cmd/dev/dev.go @@ -109,6 +109,7 @@ func createMicroshift(kmd *cobra.Command, cliCtx cliutils.SoftwareFactoryConfigC ctrl.Log.Info("disk-file-size not set, defaulting to " + defaultDiskSpace) } msEtcdOnRamdisk := cliCtx.Dev.Microshift.ETCDOnRAMDisk + msRamdiskSize := cliCtx.Dev.Microshift.RAMDiskSize msAnsibleMicroshiftRolePath := cliCtx.Dev.AnsibleMicroshiftRolePath if msAnsibleMicroshiftRolePath == "" { msAnsibleMicroshiftRolePath = rootDir + "/ansible-microshift-role" @@ -116,7 +117,7 @@ func createMicroshift(kmd *cobra.Command, cliCtx cliutils.SoftwareFactoryConfigC } options := ms.MkAnsiblePlaybookOptions(msHost, msUser, msOpenshiftPullSecret, rootDir) varsFile := ms.MkTemporaryVarsFile( - cliCtx.FQDN, msDiskFileSize, msAnsibleMicroshiftRolePath, rootDir, msEtcdOnRamdisk) + cliCtx.FQDN, msDiskFileSize, msAnsibleMicroshiftRolePath, rootDir, msEtcdOnRamdisk, msRamdiskSize) options.ExtraVarsFile = []string{"@" + varsFile} // Ensure ansible-microshift-role is available ms.MkMicroshiftRoleSetupPlaybook(rootDir) diff --git a/cli/cmd/dev/microshift/microshift.go b/cli/cmd/dev/microshift/microshift.go index 4050cc5..3260fce 100644 --- a/cli/cmd/dev/microshift/microshift.go +++ b/cli/cmd/dev/microshift/microshift.go @@ -49,6 +49,7 @@ type GroupVarsData struct { DiskFileSize string MicroshiftRolePath string ETCDOnRAMDisk bool + RAMDiskSize string } type PlayBook struct { @@ -116,12 +117,13 @@ func MkAnsiblePlaybookOptions(host string, user string, pullSecret string, rootD } func MkTemporaryVarsFile( - fqdn string, diskFileSize string, microshiftRolePath string, rootDir string, etcdOnRamdisk bool) string { + fqdn string, diskFileSize string, microshiftRolePath string, rootDir string, etcdOnRamdisk bool, ramdiskSize string) string { varsData := GroupVarsData{ fqdn, diskFileSize, microshiftRolePath, etcdOnRamdisk, + ramdiskSize, } filePath := rootDir + "/all.yaml" template, err := cutils.ParseString(groupvars, varsData) diff --git a/cli/cmd/dev/microshift/static/all.yaml.tmpl b/cli/cmd/dev/microshift/static/all.yaml.tmpl index 7bbb29c..2fb24a5 100644 --- a/cli/cmd/dev/microshift/static/all.yaml.tmpl +++ b/cli/cmd/dev/microshift/static/all.yaml.tmpl @@ -11,6 +11,7 @@ microshift_role_version: ee9a80a3338837e6f7ed58f424ddcb96b976984f disk_file_sparsed: true disk_file_size: {{ .DiskFileSize }} etcd_on_ramdisk: {{ .ETCDOnRAMDisk }} +ramdisk_size: {{ .RAMDiskSize }} setup_olm: true microshift_additional_addresses: - {{ "\"{{ microshift_fqdn }}\"" }} diff --git a/cli/cmd/initialize.go b/cli/cmd/initialize.go index e027d95..316b5a4 100644 --- a/cli/cmd/initialize.go +++ b/cli/cmd/initialize.go @@ -167,6 +167,7 @@ func initializeCLIConfig(isDevEnv bool) { defaultContextConfig.Dev.Microshift.User = "cloud-user" defaultContextConfig.Dev.Microshift.OpenshiftPullSecret = "PULL SECRET" defaultContextConfig.Dev.Microshift.DiskFileSize = "30G" + defaultContextConfig.Dev.Microshift.RAMDiskSize = "1g" defaultContextConfig.Dev.Tests.ExtraVars = map[string]string{"foo": "bar"} } diff --git a/cli/cmd/utils/utils.go b/cli/cmd/utils/utils.go index 894abef..34f92db 100644 --- a/cli/cmd/utils/utils.go +++ b/cli/cmd/utils/utils.go @@ -75,6 +75,7 @@ type SoftwareFactoryConfigContext struct { OpenshiftPullSecret string `json:"openshift-pull-secret" mapstructure:"openshift-pull-secret"` DiskFileSize string `json:"disk-file-size" mapstructure:"disk-file-size"` ETCDOnRAMDisk bool `json:"etcd-on-ramdisk" mapstructure:"etcd-on-ramdisk"` + RAMDiskSize string `json:"ramdisk-size" mapstructure:"ramdisk-size"` } `json:"microshift" mapstructure:"microshift"` Tests struct { DemoReposPath string `json:"demo-repos-path" mapstructure:"demo-repos-path"` diff --git a/sfcli.yaml b/sfcli.yaml index 38162bb..f383de4 100644 --- a/sfcli.yaml +++ b/sfcli.yaml @@ -12,6 +12,7 @@ contexts: host: microshift.dev openshift-pull-secret: user: cloud-user + ramdisk_size: 1g sf-operator-repository-path: /path/to/sf-operator tests: demo-repos-path: "" @@ -22,4 +23,4 @@ contexts: manifest-file: /path/to/manifest namespace: sf standalone: false -default-context: my-context \ No newline at end of file +default-context: my-context diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index e97189c..f43b0be 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -35,6 +35,7 @@ - "sfop.me" - "microshift.dev" etcd_on_ramdisk: true + ramdisk_size: 1g cloudprovider_dns: - 199.204.44.24 - 199.204.47.54