-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a small test which runs a basic plugin
This change also modifies our Makefile and CI scripts so that the tests can be run on a separate kind cluster. Signed-off-by: Bridget McErlean <[email protected]>
- Loading branch information
Showing
7 changed files
with
92 additions
and
6 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
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
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 | ||
|
||
cluster="integration" | ||
|
||
if ! kind get clusters | grep -q "^$cluster$"; then | ||
kind create cluster --name $cluster | ||
# Although the cluster has been created, not all the pods in kube-system are created/available | ||
sleep 20 | ||
fi | ||
|
||
make KIND_CLUSTER=$cluster deploy_kind | ||
KUBECONFIG="$(kind get kubeconfig-path --name="$cluster")" VERBOSE=true make int |
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
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,13 @@ | ||
sonobuoy-config: | ||
driver: Job | ||
plugin-name: basic-plugin | ||
spec: | ||
command: ["/bin/sh","-c"] | ||
args: ["echo done >> output.txt && echo -n $(pwd)/output.txt >> /tmp/results/done"] | ||
image: debian:stretch-slim | ||
name: plugin | ||
resources: {} | ||
volumeMounts: | ||
- mountPath: /tmp/results | ||
name: results | ||
|
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,21 @@ | ||
package integration | ||
|
||
import ( | ||
"math/rand" | ||
"time" | ||
) | ||
|
||
var seededRand = rand.New(rand.NewSource(time.Now().UnixNano())) | ||
|
||
func stringWithCharset(length int, charset string) string { | ||
b := make([]byte, length) | ||
for i := range b { | ||
b[i] = charset[seededRand.Intn(len(charset))] | ||
} | ||
return string(b) | ||
} | ||
|
||
func randomNamespace() string { | ||
charset := "abcdefghijklmnopqrstuvwxyz" | ||
return "integration-" + stringWithCharset(5, charset) | ||
} |
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