turtles/examples
Andrea Mazzotti bb312920dc
Suggest go workspace setup for Examples CLI Tool (#1394)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2025-05-27 18:55:50 +02:00
..
applications
clusterclasses
clusters/docker/rke2
legacy
README.md Suggest go workspace setup for Examples CLI Tool (#1394) 2025-05-27 18:55:50 +02:00
go.mod Add examples tooling (#1388) 2025-05-26 11:39:38 +00:00
go.sum Add examples tooling (#1388) 2025-05-26 11:39:38 +00:00
main.go Add examples tooling (#1388) 2025-05-26 11:39:38 +00:00

README.md

Examples CLI Tool

This CLI tool is designed to extract and apply cluster class examples.

Usage

From the examples/ directory, configure the go workspace and download the dependencies:

go work use ./
go mod download

Run the program with:

go run main.go <search_key>

<search_key>: The key to search for in the available cluster classes. In case of an incorrect ClusterClass key used, the closest matching key will be suggested.

Flags

  • -l, --list: List available cluster class names from examples.
  • -r, --regex: ClusterClass search regex.

Examples

List available cluster classes

go run main.go -l

Example output:

Available classes: [azure-aks-example azure-example azure-rke2-example]

Search for a specific cluster class

go run main.go azure-aks

Search for cluster classes using a regex

go run main.go -r "azure"

Note: Regex search can return multiple examples.

To apply the extracted examples, you can use the following command:

go run main.go <search_key> | kubectl apply -f -