Skip to content

Commit

Permalink
sync version comments, update actions and update cosign flag (#538)
Browse files Browse the repository at this point in the history
* sync version comments, update actions and update cosign flag

Signed-off-by: cpanato <ctadeu@gmail.com>

* fix lints

Signed-off-by: cpanato <ctadeu@gmail.com>

---------

Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato committed Mar 24, 2023
1 parent f12bab2 commit 7f3a83d
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 53 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yaml
Expand Up @@ -12,33 +12,33 @@ jobs:
steps:

- name: checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
fetch-depth: 0

- name: shellcheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0

- name: Setup go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v3.3.0
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version-file: './go.mod'
check-latest: true

- uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.11.0
version: v3.11.2

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v3.1.0
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
with:
install-only: true

- name: Install cosign
uses: sigstore/cosign-installer@c3667d99424e7e6047999fb6246c0da843953c65 # v2.6.0
uses: sigstore/cosign-installer@c3667d99424e7e6047999fb6246c0da843953c65 # v3.0.1

- name: Install syft
uses: anchore/sbom-action/download-syft@448520c4f19577ffce70a8317e619089054687e3 # v0.13.4
uses: anchore/sbom-action/download-syft@448520c4f19577ffce70a8317e619089054687e3 # v0.14.0

- name: Install k8s Kind
uses: helm/kind-action@d8ccf8fb623ce1bb360ae2f45f323d9d5c5e9f00 # v1.3.0
Expand All @@ -65,10 +65,10 @@ jobs:
git diff --exit-code
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.0.0
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.0.0
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0

- name: Build
run: |
Expand All @@ -82,8 +82,8 @@ jobs:
name: check-docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v3
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version-file: './go.mod'
check-latest: true
Expand All @@ -103,12 +103,12 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v3
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version-file: './go.mod'
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3
with:
version: v1.51.0
version: v1.52.1
16 changes: 8 additions & 8 deletions .github/workflows/release.yaml
Expand Up @@ -17,29 +17,29 @@ jobs:
steps:

- name: checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.0.1
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
fetch-depth: 0

- name: shellcheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0

- name: Setup go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v3.3.0
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version-file: './go.mod'
check-latest: true

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v3.1.0
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
with:
install-only: true

- name: Install cosign
uses: sigstore/cosign-installer@c3667d99424e7e6047999fb6246c0da843953c65 # v2.6.0
uses: sigstore/cosign-installer@c3667d99424e7e6047999fb6246c0da843953c65 # v3.0.1

- name: Install syft
uses: anchore/sbom-action/download-syft@448520c4f19577ffce70a8317e619089054687e3 # v0.13.4
uses: anchore/sbom-action/download-syft@448520c4f19577ffce70a8317e619089054687e3 # v0.14.0

- name: Install tools
run: |
Expand All @@ -53,13 +53,13 @@ jobs:
git diff --exit-code
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.0.0
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.0.0
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0

- name: Login to registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.0.0
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: quay.io
username: ${{ secrets.DOCKER_USERNAME }}
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Expand Up @@ -24,6 +24,7 @@ issues:
linters:
- errcheck
- gosec
- revive
max-issues-per-linter: 0
max-same-issues: 0
run:
Expand Down
20 changes: 10 additions & 10 deletions .goreleaser.yml
@@ -1,14 +1,14 @@
project_name: chart-testing

env:
- COSIGN_EXPERIMENTAL=true
- COSIGN_YES=true

before:
hooks:
- go mod download

sboms:
- artifacts: archive
- artifacts: archive

builds:
- main: ct/main.go
Expand Down Expand Up @@ -92,14 +92,14 @@ dockers:
- etc/lintconf.yaml

docker_manifests:
- name_template: quay.io/helmpack/chart-testing:latest
image_templates:
- quay.io/helmpack/chart-testing:latest-amd64
- quay.io/helmpack/chart-testing:latest-arm64
- name_template: quay.io/helmpack/chart-testing:{{ .Tag }}
image_templates:
- quay.io/helmpack/chart-testing:{{ .Tag }}-amd64
- quay.io/helmpack/chart-testing:{{ .Tag }}-arm64
- name_template: quay.io/helmpack/chart-testing:latest
image_templates:
- quay.io/helmpack/chart-testing:latest-amd64
- quay.io/helmpack/chart-testing:latest-arm64
- name_template: quay.io/helmpack/chart-testing:{{ .Tag }}
image_templates:
- quay.io/helmpack/chart-testing:{{ .Tag }}-amd64
- quay.io/helmpack/chart-testing:{{ .Tag }}-arm64

signs:
- id: all
Expand Down
2 changes: 1 addition & 1 deletion ct/cmd/docGen.go
Expand Up @@ -34,7 +34,7 @@ func newGenerateDocsCmd() *cobra.Command {
}
}

