1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/osdk-cli-reference-new.adoc
2019-05-13 13:57:48 +10:00

52 lines
1.2 KiB
Plaintext

[id="osdk-cli-reference-new_{context}"]
= new
The `operator-sdk new` command creates a new Operator application and generates
(or _scaffolds_) a default project directory layout based on the input
`<project_name>`.
.`new` arguments
[options="header",cols="1,3"]
|===
|Argument |Description
|`<project_name>`
|Name of the new project.
|===
.`new` flags
[options="header",cols="1,3"]
|===
|Flag |Description
| `--skip-git-init`
|Do not initialize the directory as a Git repository.
|`--type`
a|Type of Operator to initialize: `ansible` or `go` (default: `go`). Also requires the following flags if `--type=ansible`:
* `--api-version`: CRD `APIVersion` in the format `$GROUP_NAME/$VERSION` (e.g., `app.example.com/v1alpha1`)
* `--kind`: CRD `Kind` (e.g., `AppService`).
|`--cluster-scoped`
|Initialize the Operator to be cluster-scoped instead of namespace-scoped.
|`-h, --help`
|Usage help output.
|===
.Example usage for Go project
----
$ mkdir $GOPATH/src/github.com/example.com/
$ cd $GOPATH/src/github.com/example.com/
$ operator-sdk new app-operator
----
.Example usage for Ansible project
----
$ operator-sdk new app-operator \
--type=ansible \
--api-version=app.example.com/v1alpha1 \
--kind=AppService
----