1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 15:46:57 +01:00
Files
openshift-docs/modules/osdk-cli-reference-new.adoc
sheriff-rh 981be5a658 apiextensions.k8s.io/v1 and --crd-version flag added
additional changes

fixed typo

corrections

feedback
2020-10-15 12:29:45 +00:00

90 lines
2.0 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
|`--api-version`
|CRD `APIVersion` in the format `$GROUP_NAME/$VERSION`, for example `app.example.com/v1alpha1`. Used with `ansible` or `helm` types.
|`--crd-version`
|CRD version to generate, like `v1`. Default setting is `v1beta1`.
|`--generate-playbook`
|Generate an Ansible playbook skeleton. Used with `ansible` type.
|`--header-file <string>`
|Path to file containing headers for generated Go files. Copied to `hack/boilerplate.go.txt`.
|`--helm-chart <string>`
|Initialize Helm operator with existing Helm chart: `<url>`, `<repo>/<name>`, or local path.
|`--helm-chart-repo <string>`
|Chart repository URL for the requested Helm chart.
|`--helm-chart-version <string>`
|Specific version of the Helm chart. Default is latest version.
|`--help, -h`
|Usage and help output.
|`--kind <string>`
|CRD `Kind`, for example `AppService`. Used with `ansible` or `helm` types.
| `--skip-git-init`
|Do not initialize the directory as a Git repository.
|`--type`
|Type of Operator to initialize: `go`, `ansible` or `helm`. Default is `go`.
|===
[NOTE]
====
Starting with Operator SDK v0.12.0, the `--dep-manager` flag and support for
`dep`-based projects have been removed. Go projects are now scaffolded to use Go
modules.
====
.Example usage for Go project
[source,terminal]
----
$ mkdir $GOPATH/src/github.com/example.com/
----
[source,terminal]
----
$ cd $GOPATH/src/github.com/example.com/
----
[source,terminal]
----
$ operator-sdk new app-operator
----
.Example usage for Ansible project
[source,terminal]
----
$ operator-sdk new app-operator \
--type=ansible \
--api-version=app.example.com/v1alpha1 \
--kind=AppService
----