func generateDocs(cmd *cobra.Command, args []string) error {
func generateDocs(_ *cobra.Command, _ []string) error {
fmt.Println("Generating docs...")

err := doc.GenMarkdownTree(NewRootCmd(), "doc")
Expand Down
2 changes: 1 addition & 1 deletion ct/cmd/install.go
Expand Up @@ -84,7 +84,7 @@ func addInstallFlags(flags *flag.FlagSet) {
Skip resources clean-up. Used if need to continue other flows or keep it around.`))
}

func install(cmd *cobra.Command, args []string) error {
func install(cmd *cobra.Command, _ []string) error {
fmt.Println("Installing charts...")

printConfig, err := cmd.Flags().GetBool("print-config")
Expand Down
2 changes: 1 addition & 1 deletion ct/cmd/lint.go
Expand Up @@ -76,7 +76,7 @@ func addLintFlags(flags *flag.FlagSet) {
Example: "helm unittest --helm3 -f tests/*.yaml {{ .Path }}"`))
}

func lint(cmd *cobra.Command, args []string) error {
func lint(cmd *cobra.Command, _ []string) error {
fmt.Println("Linting charts...")

printConfig, err := cmd.Flags().GetBool("print-config")
Expand Down
2 changes: 1 addition & 1 deletion ct/cmd/lintAndInstall.go
Expand Up @@ -39,7 +39,7 @@ func newLintAndInstallCmd() *cobra.Command {
return cmd
}

func lintAndInstall(cmd *cobra.Command, args []string) error {
func lintAndInstall(cmd *cobra.Command, _ []string) error {
fmt.Println("Linting and installing charts...")

printConfig, err := cmd.Flags().GetBool("print-config")
Expand Down
2 changes: 1 addition & 1 deletion ct/cmd/listChanged.go
Expand Up @@ -40,7 +40,7 @@ func newListChangedCmd() *cobra.Command {
return cmd
}

func listChanged(cmd *cobra.Command, args []string) error {
func listChanged(cmd *cobra.Command, _ []string) error {
printConfig, err := cmd.Flags().GetBool("print-config")
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion ct/cmd/version.go
Expand Up @@ -37,7 +37,7 @@ func newVersionCmd() *cobra.Command {
}
}

func version(cmd *cobra.Command, args []string) {
func version(_ *cobra.Command, _ []string) {
fmt.Println("Version:\t", Version)
fmt.Println("Git commit:\t", GitCommit)
fmt.Println("Date:\t\t", BuildDate)
Expand Down
6 changes: 2 additions & 4 deletions pkg/chart/chart.go
Expand Up @@ -650,10 +650,8 @@ func (t *Testing) testRelease(namespace, release, releaseSelector string) error
if err := t.kubectl.WaitForDeployments(namespace, releaseSelector); err != nil {
return err
}
if err := t.helm.Test(namespace, release); err != nil {
return err
}
return nil

return t.helm.Test(namespace, release)
}

func (t *Testing) generateInstallConfig(chart *Chart) (namespace, release, releaseSelector string, cleanup func()) {
Expand Down
16 changes: 4 additions & 12 deletions pkg/tool/helm.go
Expand Up @@ -61,21 +61,13 @@ func (h Helm) InstallWithValues(chart string, valuesFile string, namespace strin
values = []string{"--values", valuesFile}
}

if err := h.exec.RunProcess("helm", "install", release, chart, "--namespace", namespace,
"--wait", values, h.extraArgs, h.extraSetArgs); err != nil {
return err
}

return nil
return h.exec.RunProcess("helm", "install", release, chart, "--namespace", namespace,
"--wait", values, h.extraArgs, h.extraSetArgs)
}

func (h Helm) Upgrade(chart string, namespace string, release string) error {
if err := h.exec.RunProcess("helm", "upgrade", release, chart, "--namespace", namespace,
"--reuse-values", "--wait", h.extraArgs, h.extraSetArgs); err != nil {
return err
}

return nil
return h.exec.RunProcess("helm", "upgrade", release, chart, "--namespace", namespace,
"--reuse-values", "--wait", h.extraArgs, h.extraSetArgs)
}

func (h Helm) Test(namespace string, release string) error {
Expand Down

0 comments on commit 7f3a83d

Please sign in to comment.