Skip to content

Commit 6afff5b

Browse files
committed
dev create microshift - update the doc to ease process for the reader
This change: - Removew uneeded reference to the ansible-microshift-role as the entrypoint is the sf-operator CLI. - Adds a sample of the required contents for that command to work. - Adds the command to run. - Ensures the sf-operator-path get a default value `getwcd()`. - Removes reference to the no longer existing logserver CRD. Change-Id: Id2aa4a26c2e4da5ced2c00e42f66f3cd8836cb4e
1 parent b3e6e9a commit 6afff5b

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

cli/cmd/dev/dev.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,16 @@ func createMicroshift(kmd *cobra.Command, cliCtx cliutils.SoftwareFactoryConfigC
105105
msAnsibleMicroshiftRolePath = rootDir + "/ansible-microshift-role"
106106
ctrl.Log.Info("No path to ansible-microshift-role provided, the role will be cloned into " + msAnsibleMicroshiftRolePath)
107107
}
108+
defaultSFOperatorRepositoryPath, _ := os.Getwd()
108109
msSFOperatorRepositoryPath := cliCtx.Dev.SFOperatorRepositoryPath
109110
if msSFOperatorRepositoryPath == "" {
110-
ctrl.Log.Error(errMissingArg, "The path to the sf-operator repository must be set in `dev` section of the configuration file")
111-
os.Exit(1)
111+
if defaultSFOperatorRepositoryPath != "" {
112+
msSFOperatorRepositoryPath = defaultSFOperatorRepositoryPath
113+
ctrl.Log.Info("Using current working directory for sf-operator-repository-path: " + msSFOperatorRepositoryPath)
114+
} else {
115+
ctrl.Log.Error(errMissingArg, "The path to the sf-operator repository must be set in `dev` section of the configuration file")
116+
os.Exit(1)
117+
}
112118
}
113119

114120
options := ms.MkAnsiblePlaybookOptions(msHost, msUser, msOpenshiftPullSecret, rootDir)

cli/cmd/dev/runTests.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ func ApplyCRDs(config *rest.Config, sfOperatorRepoPath string) {
110110
crdInstallOptions := envtest.CRDInstallOptions{
111111
Paths: []string{
112112
filepath.Join(sfOperatorRepoPath, "config/crd/bases/sf.softwarefactory-project.io_softwarefactories.yaml"),
113-
filepath.Join(sfOperatorRepoPath, "config/crd/bases/sf.softwarefactory-project.io_logservers.yaml"),
114113
},
115114
}
116115
_, err := envtest.InstallCRDs(config, crdInstallOptions)

doc/developer/microshift.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
This document provides instructions on how to deploy a [MicroShift](https://github.com/openshift/microshift) instance on a CentOS 9 Stream host, from your development computer.
44

5-
We use Microshift as the target **OpenShift instance** for SF-Operator when deploying, developing locally, or testing in our [CI](https://softwarefactory-project.io/zuul/t/local/buildsets?project=software-factory%2Fsf-operator&skip=0).
6-
7-
The deployment will be performed via Ansible, by using the
8-
[ansible-microshift-role](https://github.com/openstack-k8s-operators/ansible-microshift-role).
5+
We use Microshift as the target **OpenShift instance** for SF-Operator when deploying, developing locally, or testing in our [CI](https://microshift.softwarefactory-project.io/zuul/t/sf/builds?project=software-factory%2Fsf-operator&skip=0).
96

7+
The deployment will be performed via sf-operator CLI.
108

119
1. [Requirements](#requirements)
1210
1. [Install MicroShift](#install-microshift)
@@ -69,10 +67,31 @@ sudo dnf install -y ansible-core golang
6967
You have to generate and adapt the configuration file to deploy microshift
7068

7169
```sh
72-
sf-operator init config > myconfig.yaml
70+
go run ./main.go init config --dev > myconfig.yaml
71+
```
72+
73+
Then edit `myconfig.yaml` as follow:
74+
75+
```yaml
76+
contexts:
77+
my-context:
78+
development:
79+
microshift:
80+
disk-file-size: "30G"
81+
etcd-on-ramdisk: true
82+
host: "microshift.dev"
83+
openshift-pull-secret: '<paste-pull-secret-here>'
84+
user: "cloud-user"
85+
sf-operator-repository-path: "~/git/softwarefactory-project.io/software-factory/sf-operator"
86+
default-context: my-context
7387
```
7488
75-
Installing Microshift is straightforward with the [ansible-microshift-role](https://github.com/openstack-k8s-operators/ansible-microshift-role).
76-
The [sf-operator](./../reference/cli/index.md) CLI provides the [`dev create microshift --config myconfig.yaml` subcommand](./../reference/cli/index.md#create-microshift) that sets up a microshift host from start to finish. Please refer to the documentation of this subcommand to learn how to use it.
89+
Refer to the [`dev create microshift --config myconfig.yaml` subcommand](./../reference/cli/index.md#create-microshift) for more information about the command.
90+
91+
Finally run the sf-operator CLI as follow:
92+
93+
```sh
94+
go run ./main.go --config ./myconfig.yaml dev create microshift --skip-local-setup
95+
```
7796

7897
Once the deployment has ended successfully, you are now ready to deploy and hack SF-Operator, congratulations!

0 commit comments

Comments
 (0)