Skip to content

Commit

Permalink
Use kind to create cluster in CI, instead of k3d (#1821)
Browse files Browse the repository at this point in the history
* Use kind to create cluster in CI, instead of k3d
* Install just csi-hostpath-driver only for `make test`
* Use service object instead of secret object
Co-authored-by: Chaitali Gondhalekar <chaitali@kasten.io>
Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com>
  • Loading branch information
viveksinghggits committed Dec 28, 2022
1 parent 8663ebd commit 0af8e1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: src
- uses: AbsaOSS/k3d-action@v2
with:
cluster-name: "kanister-run-${{ matrix.testSuite }}"
args: >-
--agents 3
--no-lb
--k3s-arg "--no-deploy=traefik,servicelb@server:*"
- uses: helm/kind-action@v1.4.0
- run: tar -xvf ./src.tar.gz
- run: |
make install-csi-hostpath-driver
make install-minio
if: matrix.testSuite == 'integration-test' || matrix.testSuite == 'helm-test'
# A test (CRDSuite) that runs as part of `make test` requies atleast one CRD to
# be present on the cluster. That's why we are only installing csi-hostpath-driver
# before running `make test`, to create some CRDs on the cluster.
- run: |
make install-csi-hostpath-driver
if: matrix.testSuite == 'test'
- run: make ${{ matrix.testSuite }}
build:
runs-on: ubuntu-20.04
Expand Down
9 changes: 5 additions & 4 deletions pkg/kube/unstructured_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ package kube
import (
"bytes"
"context"
. "gopkg.in/check.v1"
"text/template"

. "gopkg.in/check.v1"

"github.com/Masterminds/sprig"
"k8s.io/apimachinery/pkg/runtime/schema"
)
Expand All @@ -37,9 +38,9 @@ func (s *UnstructuredSuite) TestFetch(c *C) {
gvr := schema.GroupVersionResource{
Group: "",
Version: "v1",
Resource: "serviceaccounts",
Resource: "services",
}
u, err := FetchUnstructuredObject(ctx, gvr, "default", "default")
u, err := FetchUnstructuredObject(ctx, gvr, "default", "kubernetes")
c.Assert(err, IsNil)

buf := bytes.NewBuffer(nil)
Expand All @@ -49,7 +50,7 @@ func (s *UnstructuredSuite) TestFetch(c *C) {
arg string
}{
{"{{ .Unstructured.metadata.name }}"},
{"{{ index .Unstructured.secrets 0 }}"},
{"{{ .Unstructured.spec.clusterIP }}"},
} {
t, err := template.New("config").Option("missingkey=error").Funcs(sprig.TxtFuncMap()).Parse(tc.arg)
c.Assert(err, IsNil)
Expand Down

0 comments on commit 0af8e1c

Please sign in to comment.