|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * cli_reference/osdk/cli-osdk-install.adoc |
| 4 | +// * operators/operator_sdk/osdk-installing-cli.adoc |
| 5 | + |
| 6 | +:_content-type: PROCEDURE |
| 7 | +[id="osdk-installing-cli-macos_{context}"] |
| 8 | += Installing the Operator SDK CLI on macOS |
| 9 | + |
| 10 | +You can install the OpenShift SDK CLI tool on macOS. |
| 11 | + |
| 12 | +.Prerequisites |
| 13 | + |
| 14 | +* link:https://golang.org/dl/[Go] v1.19+ |
| 15 | +ifdef::openshift-origin[] |
| 16 | +* link:https://docs.docker.com/install/[`docker`] v17.03+, link:https://github.com/containers/libpod/blob/master/install.md[`podman`] v1.2.0+, or link:https://github.com/containers/buildah/blob/master/install.md[`buildah`] v1.7+ |
| 17 | +endif::[] |
| 18 | +ifndef::openshift-origin[] |
| 19 | +* `docker` v17.03+, `podman` v1.9.3+, or `buildah` v1.7+ |
| 20 | +endif::[] |
| 21 | +
|
| 22 | +.Procedure |
| 23 | + |
| 24 | +. For the `amd64` and `arm64` architectures, navigate to the link:https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/operator-sdk/[OpenShift mirror site for the `amd64` architecture] and link:https://mirror.openshift.com/pub/openshift-v4/arm64/clients/operator-sdk/[OpenShift mirror site for the `arm64` architecture] respectively. |
| 25 | + |
| 26 | +. From the latest {product-version} directory, download the latest version of the tarball for macOS. |
| 27 | + |
| 28 | +. Unpack the Operator SDK archive for `amd64` architecture by running the following command: |
| 29 | ++ |
| 30 | +[source,terminal,subs="attributes+"] |
| 31 | +---- |
| 32 | +$ tar xvf operator-sdk-v{osdk_ver}-ocp-darwin-x86_64.tar.gz |
| 33 | +---- |
| 34 | + |
| 35 | +. Unpack the Operator SDK archive for `arm64` architecture by running the following command: |
| 36 | ++ |
| 37 | +[source,terminal,subs="attributes+"] |
| 38 | +---- |
| 39 | +$ tar xvf operator-sdk-v{osdk_ver}-ocp-darwin-aarch64.tar.gz |
| 40 | +---- |
| 41 | + |
| 42 | +. Make the file executable by running the following command: |
| 43 | ++ |
| 44 | +[source,terminal] |
| 45 | +---- |
| 46 | +$ chmod +x operator-sdk |
| 47 | +---- |
| 48 | + |
| 49 | +. Move the extracted `operator-sdk` binary to a directory that is on your `PATH` by running the following command: |
| 50 | ++ |
| 51 | +[TIP] |
| 52 | +==== |
| 53 | +Check your `PATH` by running the following command: |
| 54 | + |
| 55 | +[source,terminal] |
| 56 | +---- |
| 57 | +$ echo $PATH |
| 58 | +---- |
| 59 | +==== |
| 60 | ++ |
| 61 | +[source,terminal] |
| 62 | +---- |
| 63 | +$ sudo mv ./operator-sdk /usr/local/bin/operator-sdk |
| 64 | +---- |
| 65 | +
|
| 66 | +.Verification |
| 67 | +
|
| 68 | +* After you install the Operator SDK CLI, verify that it is available by running the following command:: |
| 69 | ++ |
| 70 | +[source,terminal] |
| 71 | +---- |
| 72 | +$ operator-sdk version |
| 73 | +---- |
| 74 | ++ |
| 75 | +.Example output |
| 76 | +[source,terminal,subs="attributes+"] |
| 77 | +---- |
| 78 | +operator-sdk version: "v{osdk_ver}-ocp", ... |
| 79 | +---- |
0 commit comments