-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mathieu Cesbron <[email protected]>
- Loading branch information
1 parent
e57531a
commit 33c0b7b
Showing
7 changed files
with
123 additions
and
50 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,31 @@ | ||
package controllers | ||
|
||
import ( | ||
"context" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
corev1 "k8s.io/api/core/v1" | ||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
namespaceTest = "namespace-test" | ||
redisStandaloneName = "redis-standalone-test" | ||
) | ||
|
||
var _ = Describe("Application controller", func() { | ||
Context("When creating an application", func() { | ||
It("Should create a deployment", func() { | ||
ctx := context.Background() | ||
|
||
// create a namespace in the cluster | ||
ns := corev1.Namespace{ | ||
ObjectMeta: v1.ObjectMeta{ | ||
Name: namespaceTest, | ||
}, | ||
} | ||
Expect(k8sClient.Create(ctx, &ns)).To(Succeed()) | ||
}) | ||
}) | ||
}) |
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
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,40 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
K8S_VERSION="${K8S_VERSION:="1.28.x"}" | ||
KUBEBUILDER_ASSETS="/usr/local/kubebuilder/bin" | ||
|
||
main() { | ||
tools | ||
kubebuilder | ||
} | ||
|
||
tools() { | ||
go install github.com/google/go-licenses@latest | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | ||
go install github.com/google/ko@latest | ||
go install github.com/mikefarah/yq/v4@latest | ||
go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest | ||
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest | ||
go install github.com/sigstore/cosign/v2/cmd/cosign@latest | ||
go install -tags extended github.com/gohugoio/[email protected] | ||
go install golang.org/x/vuln/cmd/govulncheck@latest | ||
go install github.com/onsi/ginkgo/v2/ginkgo@latest | ||
go install github.com/rhysd/actionlint/cmd/actionlint@latest | ||
go install github.com/mattn/goveralls@latest | ||
|
||
if ! echo "$PATH" | grep -q "${GOPATH:-undefined}/bin\|$HOME/go/bin"; then | ||
echo "Go workspace's \"bin\" directory is not in PATH. Run 'export PATH=\"\$PATH:\${GOPATH:-\$HOME/go}/bin\"'." | ||
fi | ||
} | ||
|
||
kubebuilder() { | ||
sudo mkdir -p ${KUBEBUILDER_ASSETS} | ||
sudo chown "${USER}" ${KUBEBUILDER_ASSETS} | ||
arch=$(go env GOARCH) | ||
ln -sf $(setup-envtest use -p path "${K8S_VERSION}" --arch="${arch}" --bin-dir="${KUBEBUILDER_ASSETS}")/* ${KUBEBUILDER_ASSETS} | ||
find $KUBEBUILDER_ASSETS | ||
} | ||
|
||
main "$@" |