diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 000000000..721df6b11 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,11 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: 75..100 + status: + patch: + default: + target: 75% diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 64f5eaa10..820adaec5 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -22,7 +22,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: "^1.17" + go-version: "^1.21" - name: Test build run: go build @@ -35,6 +35,9 @@ jobs: - name: Codecov uses: codecov/codecov-action@v3.1.4 + with: + file: ./coverage.xml # Replace with the path to your coverage report + fail_ci_if_error: true - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@0.11.0 diff --git a/.gitignore b/.gitignore index 22e9bc6be..83cdf8a84 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,7 @@ go.work **/cover.out bin/ -_artifacts \ No newline at end of file +_artifacts +profile.cov +coverage.xml + diff --git a/go.mod b/go.mod index 022d052e4..4ea4fe6cb 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nutanix-cloud-native/cloud-provider-nutanix -go 1.20 +go 1.21 require ( github.com/google/uuid v1.3.0 diff --git a/pkg/provider/client.go b/pkg/provider/client.go index 39ede6393..5c9df38ff 100644 --- a/pkg/provider/client.go +++ b/pkg/provider/client.go @@ -77,6 +77,18 @@ func (n *nutanixClient) Get() (interfaces.Prism, error) { return nil, err } + x, err := nutanixClient.V3.GetCluster(context.Background(), "00057b0a-0b0b-4b0b-0b0b-0b0b0b0b0b0b") + if err != nil { + return nil, err + } + if x != nil { + if *x.Spec.Name != "Nutanix" { + fmt.Println("name not nutanix") + } else { + fmt.Println("name is nutanix") + } + } + return nutanixClient.V3, nil }