forked from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from robbert229/feature/operator-sdk
feature: added operator-sdk
- Loading branch information
Showing
9 changed files
with
229 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
# OperatorSDK (operator-sdk) | ||
|
||
A feature adding [operator-sdk](https://sdk.operatorframework.io/), a component of the [Operator Framework](https://github.com/operator-framework), an open source toolkit to manage kubernetes operators. | ||
|
||
## Example Usage | ||
|
||
```json | ||
"features": { | ||
"ghcr.io/robbert229/devcontainer-features/operator-sdk:1": {} | ||
} | ||
``` | ||
|
||
## Options | ||
|
||
| Options Id | Description | Type | Default Value | | ||
|-----|-----|-----|-----| | ||
| version | Select the major version of postgres | string | v1.33.0 | | ||
|
||
|
||
--- | ||
|
||
_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/robbert229/devcontainer-features/blob/main/src/postgresql-client/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "OperatorSDK", | ||
"id": "operator-sdk", | ||
"version": "1.0.0", | ||
"description": "A feature adding [operator-sdk](https://sdk.operatorframework.io/), a component of the [Operator Framework](https://github.com/operator-framework), an open source toolkit to manage kubernetes operators.", | ||
"options": { | ||
"version": { | ||
"type": "string", | ||
"proposals": [ | ||
"v1.33.0", | ||
"v1.32.0", | ||
"v1.31.0", | ||
"v1.30.0" | ||
], | ||
"default": "v1.33.0", | ||
"description": "Select the version of operator-sdk to install" | ||
} | ||
}, | ||
"installsAfter": [ | ||
"ghcr.io/devcontainers/features/common-utils" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Maintainer: John Rowley | ||
|
||
set -e | ||
|
||
# Clean up | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
if [ "$(id -u)" -ne 0 ]; then | ||
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' | ||
exit 1 | ||
fi | ||
|
||
apt_get_update() { | ||
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then | ||
echo "Running apt-get update..." | ||
apt-get update -y | ||
fi | ||
} | ||
|
||
# Checks if packages are installed and installs them if not | ||
check_packages() { | ||
if ! dpkg -s "$@" > /dev/null 2>&1; then | ||
apt_get_update | ||
apt-get -y install --no-install-recommends "$@" | ||
fi | ||
} | ||
|
||
# Ensure apt is in non-interactive to avoid prompts | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
# ensure that the required packages are installed | ||
check_packages curl gpg ca-certificates | ||
|
||
|
||
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac) | ||
export OS=$(uname | awk '{print tolower($0)}') | ||
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/${VERSION} | ||
curl -L -o ./operator-sdk ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} | ||
|
||
install ./operator-sdk /usr/local/bin/ | ||
|
||
# Clean up | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
echo "Done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. | ||
check "execute command" bash -c "operator-sdk version" | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. | ||
check "execute command" bash -c "operator-sdk version" | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. | ||
check "execute command" bash -c "operator-sdk version" | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. | ||
check "execute command" bash -c "operator-sdk version" | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"operatorsdk-v1.30.0": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"operator-sdk": { | ||
"version":"v1.30.0" | ||
} | ||
} | ||
}, | ||
"operatorsdk-v1.31.0": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"operator-sdk": { | ||
"version":"v1.31.0" | ||
} | ||
} | ||
}, | ||
"operatorsdk-v1.32.0": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"operator-sdk": { | ||
"version":"v1.32.0" | ||
} | ||
} | ||
}, | ||
"operatorsdk-v1.33.0": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"operator-sdk": { | ||
"version":"v1.33.0" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
# This test file will be executed against an auto-generated devcontainer.json that | ||
# includes the 'hello' Feature with no options. | ||
# | ||
# For more information, see: https://github.com/devcontainers/cli/blob/main/docs/features/test.md | ||
# | ||
# Eg: | ||
# { | ||
# "image": "<..some-base-image...>", | ||
# "features": { | ||
# "hello": {} | ||
# }, | ||
# "remoteUser": "root" | ||
# } | ||
# | ||
# Thus, the value of all options will fall back to the default value in | ||
# the Feature's 'devcontainer-feature.json'. | ||
# For the 'hello' feature, that means the default favorite greeting is 'hey'. | ||
# | ||
# These scripts are run as 'root' by default. Although that can be changed | ||
# with the '--remote-user' flag. | ||
# | ||
# This test can be run with the following command: | ||
# | ||
# devcontainer features test \ | ||
# --features hello \ | ||
# --remote-user root \ | ||
# --skip-scenarios \ | ||
# --base-image mcr.microsoft.com/devcontainers/base:ubuntu \ | ||
# /path/to/this/repo | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib | ||
# Provides the 'check' and 'reportResults' commands. | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. Syntax is... | ||
# check <LABEL> <cmd> [args...] | ||
check "execute command" bash -c "operator-sdk version" | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |