diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 5fa239075..f84bd015a 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -56,7 +56,7 @@ jobs:
- uses: actions/setup-go@v5
with:
- go-version: '1.22.0'
+ go-version: '1.25.0'
# Set up QEMU emulator to allow building multi-arch images
- name: Set up QEMU
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 529078e35..cc0a62aba 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -6,7 +6,7 @@ on:
- "v*"
env:
- GO_VERSION: 1.24.4
+ GO_VERSION: 1.25.0
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 253ba4054..afb001ace 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -73,7 +73,7 @@ jobs:
- uses: actions/setup-go@v5
with:
- go-version: '1.24.4'
+ go-version: '1.25.0'
- name: setup-kosli-cli
uses: kosli-dev/setup-cli-action@v2
@@ -83,7 +83,7 @@ jobs:
- name: Run golangci-lint
id: lint
- uses: golangci/golangci-lint-action@v6
+ uses: golangci/golangci-lint-action@v9
with:
version: latest
args: --timeout=5m -v
@@ -113,7 +113,7 @@ jobs:
- uses: actions/setup-go@v5
with:
- go-version: '1.24.4'
+ go-version: '1.25.0'
- name: setup-kosli-cli
uses: kosli-dev/setup-cli-action@v2
diff --git a/Dockerfile b/Dockerfile
index 6787e9fbf..fba865b94 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
-ARG GO_VERSION="1.24"
+ARG GO_VERSION="1.25"
ARG ALPINE_VERSION="3.21"
diff --git a/Makefile b/Makefile
index 9cac565b6..9733cd741 100644
--- a/Makefile
+++ b/Makefile
@@ -37,8 +37,11 @@ ldflags:
fmt: ## Reformat package sources
@go fmt ./...
-lint:
- @docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:latest-alpine golangci-lint run --timeout=5m -v ./...
+ensure_golangci-lint:
+ @$HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade golangci-lint
+
+lint: deps vet ensure_golangci-lint
+ @golangci-lint run --timeout=5m --color always -v ./...
vet: fmt
@go vet ./...
diff --git a/cmd/kosli/allowArtifact_test.go b/cmd/kosli/allowArtifact_test.go
index c60437845..5cbe65c25 100644
--- a/cmd/kosli/allowArtifact_test.go
+++ b/cmd/kosli/allowArtifact_test.go
@@ -29,7 +29,7 @@ func (suite *AllowArtifactCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
}
func (suite *AllowArtifactCommandTestSuite) TestAllowArtifactCmd() {
@@ -70,7 +70,7 @@ func (suite *AllowArtifactCommandTestSuite) TestAllowArtifactCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/archiveAttestationType_test.go b/cmd/kosli/archiveAttestationType_test.go
index d6a77e330..2f9fa08d9 100644
--- a/cmd/kosli/archiveAttestationType_test.go
+++ b/cmd/kosli/archiveAttestationType_test.go
@@ -25,7 +25,7 @@ func (suite *ArchiveAttestationTypeCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateCustomAttestationType(suite.attestationTypeName, "testdata/person-schema.json", []string{".age > 21"}, suite.Suite.T())
+ CreateCustomAttestationType(suite.attestationTypeName, "testdata/person-schema.json", []string{".age > 21"}, suite.T())
}
func (suite *ArchiveAttestationTypeCommandTestSuite) TestArchiveAttestationTypeCmd() {
@@ -55,7 +55,7 @@ func (suite *ArchiveAttestationTypeCommandTestSuite) TestArchiveAttestationTypeC
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/archiveEnvironment_test.go b/cmd/kosli/archiveEnvironment_test.go
index 9f2f7c9a6..570a8f4be 100644
--- a/cmd/kosli/archiveEnvironment_test.go
+++ b/cmd/kosli/archiveEnvironment_test.go
@@ -25,7 +25,7 @@ func (suite *ArchiveEnvironmentCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.environmentName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.environmentName, "server", suite.T())
}
func (suite *ArchiveEnvironmentCommandTestSuite) TestArchiveEnvironmentCmd() {
@@ -55,7 +55,7 @@ func (suite *ArchiveEnvironmentCommandTestSuite) TestArchiveEnvironmentCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/archiveFlow_test.go b/cmd/kosli/archiveFlow_test.go
index 90673d798..5fdc403f1 100644
--- a/cmd/kosli/archiveFlow_test.go
+++ b/cmd/kosli/archiveFlow_test.go
@@ -25,7 +25,7 @@ func (suite *ArchiveFlowCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
}
func (suite *ArchiveFlowCommandTestSuite) TestArchiveFlowCmd() {
@@ -55,7 +55,7 @@ func (suite *ArchiveFlowCommandTestSuite) TestArchiveFlowCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/assertApproval_test.go b/cmd/kosli/assertApproval_test.go
index 53053ccef..0835a7f79 100644
--- a/cmd/kosli/assertApproval_test.go
+++ b/cmd/kosli/assertApproval_test.go
@@ -36,14 +36,14 @@ func (suite *AssertApprovalCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifact(suite.flowName, suite.fingerprint, suite.artifactName, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifact(suite.flowName, suite.fingerprint, suite.artifactName, suite.T())
}
func (suite *AssertApprovalCommandTestSuite) TestAssertApprovalCmd() {
@@ -126,9 +126,9 @@ func (suite *AssertApprovalCommandTestSuite) TestAssertApprovalCmd() {
for _, t := range tests {
if t.additionalConfig != nil && t.additionalConfig.(assertApprovalTestConfig).createApproval {
- CreateApproval(suite.flowName, suite.fingerprint, t.additionalConfig.(assertApprovalTestConfig).isRequest, suite.Suite.T())
+ CreateApproval(suite.flowName, suite.fingerprint, t.additionalConfig.(assertApprovalTestConfig).isRequest, suite.T())
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{t})
+ runTestCmd(suite.T(), []cmdTestCase{t})
}
}
diff --git a/cmd/kosli/assertArtifact_test.go b/cmd/kosli/assertArtifact_test.go
index 74a890f5d..333821978 100644
--- a/cmd/kosli/assertArtifact_test.go
+++ b/cmd/kosli/assertArtifact_test.go
@@ -49,22 +49,22 @@ func (suite *AssertArtifactCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName1, suite.Suite.T())
- CreateFlow(suite.flowName2, suite.Suite.T())
+ CreateFlow(suite.flowName1, suite.T())
+ CreateFlow(suite.flowName2, suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
- CreatePolicy(global.Org, suite.policyName1, suite.Suite.T())
- CreatePolicy(global.Org, suite.policyName2, suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
+ CreatePolicy(global.Org, suite.policyName1, suite.T())
+ CreatePolicy(global.Org, suite.policyName2, suite.T())
var err error
suite.fingerprint1, err = GetSha256Digest(suite.artifact1Path, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifact(suite.flowName1, suite.fingerprint1, suite.artifactName1, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifact(suite.flowName1, suite.fingerprint1, suite.artifactName1, suite.T())
suite.fingerprint2, err = GetSha256Digest(suite.artifact2Path, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifact(suite.flowName1, suite.fingerprint2, suite.artifactName2, suite.Suite.T())
- CreateArtifact(suite.flowName2, suite.fingerprint2, suite.artifactName1, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifact(suite.flowName1, suite.fingerprint2, suite.artifactName2, suite.T())
+ CreateArtifact(suite.flowName2, suite.fingerprint2, suite.artifactName1, suite.T())
// Setup for asserting non-compliant artifact to check error response
suite.flowName3 = "assert-non-compliant-artifact"
@@ -72,12 +72,12 @@ func (suite *AssertArtifactCommandTestSuite) SetupTest() {
suite.artifactName3 = "arti-for-AssertArtifactCommandTestSuite-non-compliant"
suite.artifact3Path = "testdata/artifacts/AssertArtifactCommandTestSuiteArtifact3.txt"
suite.fingerprint3, err = GetSha256Digest(suite.artifact3Path, fingerprintOptions, logger)
- CreateFlow(suite.flowName3, suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName3, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName3, suite.trailName, "cli", suite.fingerprint3, suite.artifactName3, suite.Suite.T())
- require.NoError(suite.Suite.T(), err)
- CreateGenericArtifactAttestation(suite.flowName3, suite.trailName, suite.fingerprint3, "failing-attestation", false, suite.Suite.T())
- require.NoError(suite.Suite.T(), err)
+ CreateFlow(suite.flowName3, suite.T())
+ BeginTrail(suite.trailName, suite.flowName3, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName3, suite.trailName, "cli", suite.fingerprint3, suite.artifactName3, suite.T())
+ require.NoError(suite.T(), err)
+ CreateGenericArtifactAttestation(suite.flowName3, suite.trailName, suite.fingerprint3, "failing-attestation", false, suite.T())
+ require.NoError(suite.T(), err)
}
func (suite *AssertArtifactCommandTestSuite) TestAssertArtifactCmd() {
@@ -201,7 +201,7 @@ func (suite *AssertArtifactCommandTestSuite) TestAssertArtifactCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/assertPRAzure_test.go b/cmd/kosli/assertPRAzure_test.go
index 1ed7691b0..375552edf 100644
--- a/cmd/kosli/assertPRAzure_test.go
+++ b/cmd/kosli/assertPRAzure_test.go
@@ -17,7 +17,7 @@ type AssertPRAzureCommandTestSuite struct {
}
func (suite *AssertPRAzureCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_AZURE_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_AZURE_TOKEN"})
global = &GlobalOpts{
ApiToken: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNkNzg4OTg5In0.e8i_lA_QrEhFncb05Xw6E_tkCHU9QfcY4OLTVUCHffY",
@@ -51,7 +51,7 @@ func (suite *AssertPRAzureCommandTestSuite) TestAssertPRAzureCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/assertPRBitbucket_test.go b/cmd/kosli/assertPRBitbucket_test.go
index c4a2e3476..fcc0e044f 100644
--- a/cmd/kosli/assertPRBitbucket_test.go
+++ b/cmd/kosli/assertPRBitbucket_test.go
@@ -17,7 +17,7 @@ type AssertPRBitbucketCommandTestSuite struct {
}
func (suite *AssertPRBitbucketCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_BITBUCKET_ACCESS_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_BITBUCKET_ACCESS_TOKEN"})
global = &GlobalOpts{
ApiToken: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNkNzg4OTg5In0.e8i_lA_QrEhFncb05Xw6E_tkCHU9QfcY4OLTVUCHffY",
@@ -58,7 +58,7 @@ func (suite *AssertPRBitbucketCommandTestSuite) TestAssertPRBitbucketCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/assertPRGithub_test.go b/cmd/kosli/assertPRGithub_test.go
index 65cc63f10..ce2919c24 100644
--- a/cmd/kosli/assertPRGithub_test.go
+++ b/cmd/kosli/assertPRGithub_test.go
@@ -17,7 +17,7 @@ type AssertPRGithubCommandTestSuite struct {
}
func (suite *AssertPRGithubCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
global = &GlobalOpts{
ApiToken: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNkNzg4OTg5In0.e8i_lA_QrEhFncb05Xw6E_tkCHU9QfcY4OLTVUCHffY",
@@ -51,7 +51,7 @@ func (suite *AssertPRGithubCommandTestSuite) TestAssertPRGithubCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/assertPRGitlab_test.go b/cmd/kosli/assertPRGitlab_test.go
index 8d7ac876b..f25b23504 100644
--- a/cmd/kosli/assertPRGitlab_test.go
+++ b/cmd/kosli/assertPRGitlab_test.go
@@ -17,7 +17,7 @@ type AssertPRGitlabCommandTestSuite struct {
}
func (suite *AssertPRGitlabCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
global = &GlobalOpts{
ApiToken: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNkNzg4OTg5In0.e8i_lA_QrEhFncb05Xw6E_tkCHU9QfcY4OLTVUCHffY",
@@ -63,7 +63,7 @@ func (suite *AssertPRGitlabCommandTestSuite) TestAssertPRGitlabCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/assertSnapshot_test.go b/cmd/kosli/assertSnapshot_test.go
index 71c2cd471..8e1db7705 100644
--- a/cmd/kosli/assertSnapshot_test.go
+++ b/cmd/kosli/assertSnapshot_test.go
@@ -41,14 +41,14 @@ func (suite *AssertSnapshotCommandTestSuite) SetupTest() {
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
// Non-compliant environment
- CreateEnv(global.Org, suite.nonCompliantEnvName, "server", suite.Suite.T())
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateEnv(global.Org, suite.nonCompliantEnvName, "server", suite.T())
+ CreateFlow(suite.flowName, suite.T())
// In order for an environment to be compliant instead of unknown (which we convert to false), it must have
// a polict attached.
- CreateEnv(global.Org, suite.compliantEnvName, "server", suite.Suite.T())
- CreatePolicy(global.Org, "server-policy", suite.Suite.T())
- AttachPolicy([]string{suite.compliantEnvName}, "server-policy", suite.Suite.T())
+ CreateEnv(global.Org, suite.compliantEnvName, "server", suite.T())
+ CreatePolicy(global.Org, "server-policy", suite.T())
+ AttachPolicy([]string{suite.compliantEnvName}, "server-policy", suite.T())
//Create artifact to report to environments
fingerprintOptions := &fingerprintOptions{
@@ -56,8 +56,8 @@ func (suite *AssertSnapshotCommandTestSuite) SetupTest() {
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifact(suite.flowName, suite.fingerprint, suite.artifactName, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifact(suite.flowName, suite.fingerprint, suite.artifactName, suite.T())
}
@@ -117,9 +117,9 @@ func (suite *AssertSnapshotCommandTestSuite) TestAssertSnapshotCmd() {
for _, t := range tests {
if t.additionalConfig != nil && t.additionalConfig.(assertSnapshotTestConfig).reportToEnv {
- ReportServerArtifactToEnv([]string{suite.artifactPath}, t.additionalConfig.(assertSnapshotTestConfig).envName, suite.Suite.T())
+ ReportServerArtifactToEnv([]string{suite.artifactPath}, t.additionalConfig.(assertSnapshotTestConfig).envName, suite.T())
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{t})
+ runTestCmd(suite.T(), []cmdTestCase{t})
}
}
diff --git a/cmd/kosli/assertStatus_test.go b/cmd/kosli/assertStatus_test.go
index 48f60e65c..ac17ee2fc 100644
--- a/cmd/kosli/assertStatus_test.go
+++ b/cmd/kosli/assertStatus_test.go
@@ -28,7 +28,7 @@ func (suite *AssertStatusCommandTestSuite) TestAssertStatusCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestArtifact_test.go b/cmd/kosli/attestArtifact_test.go
index 8b59e7fd0..aea6c3080 100644
--- a/cmd/kosli/attestArtifact_test.go
+++ b/cmd/kosli/attestArtifact_test.go
@@ -26,8 +26,8 @@ func (suite *AttestArtifactCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root ../.. --host %s --org %s --api-token %s", suite.flowName, suite.trailName, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
}
func (suite *AttestArtifactCommandTestSuite) TestAttestArtifactCmd() {
@@ -96,7 +96,7 @@ func (suite *AttestArtifactCommandTestSuite) TestAttestArtifactCmd() {
wantError: true,
name: "fails when annotation is not valid",
cmd: fmt.Sprintf("attest artifact testdata/file1 --fingerprint 7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9 --name cli --commit HEAD --build-url http://www.example.com --commit-url http://www.example.com --annotate foo.baz=bar %s", suite.defaultKosliArguments),
- golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.baz'. Key can only contain [A-Za-z0-9_].\n",
+ golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.baz'. Key can only contain [A-Za-z0-9_]\n",
},
{
name: "can attest a file artifact with redacted commit info",
@@ -111,7 +111,7 @@ func (suite *AttestArtifactCommandTestSuite) TestAttestArtifactCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestCustom.go b/cmd/kosli/attestCustom.go
index cee1e1264..88876ae5e 100644
--- a/cmd/kosli/attestCustom.go
+++ b/cmd/kosli/attestCustom.go
@@ -170,7 +170,11 @@ func (o *attestCustomOptions) run(args []string) error {
}
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file: %v", err)
+ }
+ }()
}
reqParams := &requests.RequestParams{
diff --git a/cmd/kosli/attestCustom_test.go b/cmd/kosli/attestCustom_test.go
index 3d385a2d6..7982c9f69 100644
--- a/cmd/kosli/attestCustom_test.go
+++ b/cmd/kosli/attestCustom_test.go
@@ -37,9 +37,9 @@ func (suite *AttestCustomCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --type %s --attestation-data %s --flow %s --trail %s --repo-root ../.. --host %s --org %s --api-token %s", suite.typeName, suite.attestationDataFile, suite.flowName, suite.trailName, global.Host, global.Org, global.ApiToken)
- CreateCustomAttestationType(suite.typeName, suite.schemaFilePath, suite.jqRules, suite.Suite.T())
- CreateFlow(suite.flowName, suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateCustomAttestationType(suite.typeName, suite.schemaFilePath, suite.jqRules, suite.T())
+ CreateFlow(suite.flowName, suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestCustomCommandTestSuite) TestAttestCustomCmd() {
@@ -156,11 +156,11 @@ func (suite *AttestCustomCommandTestSuite) TestAttestCustomCmd() {
wantError: true,
name: "fails when annotation is not valid",
cmd: fmt.Sprintf("attest custom --name bar --annotate foo.baz=bar %s", suite.defaultKosliArguments),
- golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.baz'. Key can only contain [A-Za-z0-9_].\n",
+ golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.baz'. Key can only contain [A-Za-z0-9_]\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestGeneric.go b/cmd/kosli/attestGeneric.go
index 169c7ec64..9e7bf6518 100644
--- a/cmd/kosli/attestGeneric.go
+++ b/cmd/kosli/attestGeneric.go
@@ -158,7 +158,11 @@ func (o *attestGenericOptions) run(args []string) error {
}
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file: %v", err)
+ }
+ }()
}
reqParams := &requests.RequestParams{
diff --git a/cmd/kosli/attestGeneric_test.go b/cmd/kosli/attestGeneric_test.go
index 19229a6c6..5300b2033 100644
--- a/cmd/kosli/attestGeneric_test.go
+++ b/cmd/kosli/attestGeneric_test.go
@@ -28,9 +28,9 @@ func (suite *AttestGenericCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root ../.. --host %s --org %s --api-token %s", suite.flowName, suite.trailName, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestGenericCommandTestSuite) TestAttestGenericCmd() {
@@ -171,11 +171,11 @@ func (suite *AttestGenericCommandTestSuite) TestAttestGenericCmd() {
wantError: true,
name: "fails when annotation is not valid",
cmd: fmt.Sprintf("attest generic --name bar --annotate foo.baz=bar %s", suite.defaultKosliArguments),
- golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.baz'. Key can only contain [A-Za-z0-9_].\n",
+ golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.baz'. Key can only contain [A-Za-z0-9_]\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestJira.go b/cmd/kosli/attestJira.go
index 242d7dec4..7a206545e 100644
--- a/cmd/kosli/attestJira.go
+++ b/cmd/kosli/attestJira.go
@@ -303,7 +303,11 @@ func (o *attestJiraOptions) run(args []string) error {
}
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file: %v", err)
+ }
+ }()
}
reqParams := &requests.RequestParams{
@@ -353,7 +357,7 @@ func (o *attestJiraOptions) validateJiraProjectKeys() error {
}
}
if len(invalidKeys) > 0 {
- return fmt.Errorf("Invalid Jira project keys: %s", strings.Join(invalidKeys, ", "))
+ return fmt.Errorf("invalid Jira project keys: %v", invalidKeys)
}
return nil
}
diff --git a/cmd/kosli/attestJira_test.go b/cmd/kosli/attestJira_test.go
index 2409b9e70..49af3cd32 100644
--- a/cmd/kosli/attestJira_test.go
+++ b/cmd/kosli/attestJira_test.go
@@ -27,7 +27,7 @@ type AttestJiraCommandTestSuite struct {
}
func (suite *AttestJiraCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_JIRA_API_TOKEN", "KOSLI_JIRA_USERNAME"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_JIRA_API_TOKEN", "KOSLI_JIRA_USERNAME"})
suite.flowName = "attest-jira"
suite.trailName = "test-123"
suite.artifactFingerprint = "7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9"
@@ -40,17 +40,18 @@ func (suite *AttestJiraCommandTestSuite) SetupTest() {
var err error
suite.tmpDir, err = os.MkdirTemp("", "testDir")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
_, suite.workTree, suite.fs, err = testHelpers.InitializeGitRepo(suite.tmpDir)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestJiraCommandTestSuite) TearDownSuite() {
- os.RemoveAll(suite.tmpDir)
+ err := os.RemoveAll(suite.tmpDir)
+ require.NoError(suite.T(), err, "failed to remove temp dir %s", suite.tmpDir)
}
func (suite *AttestJiraCommandTestSuite) TestAttestJiraCmd() {
@@ -261,7 +262,7 @@ func (suite *AttestJiraCommandTestSuite) TestAttestJiraCmd() {
--jira-project-key 1AB
--jira-project-key AB-44
--repo-root %s %s`, suite.tmpDir, suite.defaultKosliArguments),
- golden: "Error: Invalid Jira project keys: 1AB, AB-44\n",
+ golden: "Error: invalid Jira project keys: [1AB AB-44]\n",
additionalConfig: jiraTestsAdditionalConfig{
commitMessage: "EX-1 test commit",
},
@@ -331,17 +332,17 @@ func execJiraTestCase(test cmdTestCase, suite *AttestJiraCommandTestSuite) {
branchName := test.additionalConfig.(jiraTestsAdditionalConfig).branchName
if branchName != "" {
err := testHelpers.CheckoutNewBranch(suite.workTree, branchName)
- require.NoError(suite.Suite.T(), err)
- defer testHelpers.CheckoutMaster(suite.workTree, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ defer testHelpers.CheckoutMaster(suite.workTree, suite.T())
}
msg := test.additionalConfig.(jiraTestsAdditionalConfig).commitMessage
commitSha, err := testHelpers.CommitToRepo(suite.workTree, suite.fs, msg)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
test.cmd = test.cmd + " --commit " + commitSha
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{test})
+ runTestCmd(suite.T(), []cmdTestCase{test})
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestJunit.go b/cmd/kosli/attestJunit.go
index 624024e0d..560a42867 100644
--- a/cmd/kosli/attestJunit.go
+++ b/cmd/kosli/attestJunit.go
@@ -172,7 +172,11 @@ func (o *attestJunitOptions) run(args []string) error {
}
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
reqParams := &requests.RequestParams{
diff --git a/cmd/kosli/attestJunit_test.go b/cmd/kosli/attestJunit_test.go
index 264ae8b82..cae491473 100644
--- a/cmd/kosli/attestJunit_test.go
+++ b/cmd/kosli/attestJunit_test.go
@@ -28,9 +28,9 @@ func (suite *AttestJunitCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root ../.. --host %s --org %s --api-token %s", suite.flowName, suite.trailName, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestJunitCommandTestSuite) TestAttestJunitCmd() {
@@ -120,11 +120,11 @@ func (suite *AttestJunitCommandTestSuite) TestAttestJunitCmd() {
name: "fails when annotation is not valid",
cmd: fmt.Sprintf(`attest junit --name bar --commit HEAD --origin-url http://example.com --results-dir testdata
--annotate foo.bar=bar %s`, suite.defaultKosliArguments),
- golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.bar'. Key can only contain [A-Za-z0-9_].\n",
+ golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.bar'. Key can only contain [A-Za-z0-9_]\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestPRAzure_test.go b/cmd/kosli/attestPRAzure_test.go
index e809f5708..77ac4e431 100644
--- a/cmd/kosli/attestPRAzure_test.go
+++ b/cmd/kosli/attestPRAzure_test.go
@@ -20,7 +20,7 @@ type AttestAzurePRCommandTestSuite struct {
}
func (suite *AttestAzurePRCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_AZURE_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_AZURE_TOKEN"})
suite.flowName = "attest-azure-pr"
suite.trailName = "test-123"
@@ -31,9 +31,9 @@ func (suite *AttestAzurePRCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root ../.. --host %s --org %s --api-token %s", suite.flowName, suite.trailName, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestAzurePRCommandTestSuite) TestAttestAzurePRCmd() {
@@ -121,7 +121,7 @@ func (suite *AttestAzurePRCommandTestSuite) TestAttestAzurePRCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestPRBitbucket_test.go b/cmd/kosli/attestPRBitbucket_test.go
index 18197f062..f891fac22 100644
--- a/cmd/kosli/attestPRBitbucket_test.go
+++ b/cmd/kosli/attestPRBitbucket_test.go
@@ -25,7 +25,7 @@ type AttestBitbucketPRCommandTestSuite struct {
}
func (suite *AttestBitbucketPRCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_BITBUCKET_ACCESS_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_BITBUCKET_ACCESS_TOKEN"})
suite.flowName = "attest-bitbucket-pr"
suite.trailName = "test-123"
@@ -38,20 +38,22 @@ func (suite *AttestBitbucketPRCommandTestSuite) SetupTest() {
var err error
suite.tmpDir, err = os.MkdirTemp("", "testDir")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
_, err = testHelpers.CloneGitRepo("https://bitbucket.org/kosli-dev/cli-test.git", suite.tmpDir)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
suite.commitWithPR = "fd54040fc90e7e83f7b152619bfa18917b72c34f"
suite.commitWithNoPR = "1b5e2899c6af3aa64827359b7ced679d315dd2a9"
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root %s --host %s --org %s --api-token %s", suite.flowName, suite.trailName, suite.tmpDir, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestBitbucketPRCommandTestSuite) TearDownSuite() {
- os.RemoveAll(suite.tmpDir)
+ if err := os.RemoveAll(suite.tmpDir); err != nil {
+ require.NoError(suite.T(), err, "failed to remove temp dir %s", suite.tmpDir)
+ }
}
func (suite *AttestBitbucketPRCommandTestSuite) TestAttestBitbucketPRCmd() {
@@ -158,7 +160,7 @@ func (suite *AttestBitbucketPRCommandTestSuite) TestAttestBitbucketPRCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestPRGithub_test.go b/cmd/kosli/attestPRGithub_test.go
index b881a2de7..220c8d534 100644
--- a/cmd/kosli/attestPRGithub_test.go
+++ b/cmd/kosli/attestPRGithub_test.go
@@ -22,7 +22,7 @@ type AttestGithubPRCommandTestSuite struct {
}
func (suite *AttestGithubPRCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
suite.flowName = "attest-github-pr"
suite.trailName = "test-123"
@@ -35,9 +35,9 @@ func (suite *AttestGithubPRCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root ../.. --host %s --org %s --api-token %s", suite.flowName, suite.trailName, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestGithubPRCommandTestSuite) TestAttestGithubPRCmd() {
@@ -151,7 +151,7 @@ func (suite *AttestGithubPRCommandTestSuite) TestAttestGithubPRCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestPRGitlab_test.go b/cmd/kosli/attestPRGitlab_test.go
index 2979c98a7..01f03e7e2 100644
--- a/cmd/kosli/attestPRGitlab_test.go
+++ b/cmd/kosli/attestPRGitlab_test.go
@@ -25,7 +25,7 @@ type AttestGitlabPRCommandTestSuite struct {
}
func (suite *AttestGitlabPRCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
suite.flowName = "attest-gitlab-pr"
suite.trailName = "test-123"
@@ -40,18 +40,20 @@ func (suite *AttestGitlabPRCommandTestSuite) SetupTest() {
var err error
suite.tmpDir, err = os.MkdirTemp("", "testDir")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
_, err = testHelpers.CloneGitRepo("https://gitlab.com/kosli-dev/merkely-gitlab-demo.git", suite.tmpDir)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root %s --host %s --org %s --api-token %s", suite.flowName, suite.trailName, suite.tmpDir, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestGitlabPRCommandTestSuite) TearDownSuite() {
- os.RemoveAll(suite.tmpDir)
+ if err := os.RemoveAll(suite.tmpDir); err != nil {
+ require.NoError(suite.T(), err, "failed to remove temp dir %s", suite.tmpDir)
+ }
}
func (suite *AttestGitlabPRCommandTestSuite) TestAttestGitlabPRCmd() {
@@ -151,7 +153,7 @@ func (suite *AttestGitlabPRCommandTestSuite) TestAttestGitlabPRCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestSnyk.go b/cmd/kosli/attestSnyk.go
index 5843b351c..a68def19a 100644
--- a/cmd/kosli/attestSnyk.go
+++ b/cmd/kosli/attestSnyk.go
@@ -184,7 +184,11 @@ func (o *attestSnykOptions) run(args []string) error {
}
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
reqParams := &requests.RequestParams{
diff --git a/cmd/kosli/attestSnyk_test.go b/cmd/kosli/attestSnyk_test.go
index 3d77c2ca3..c20f7651b 100644
--- a/cmd/kosli/attestSnyk_test.go
+++ b/cmd/kosli/attestSnyk_test.go
@@ -28,9 +28,9 @@ func (suite *AttestSnykCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root ../.. --host %s --org %s --api-token %s", suite.flowName, suite.trailName, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestSnykCommandTestSuite) TestAttestSnykCmd() {
@@ -122,11 +122,11 @@ func (suite *AttestSnykCommandTestSuite) TestAttestSnykCmd() {
cmd: fmt.Sprintf(`attest snyk --name bar --commit HEAD --origin-url https://example.com
--annotate foo.baz=bar
--scan-results testdata/snyk_sarif.json %s`, suite.defaultKosliArguments),
- golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.baz'. Key can only contain [A-Za-z0-9_].\n",
+ golden: "Error: --annotate flag should be in the format key=value. Invalid key: 'foo.baz'. Key can only contain [A-Za-z0-9_]\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestSonar.go b/cmd/kosli/attestSonar.go
index 806a9c100..76b96ad3f 100644
--- a/cmd/kosli/attestSonar.go
+++ b/cmd/kosli/attestSonar.go
@@ -195,7 +195,11 @@ func (o *attestSonarOptions) run(args []string) error {
}
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
reqParams := &requests.RequestParams{
diff --git a/cmd/kosli/attestSonar_test.go b/cmd/kosli/attestSonar_test.go
index 39b59cda1..8b467768c 100644
--- a/cmd/kosli/attestSonar_test.go
+++ b/cmd/kosli/attestSonar_test.go
@@ -44,9 +44,9 @@ type AttestSonarQubeCommandTestSuite struct {
}
func (suite *AttestSonarCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_SONAR_API_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_SONAR_API_TOKEN"})
// If we have SONARQUBE set (e.g. to true), we're testing SonarQube Server and therefore should skip the SonarQube Cloud tests
- testHelpers.SkipIfEnvVarSet(suite.Suite.T(), []string{"SONARQUBE"})
+ testHelpers.SkipIfEnvVarSet(suite.T(), []string{"SONARQUBE"})
suite.flowName = "attest-sonar"
suite.trailName = "test-123"
suite.artifactFingerprint = "7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9"
@@ -56,13 +56,13 @@ func (suite *AttestSonarCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root ../.. --host %s --org %s --api-token %s", suite.flowName, suite.trailName, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestSonarQubeCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_SONAR_API_TOKEN", "SONARQUBE"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_SONAR_API_TOKEN", "SONARQUBE"})
suite.flowName = "attest-sonar"
suite.trailName = "test-123"
suite.artifactFingerprint = "7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9"
@@ -72,9 +72,9 @@ func (suite *AttestSonarQubeCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --trail %s --repo-root ../.. --host %s --org %s --api-token %s", suite.flowName, suite.trailName, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.artifactFingerprint, "file1", suite.T())
}
func (suite *AttestSonarCommandTestSuite) TestAttestSonarCmd() {
@@ -159,7 +159,7 @@ func (suite *AttestSonarCommandTestSuite) TestAttestSonarCmd() {
wantError: true,
name: "if outdated task given (i.e. we try to get results for an older scan that SonarCloud has deleted), we get an error",
cmd: fmt.Sprintf("attest sonar --name cli.foo --commit HEAD --origin-url http://www.example.com --sonar-working-dir testdata/sonar/sonarcloud/.scannerwork-old %s", suite.defaultKosliArguments),
- golden: "Error: No activity found for task 'AZERk4uWpzGpahwkB9ac' on https://sonarcloud.io. \nSonarQube may be experiencing problems, please check https://status.sonarqube.com/ and try again later. \nOtherwise if you are attesting an older scan, the snapshot may have been deleted by SonarQube.\n",
+ golden: "Error: No activity found for task 'AZERk4uWpzGpahwkB9ac' on https://sonarcloud.io. \nSonarQube may be experiencing problems, please check https://status.sonarqube.com/ and try again later. \nOtherwise if you are attesting an older scan, the snapshot may have been deleted by SonarQube\n",
},
{
wantError: true,
@@ -175,7 +175,7 @@ func (suite *AttestSonarCommandTestSuite) TestAttestSonarCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
func (suite *AttestSonarQubeCommandTestSuite) TestAttestSonarQubeCmd() {
@@ -276,7 +276,7 @@ func (suite *AttestSonarQubeCommandTestSuite) TestAttestSonarQubeCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/attestation.go b/cmd/kosli/attestation.go
index 50739a821..2ea8ebdb6 100644
--- a/cmd/kosli/attestation.go
+++ b/cmd/kosli/attestation.go
@@ -105,7 +105,7 @@ func (o *CommonAttestationOptions) run(args []string, payload *CommonAttestation
func processAnnotations(annotations map[string]string) (map[string]string, error) {
for label := range annotations {
if !regexp.MustCompile(`^[A-Za-z0-9_]+$`).MatchString(label) {
- return nil, fmt.Errorf("--annotate flag should be in the format key=value. Invalid key: '%s'. Key can only contain [A-Za-z0-9_].", label)
+ return nil, fmt.Errorf("--annotate flag should be in the format key=value. Invalid key: '%s'. Key can only contain [A-Za-z0-9_]", label)
}
}
return annotations, nil
diff --git a/cmd/kosli/beginTrail_test.go b/cmd/kosli/beginTrail_test.go
index e431ec656..768061c0e 100644
--- a/cmd/kosli/beginTrail_test.go
+++ b/cmd/kosli/beginTrail_test.go
@@ -24,7 +24,7 @@ func (suite *BeginTrailCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
}
func (suite *BeginTrailCommandTestSuite) TestBeginTrailCmd() {
@@ -93,7 +93,7 @@ func (suite *BeginTrailCommandTestSuite) TestBeginTrailCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/cli_utils.go b/cmd/kosli/cli_utils.go
index 8a506fa9f..f859f86ee 100644
--- a/cmd/kosli/cli_utils.go
+++ b/cmd/kosli/cli_utils.go
@@ -316,7 +316,7 @@ func GetSha256Digest(artifactName string, o *fingerprintOptions, logger *log.Log
var fingerprint string
switch o.artifactType {
case "file":
- fingerprint, err = digest.FileSha256(artifactName)
+ fingerprint, err = digest.FileSha256(artifactName, logger)
case "dir":
fingerprint, err = digest.DirSha256(artifactName, o.excludePaths, logger)
case "oci":
@@ -453,12 +453,18 @@ func tabFormattedPrint(out io.Writer, header []string, rows []string) {
// Format in tab-separated columns with a tab stop of 8.
w.Init(out, 5, 12, 2, ' ', 0)
if len(header) > 0 {
- fmt.Fprintln(w, strings.Join(header, "\t"))
+ if _, err := fmt.Fprintln(w, strings.Join(header, "\t")); err != nil {
+ logger.Warn("failed to write table header: %v", err)
+ }
}
for _, row := range rows {
- fmt.Fprintln(w, row)
+ if _, err := fmt.Fprintln(w, row); err != nil {
+ logger.Warn("failed to write table row: %v", err)
+ }
+ }
+ if err := w.Flush(); err != nil {
+ logger.Warn("failed to flush table output: %v", err)
}
- w.Flush()
}
// formattedTimestamp formats a float timestamp into something like "Mon, 22 Aug 2022 11:34:59 CEST • 10 days ago"
@@ -563,7 +569,11 @@ func getPathOfEvidenceFileToUpload(evidencePaths []string) (string, bool, error)
}
}
dirToTar = tmpDir
- defer os.RemoveAll(tmpDir)
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ logger.Warn("failed to remove temporary directory %s: %v", tmpDir, err)
+ }
+ }()
}
// tar the required dir and return the path of the tar file
diff --git a/cmd/kosli/cli_utils_test.go b/cmd/kosli/cli_utils_test.go
index 63572b412..edb7ff145 100644
--- a/cmd/kosli/cli_utils_test.go
+++ b/cmd/kosli/cli_utils_test.go
@@ -49,12 +49,12 @@ func (suite *CliUtilsTestSuite) TestWhichCI() {
want: unknown,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
suite.setEnvVars(t.envVars)
actual := WhichCI()
// clean up
suite.unsetEnvVars(t.envVars)
- assert.Equal(suite.Suite.T(), t.want, actual, fmt.Sprintf("TestWhichCI: %s , got: %v -- want: %v", t.name, actual, t.want))
+ assert.Equal(suite.T(), t.want, actual, fmt.Sprintf("TestWhichCI: %s , got: %v -- want: %v", t.name, actual, t.want))
})
}
}
@@ -220,11 +220,11 @@ func (suite *CliUtilsTestSuite) TestDefaultValue() {
want: "https://bitbucket.org/example/foo/commits/8eb22db889202e4e23892665dbcc691217f500f8",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
value, testMode := os.LookupEnv("KOSLI_TESTS")
if t.args.unsetTestsEnvVar && testMode {
err := os.Unsetenv("KOSLI_TESTS")
- require.NoError(suite.Suite.T(), err, "should have unset KOSLI_TESTS env var without error")
+ require.NoError(suite.T(), err, "should have unset KOSLI_TESTS env var without error")
}
suite.setEnvVars(t.args.envVars)
actual := DefaultValue(t.args.ci, t.args.flag)
@@ -232,9 +232,11 @@ func (suite *CliUtilsTestSuite) TestDefaultValue() {
suite.unsetEnvVars(t.args.envVars)
// recover KOSLI_TESTS env variable to its original state before the test
if testMode {
- os.Setenv("KOSLI_TESTS", value)
+ if err := os.Setenv("KOSLI_TESTS", value); err != nil {
+ suite.T().Logf("failed to set KOSLI_TESTS env var: %v", err)
+ }
}
- assert.Equal(suite.Suite.T(), t.want, actual, fmt.Sprintf("TestDefaultValue: %s , got: %v -- want: %v", t.name, actual, t.want))
+ assert.Equal(suite.T(), t.want, actual, fmt.Sprintf("TestDefaultValue: %s , got: %v -- want: %v", t.name, actual, t.want))
})
}
}
@@ -271,12 +273,12 @@ func (suite *CliUtilsTestSuite) TestRequireGlobalFlags() {
expectError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
err := RequireGlobalFlags(t.args.global, t.args.fields)
if t.expectError {
- require.Errorf(suite.Suite.T(), err, "TestRequireGlobalFlags: error was expected but got none.")
+ require.Errorf(suite.T(), err, "TestRequireGlobalFlags: error was expected but got none.")
} else {
- require.NoErrorf(suite.Suite.T(), err, "TestRequireGlobalFlags: got an error but was not expecting one: %v", err)
+ require.NoErrorf(suite.T(), err, "TestRequireGlobalFlags: got an error but was not expecting one: %v", err)
}
})
}
@@ -304,16 +306,16 @@ func (suite *CliUtilsTestSuite) TestGetFlagFromVarName() {
want: "--a",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
actual := GetFlagFromVarName(t.input)
- assert.Equal(suite.Suite.T(), t.want, actual, fmt.Sprintf("TestGetFlagFromVarName: %s , got: %v -- want: %v", t.name, actual, t.want))
+ assert.Equal(suite.T(), t.want, actual, fmt.Sprintf("TestGetFlagFromVarName: %s , got: %v -- want: %v", t.name, actual, t.want))
})
}
}
func (suite *CliUtilsTestSuite) TestGetCIDefaultsTemplates() {
text := GetCIDefaultsTemplates(supportedCIs, []string{"git-commit"})
- require.NotEmpty(suite.Suite.T(), text, "TestGetCIDefaultsTemplates: returned string should not be empty")
+ require.NotEmpty(suite.T(), text, "TestGetCIDefaultsTemplates: returned string should not be empty")
}
func (suite *CliUtilsTestSuite) TestGetSha256Digest() {
@@ -394,14 +396,14 @@ func (suite *CliUtilsTestSuite) TestGetSha256Digest() {
expectError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
fingerprint, err := GetSha256Digest(t.args.artifactName, t.args.fingerprintOptions,
log.NewStandardLogger())
if t.expectError {
- require.Errorf(suite.Suite.T(), err, "TestGetSha256Digest: error was expected but got none.")
+ require.Errorf(suite.T(), err, "TestGetSha256Digest: error was expected but got none.")
} else {
- require.NoErrorf(suite.Suite.T(), err, "TestGetSha256Digest: got an error but was not expecting one: %v", err)
- assert.Equal(suite.Suite.T(), t.want, fingerprint, fmt.Sprintf("TestGetSha256Digest: %s , got: %v -- want: %v", t.name, fingerprint, t.want))
+ require.NoErrorf(suite.T(), err, "TestGetSha256Digest: got an error but was not expecting one: %v", err)
+ assert.Equal(suite.T(), t.want, fingerprint, fmt.Sprintf("TestGetSha256Digest: %s , got: %v -- want: %v", t.name, fingerprint, t.want))
}
})
}
@@ -455,24 +457,28 @@ func (suite *CliUtilsTestSuite) TestLoadUserData() {
expectError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
tmpDir, err := os.MkdirTemp("", "testDir")
- require.NoError(suite.Suite.T(), err, "error creating a temporary test directory")
- defer os.RemoveAll(tmpDir)
+ require.NoError(suite.T(), err, "error creating a temporary test directory")
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ require.NoError(suite.T(), err, "failed to remove temp dir %s", tmpDir)
+ }
+ }()
if t.args.create {
testFile, err := os.Create(filepath.Join(tmpDir, t.args.filename))
- require.NoErrorf(suite.Suite.T(), err, "error creating test file %s", t.args.filename)
+ require.NoErrorf(suite.T(), err, "error creating test file %s", t.args.filename)
_, err = testFile.Write([]byte(t.args.content))
- require.NoErrorf(suite.Suite.T(), err, "error writing content to test file %s", t.args.filename)
+ require.NoErrorf(suite.T(), err, "error writing content to test file %s", t.args.filename)
}
_, err = LoadJsonData(filepath.Join(tmpDir, t.args.filename))
if t.expectError {
- require.Errorf(suite.Suite.T(), err, "TestLoadUserData: error was expected but got none.")
+ require.Errorf(suite.T(), err, "TestLoadUserData: error was expected but got none.")
} else {
- require.NoErrorf(suite.Suite.T(), err, "TestLoadUserData: got an error but was not expecting one: %v", err)
+ require.NoErrorf(suite.T(), err, "TestLoadUserData: got an error but was not expecting one: %v", err)
}
})
}
@@ -550,12 +556,12 @@ func (suite *CliUtilsTestSuite) TestValidateArtifactArg() {
alwaysRequireArtifactName: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
err := ValidateArtifactArg(t.args, t.artifactType, t.inputSha256, t.alwaysRequireArtifactName)
if t.expectError {
- require.Errorf(suite.Suite.T(), err, "error was expected but got none")
+ require.Errorf(suite.T(), err, "error was expected but got none")
} else {
- require.NoErrorf(suite.Suite.T(), err, "error was NOT expected but got %v", err)
+ require.NoErrorf(suite.T(), err, "error was NOT expected but got %v", err)
}
})
}
@@ -601,12 +607,12 @@ func (suite *CliUtilsTestSuite) TestValidateRegistryFlags() {
expectError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
err := ValidateRegistryFlags(&cobra.Command{}, t.options)
if t.expectError {
- require.Errorf(suite.Suite.T(), err, "error was expected but got none")
+ require.Errorf(suite.T(), err, "error was expected but got none")
} else {
- require.NoErrorf(suite.Suite.T(), err, "error was NOT expected but got %v", err)
+ require.NoErrorf(suite.T(), err, "error was NOT expected but got %v", err)
}
})
}
@@ -616,7 +622,7 @@ func (suite *CliUtilsTestSuite) TestValidateRegistryFlags() {
func (suite *CliUtilsTestSuite) setEnvVars(envVars map[string]string) {
for key, value := range envVars {
err := os.Setenv(key, value)
- require.NoErrorf(suite.Suite.T(), err, "error setting env variable %s", key)
+ require.NoErrorf(suite.T(), err, "error setting env variable %s", key)
}
}
@@ -624,7 +630,7 @@ func (suite *CliUtilsTestSuite) setEnvVars(envVars map[string]string) {
func (suite *CliUtilsTestSuite) unsetEnvVars(envVars map[string]string) {
for key := range envVars {
err := os.Unsetenv(key)
- require.NoErrorf(suite.Suite.T(), err, "error unsetting env variable %s", key)
+ require.NoErrorf(suite.T(), err, "error unsetting env variable %s", key)
}
}
@@ -680,7 +686,7 @@ func (suite *CliUtilsTestSuite) TestMuXRequiredFlags() {
},
}
for _, t := range tests {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
cmd := &cobra.Command{}
var var1, var2, var3 string
cmd.Flags().StringVar(&var1, "flag1", "", "")
@@ -692,9 +698,9 @@ func (suite *CliUtilsTestSuite) TestMuXRequiredFlags() {
}
err := MuXRequiredFlags(cmd, t.flagNames, t.atLeastOne)
if t.wantErr {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
})
}
@@ -726,7 +732,7 @@ func (suite *CliUtilsTestSuite) TestConditionallyRequiredFlags() {
},
}
for _, t := range tests {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
cmd := &cobra.Command{}
var var1, var2 string
cmd.Flags().StringVar(&var1, "required", "", "")
@@ -737,9 +743,9 @@ func (suite *CliUtilsTestSuite) TestConditionallyRequiredFlags() {
}
err := ConditionallyRequiredFlags(cmd, "required", "condition")
if t.wantErr {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
})
}
@@ -791,12 +797,18 @@ func (suite *CliUtilsTestSuite) TestFormattedTimestamp() {
},
}
for _, t := range tests {
- suite.Suite.Run(t.name, func() {
- os.Setenv("KOSLI_TESTS_FORMATTED_TIMESTAMP", "True")
- defer os.Unsetenv("KOSLI_TESTS_FORMATTED_TIMESTAMP")
+ suite.Run(t.name, func() {
+ if err := os.Setenv("KOSLI_TESTS_FORMATTED_TIMESTAMP", "True"); err != nil {
+ suite.T().Logf("failed to set env var: %v", err)
+ }
+ defer func() {
+ if err := os.Unsetenv("KOSLI_TESTS_FORMATTED_TIMESTAMP"); err != nil {
+ suite.T().Logf("failed to unset env var: %v", err)
+ }
+ }()
ts, err := formattedTimestamp(t.timestamp, t.short)
- require.True(suite.Suite.T(), t.wantErr == (err != nil))
- require.Equal(suite.Suite.T(), t.expected, ts)
+ require.True(suite.T(), t.wantErr == (err != nil))
+ require.Equal(suite.T(), t.expected, ts)
})
}
}
@@ -871,11 +883,11 @@ func (suite *CliUtilsTestSuite) TestHandleExpressions() {
},
}
for _, t := range tests {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
name, id, err := handleExpressions(t.expression)
- require.True(suite.Suite.T(), err != nil == t.wantErr)
- require.Equal(suite.Suite.T(), t.wantName, name)
- require.Equal(suite.Suite.T(), t.wantId, id)
+ require.True(suite.T(), err != nil == t.wantErr)
+ require.Equal(suite.T(), t.wantName, name)
+ require.Equal(suite.T(), t.wantId, id)
})
}
}
@@ -941,11 +953,11 @@ func (suite *CliUtilsTestSuite) TestHandleSnapshotExpressions() {
},
}
for _, t := range tests {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
name, id, err := handleSnapshotExpressions(t.expression)
- require.True(suite.Suite.T(), err != nil == t.wantErr)
- require.Equal(suite.Suite.T(), t.wantName, name)
- require.Equal(suite.Suite.T(), t.wantFragment, id)
+ require.True(suite.T(), err != nil == t.wantErr)
+ require.Equal(suite.T(), t.wantName, name)
+ require.Equal(suite.T(), t.wantFragment, id)
})
}
}
@@ -1009,12 +1021,12 @@ func (suite *CliUtilsTestSuite) TestHandleArtifactExpression() {
},
}
for _, t := range tests {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
name, id, sep, err := handleArtifactExpression(t.expression)
- require.True(suite.Suite.T(), err != nil == t.wantErr)
- require.Equal(suite.Suite.T(), t.wantName, name)
- require.Equal(suite.Suite.T(), t.wantId, id)
- require.Equal(suite.Suite.T(), t.wantSep, sep)
+ require.True(suite.T(), err != nil == t.wantErr)
+ require.Equal(suite.T(), t.wantName, name)
+ require.Equal(suite.T(), t.wantId, id)
+ require.Equal(suite.T(), t.wantSep, sep)
})
}
}
diff --git a/cmd/kosli/config.go b/cmd/kosli/config.go
index 411423932..8d64250fb 100644
--- a/cmd/kosli/config.go
+++ b/cmd/kosli/config.go
@@ -88,7 +88,11 @@ func (o *configOptions) run() error {
if err != nil {
return fmt.Errorf("setting default config failed. Error creating file: %s", err)
}
- defer file.Close()
+ defer func() {
+ if err := file.Close(); err != nil {
+ logger.Warn("failed to close config file %s: %v", path, err)
+ }
+ }()
if err := file.Chmod(permissions); err != nil {
return fmt.Errorf("setting default config failed. Error setting file permissions: %s", err)
diff --git a/cmd/kosli/config_test.go b/cmd/kosli/config_test.go
index bcc486391..2cfeb1824 100644
--- a/cmd/kosli/config_test.go
+++ b/cmd/kosli/config_test.go
@@ -19,7 +19,7 @@ type MockConfigGetter struct {
// defaultConfigFilePath is a method that satisfies the ConfigGetter interface
func (m *MockConfigGetter) defaultConfigFilePath() string {
- args := m.Mock.Called()
+ args := m.Called()
return args.String(0)
}
@@ -33,13 +33,13 @@ type ConfigCommandTestSuite struct {
func (suite *ConfigCommandTestSuite) SetupTest() {
dir, err := os.MkdirTemp("", "tmp-config-file")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
suite.tmpConfigFilePath = filepath.Join(dir, defaultConfigFilename)
}
func (suite *ConfigCommandTestSuite) TearDownTest() {
err := os.RemoveAll(suite.tmpConfigFilePath)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
defaultConfigFilePathFunc = (&RealConfigGetter{}).defaultConfigFilePath
global = new(GlobalOpts)
}
@@ -94,7 +94,7 @@ func (suite *ConfigCommandTestSuite) TestConfigCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/createAttestationType_test.go b/cmd/kosli/createAttestationType_test.go
index 384308329..3f962372b 100644
--- a/cmd/kosli/createAttestationType_test.go
+++ b/cmd/kosli/createAttestationType_test.go
@@ -59,7 +59,7 @@ func (suite *CreateAttestationTypeTestSuite) TestCustomAttestationTypeCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/createEnvironment_test.go b/cmd/kosli/createEnvironment_test.go
index 59898f7bc..0d822607d 100644
--- a/cmd/kosli/createEnvironment_test.go
+++ b/cmd/kosli/createEnvironment_test.go
@@ -116,7 +116,7 @@ func (suite *CreateEnvironmentCommandTestSuite) TestCreateEnvironmentCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/createFlow.go b/cmd/kosli/createFlow.go
index 3affe8ede..07280730f 100644
--- a/cmd/kosli/createFlow.go
+++ b/cmd/kosli/createFlow.go
@@ -111,7 +111,11 @@ func (o *createFlowOptions) run(args []string) error {
return fmt.Errorf("failed to create default template: %v", err)
}
o.TemplateFile = defaultTemplatePath
- defer os.RemoveAll(tmpDir)
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ logger.Warn("failed to remove temporary directory %s: %v", tmpDir, err)
+ }
+ }()
}
form, err := newFlowForm(o.payload, o.TemplateFile, false)
diff --git a/cmd/kosli/createFlow_test.go b/cmd/kosli/createFlow_test.go
index f3228d1cc..6e4e76582 100644
--- a/cmd/kosli/createFlow_test.go
+++ b/cmd/kosli/createFlow_test.go
@@ -102,7 +102,7 @@ func (suite *CreateFlowCommandTestSuite) TestCreateFlowCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/diffSnapshots_test.go b/cmd/kosli/diffSnapshots_test.go
index 0eb79db21..4cb0c5930 100644
--- a/cmd/kosli/diffSnapshots_test.go
+++ b/cmd/kosli/diffSnapshots_test.go
@@ -35,8 +35,8 @@ func (suite *DiffSnapshotsCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName1, "server", suite.Suite.T())
- CreateEnv(global.Org, suite.envName2, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName1, "server", suite.T())
+ CreateEnv(global.Org, suite.envName2, "server", suite.T())
}
func (suite *DiffSnapshotsCommandTestSuite) TestDiffSnapshotsCmd() {
@@ -95,13 +95,13 @@ func (suite *DiffSnapshotsCommandTestSuite) TestDiffSnapshotsCmd() {
for _, t := range tests {
if t.additionalConfig != nil {
if t.additionalConfig.(diffSnapshotsTestConfig).reportToEnv1 {
- ReportServerArtifactToEnv([]string{suite.artifactPath}, suite.envName1, suite.Suite.T())
+ ReportServerArtifactToEnv([]string{suite.artifactPath}, suite.envName1, suite.T())
}
if t.additionalConfig.(diffSnapshotsTestConfig).reportToEnv2 {
- ReportServerArtifactToEnv([]string{suite.artifactPath}, suite.envName2, suite.Suite.T())
+ ReportServerArtifactToEnv([]string{suite.artifactPath}, suite.envName2, suite.T())
}
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{t})
+ runTestCmd(suite.T(), []cmdTestCase{t})
}
}
diff --git a/cmd/kosli/docs.go b/cmd/kosli/docs.go
index 52743dcfd..c8dde1f49 100644
--- a/cmd/kosli/docs.go
+++ b/cmd/kosli/docs.go
@@ -61,7 +61,7 @@ func (o *docsOptions) run() error {
hdrFunc := func(filename string, beta, deprecated bool, summary string) string {
base := filepath.Base(filename)
name := strings.TrimSuffix(base, path.Ext(base))
- title := strings.ToLower(strings.Replace(name, "_", " ", -1))
+ title := strings.ToLower(strings.ReplaceAll(name, "_", " "))
return fmt.Sprintf("---\ntitle: \"%s\"\nbeta: %t\ndeprecated: %t\nsummary: \"%s\"\n---\n\n", title, beta, deprecated, summary)
}
@@ -82,14 +82,18 @@ func MereklyGenMarkdownTreeCustom(cmd *cobra.Command, dir string, filePrepender
}
if !cmd.HasParent() || !cmd.HasSubCommands() {
- basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".md"
+ basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + ".md"
filename := filepath.Join(dir, basename)
summary := cmd.Short
f, err := os.Create(filename)
if err != nil {
return err
}
- defer f.Close()
+ defer func() {
+ if err := f.Close(); err != nil {
+ logger.Warn("failed to close file %s: %v", filename, err)
+ }
+ }()
if _, err := io.WriteString(f, filePrepender(filename, isBeta(cmd), isDeprecated(cmd), summary)); err != nil {
return err
@@ -113,28 +117,28 @@ func KosliGenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(st
if isBeta(cmd) {
buf.WriteString("{{% hint warning %}}\n")
- buf.WriteString(fmt.Sprintf("**%s** is a beta feature. ", name))
- buf.WriteString("Beta features provide early access to product functionality. ")
- buf.WriteString("These features may change between releases without warning, or can be removed in a ")
- buf.WriteString("future release.\n")
- buf.WriteString("Please contact us to enable this feature for your organization.\n")
- // buf.WriteString("You can enable beta features by using the `kosli enable beta` command.")
+ fmt.Fprintf(buf, "**%s** is a beta feature. ", name)
+ fmt.Fprintf(buf, "Beta features provide early access to product functionality. ")
+ fmt.Fprintf(buf, "These features may change between releases without warning, or can be removed in a ")
+ fmt.Fprintf(buf, "future release.\n")
+ fmt.Fprintf(buf, "Please contact us to enable this feature for your organization.\n")
+ // fmt.Fprintf(buf, "You can enable beta features by using the `kosli enable beta` command.")
buf.WriteString("{{% /hint %}}\n")
}
if isDeprecated(cmd) {
buf.WriteString("{{% hint danger %}}\n")
- buf.WriteString(fmt.Sprintf("**%s** is deprecated. %s ", name, cmd.Deprecated))
- buf.WriteString("Deprecated commands will be removed in a future release.\n")
+ fmt.Fprintf(buf, "**%s** is deprecated. %s ", name, cmd.Deprecated)
+ fmt.Fprintf(buf, "Deprecated commands will be removed in a future release.\n")
buf.WriteString("{{% /hint %}}\n")
}
if len(cmd.Long) > 0 {
buf.WriteString("## Synopsis\n\n")
if cmd.Runnable() {
- buf.WriteString(fmt.Sprintf("```shell\n%s\n```\n\n", cmd.UseLine()))
+ fmt.Fprintf(buf, "```shell\n%s\n```\n\n", cmd.UseLine())
}
- buf.WriteString(strings.Replace(cmd.Long, "^", "`", -1) + "\n\n")
+ buf.WriteString(strings.ReplaceAll(cmd.Long, "^", "`") + "\n\n")
}
if err := printOptions(buf, cmd, name); err != nil {
@@ -145,11 +149,11 @@ func KosliGenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(st
liveExamplesBuf := new(bytes.Buffer)
for _, ci := range []string{"GitHub", "GitLab"} {
if liveYamlDocExists(ci, urlSafeName) {
- liveExamplesBuf.WriteString(fmt.Sprintf("{{< tab \"%v\" >}}", ci))
- liveExamplesBuf.WriteString(fmt.Sprintf("View an example of the `%s` command in %s.\n\n", name, ci))
- liveExamplesBuf.WriteString(fmt.Sprintf("In [this YAML file](%v)", yamlURL(ci, urlSafeName)))
+ fmt.Fprintf(liveExamplesBuf, "{{< tab \"%v\" >}}", ci)
+ fmt.Fprintf(liveExamplesBuf, "View an example of the `%s` command in %s.\n\n", name, ci)
+ fmt.Fprintf(liveExamplesBuf, "In [this YAML file](%v)", yamlURL(ci, urlSafeName))
if liveEventDocExists(ci, urlSafeName) {
- liveExamplesBuf.WriteString(fmt.Sprintf(", which created [this Kosli Event](%v).", eventURL(ci, urlSafeName)))
+ fmt.Fprintf(liveExamplesBuf, ", which created [this Kosli Event](%v).", eventURL(ci, urlSafeName))
}
liveExamplesBuf.WriteString("{{< /tab >}}")
}
@@ -166,7 +170,7 @@ func KosliGenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(st
if liveCliExists {
buf.WriteString("## Live Example\n\n")
buf.WriteString("{{< raw-html >}}")
- buf.WriteString(fmt.Sprintf("To view a live example of '%s' you can run the commands below (for the cyber-dojo demo organization).
Run the commands below and view the output.", name, liveCliURL))
+ fmt.Fprintf(buf, "To view a live example of '%s' you can run the commands below (for the cyber-dojo demo organization).
Run the commands below and view the output.", name, liveCliURL)
buf.WriteString("
")
buf.WriteString("export KOSLI_ORG=cyber-dojo\n")
buf.WriteString("export KOSLI_API_TOKEN=Pj_XT2deaVA6V1qrTlthuaWsmjVt4eaHQwqnwqjRO3A # read-only\n")
@@ -191,15 +195,15 @@ func KosliGenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(st
// Some commands have #titles spanning several lines (that is, each title line starts with a # character)
if name == "kosli report approval" {
- buf.WriteString(fmt.Sprintf("```shell\n%s\n```\n\n", example))
+ fmt.Fprintf(buf, "```shell\n%s\n```\n\n", example)
} else if name == "kosli request approval" {
- buf.WriteString(fmt.Sprintf("```shell\n%s\n```\n\n", example))
+ fmt.Fprintf(buf, "```shell\n%s\n```\n\n", example)
} else if name == "kosli snapshot server" {
- buf.WriteString(fmt.Sprintf("```shell\n%s\n```\n\n", example))
+ fmt.Fprintf(buf, "```shell\n%s\n```\n\n", example)
} else if lines[0][0] != '#' {
// Some commands, eg 'kosli assert snapshot' have no #title
// and their example starts immediately with the kosli command.
- buf.WriteString(fmt.Sprintf("```shell\n%s\n```\n\n", example))
+ fmt.Fprintf(buf, "```shell\n%s\n```\n\n", example)
} else {
// The rest we can format nicely
all := hashTitledExamples(lines)
@@ -208,8 +212,8 @@ func KosliGenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(st
// Some titles have a trailing colon, some don't
title := strings.Trim(exampleLines[0], ":")
if len(title) > 0 {
- buf.WriteString(fmt.Sprintf("##### %s\n\n", strings.TrimSpace(title[1:])))
- buf.WriteString(fmt.Sprintf("```shell\n%s\n```\n\n", strings.Join(exampleLines[1:], "\n")))
+ fmt.Fprintf(buf, "##### %s\n\n", strings.TrimSpace(title[1:]))
+ fmt.Fprintf(buf, "```shell\n%s\n```\n\n", strings.Join(exampleLines[1:], "\n"))
}
}
}
@@ -287,21 +291,21 @@ func printOptions(buf *bytes.Buffer, cmd *cobra.Command, name string) error {
const baseURL = "https://app.kosli.com/api/v2/livedocs/cyber-dojo"
func liveYamlDocExists(ci string, command string) bool {
- url := fmt.Sprintf("%v/yaml_exists?ci=%v&command=%v", baseURL, strings.ToLower(ci), command)
+ url := fmt.Sprintf("%s/yaml_exists?ci=%s&command=%s", baseURL, strings.ToLower(ci), command)
return liveDocExists(url)
}
func liveEventDocExists(ci string, command string) bool {
- url := fmt.Sprintf("%v/event_exists?ci=%v&command=%v", baseURL, strings.ToLower(ci), command)
+ url := fmt.Sprintf("%s/event_exists?ci=%s&command=%s", baseURL, strings.ToLower(ci), command)
return liveDocExists(url)
}
func liveCliDocExists(command string) (string, string, bool) {
fullCommand, ok := liveCliMap[command]
if ok {
- plussed := strings.Replace(fullCommand, " ", "+", -1)
- exists_url := fmt.Sprintf("%v/cli_exists?command=%v", baseURL, plussed)
- url := fmt.Sprintf("%v/cli?command=%v", baseURL, plussed)
+ plussed := strings.ReplaceAll(fullCommand, " ", "+")
+ exists_url := fmt.Sprintf("%s/cli_exists?command=%s", baseURL, plussed)
+ url := fmt.Sprintf("%s/cli?command=%s", baseURL, plussed)
return fullCommand, url, liveDocExists(exists_url)
} else {
return "", "", false
@@ -313,7 +317,11 @@ func liveDocExists(url string) bool {
if err != nil {
return false
}
- defer response.Body.Close()
+ defer func() {
+ if err := response.Body.Close(); err != nil {
+ logger.Warn("failed to close response body: %v", err)
+ }
+ }()
decoder := json.NewDecoder(response.Body)
var exists bool
err = decoder.Decode(&exists)
@@ -324,11 +332,11 @@ func liveDocExists(url string) bool {
}
func yamlURL(ci string, command string) string {
- return fmt.Sprintf("%v/yaml?ci=%v&command=%v", baseURL, strings.ToLower(ci), command)
+ return fmt.Sprintf("%s/yaml?ci=%s&command=%s", baseURL, strings.ToLower(ci), command)
}
func eventURL(ci string, command string) string {
- return fmt.Sprintf("%v/event?ci=%v&command=%v", baseURL, strings.ToLower(ci), command)
+ return fmt.Sprintf("%s/event?ci=%s&command=%s", baseURL, strings.ToLower(ci), command)
}
var liveCliMap = map[string]string{
diff --git a/cmd/kosli/docs_test.go b/cmd/kosli/docs_test.go
index 5ab831d13..2f383f6e0 100644
--- a/cmd/kosli/docs_test.go
+++ b/cmd/kosli/docs_test.go
@@ -29,8 +29,12 @@ func (suite *DocsCommandTestSuite) TestDocsCmd() {
global = &GlobalOpts{}
tempDirName, err := os.MkdirTemp("", "generatedDocs")
//fmt.Printf("tempDirName :%s:\n\n\n\n\n", tempDirName)
- require.NoError(suite.Suite.T(), err)
- defer os.RemoveAll(tempDirName)
+ require.NoError(suite.T(), err)
+ defer func() {
+ if err := os.RemoveAll(tempDirName); err != nil {
+ require.NoError(suite.T(), err, "failed to remove temp dir %s", tempDirName)
+ }
+ }()
o := &docsOptions{
dest: tempDirName,
@@ -38,12 +42,12 @@ func (suite *DocsCommandTestSuite) TestDocsCmd() {
generateHeaders: true,
}
err = o.run()
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
actualFile := filepath.Join(tempDirName, "snyk.md")
- require.FileExists(suite.Suite.T(), actualFile)
+ require.FileExists(suite.T(), actualFile)
err = compareTwoFiles(actualFile, goldenPath("output/docs/snyk.md"))
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/expectDeployment_test.go b/cmd/kosli/expectDeployment_test.go
index d260505b0..ab6d93b41 100644
--- a/cmd/kosli/expectDeployment_test.go
+++ b/cmd/kosli/expectDeployment_test.go
@@ -33,15 +33,15 @@ func (suite *ExpectDeploymentCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifact(suite.flowName, suite.fingerprint, suite.artifactName, suite.Suite.T())
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifact(suite.flowName, suite.fingerprint, suite.artifactName, suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
}
func (suite *ExpectDeploymentCommandTestSuite) TestExpectDeploymentCmd() {
@@ -112,7 +112,7 @@ func (suite *ExpectDeploymentCommandTestSuite) TestExpectDeploymentCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/fingerprint_test.go b/cmd/kosli/fingerprint_test.go
index 09e0bf649..79514ace6 100644
--- a/cmd/kosli/fingerprint_test.go
+++ b/cmd/kosli/fingerprint_test.go
@@ -19,7 +19,7 @@ type FingerprintTestSuite struct {
func (suite *FingerprintTestSuite) SetupSuite() {
suite.imageName = "library/alpine@sha256:e15947432b813e8ffa90165da919953e2ce850bef511a0ad1287d7cb86de84b5"
err := docker.PullDockerImage(suite.imageName)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
func (suite *FingerprintTestSuite) TestFingerprintCmd() {
@@ -102,7 +102,7 @@ func (suite *FingerprintTestSuite) TestFingerprintCmd() {
wantError: true,
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/getApproval_test.go b/cmd/kosli/getApproval_test.go
index db2b8725b..aa43fcff0 100644
--- a/cmd/kosli/getApproval_test.go
+++ b/cmd/kosli/getApproval_test.go
@@ -27,10 +27,10 @@ func (suite *GetApprovalCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
- CreateArtifact(suite.flowName, suite.fingerprint, "approved-artifact", suite.Suite.T())
- CreateApproval(suite.flowName, suite.fingerprint, false, suite.Suite.T())
- CreateApproval(suite.flowName, suite.fingerprint, false, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
+ CreateArtifact(suite.flowName, suite.fingerprint, "approved-artifact", suite.T())
+ CreateApproval(suite.flowName, suite.fingerprint, false, suite.T())
+ CreateApproval(suite.flowName, suite.fingerprint, false, suite.T())
}
func (suite *GetApprovalCommandTestSuite) TestGetApprovalCmd() {
@@ -76,7 +76,7 @@ func (suite *GetApprovalCommandTestSuite) TestGetApprovalCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/getArtifact_test.go b/cmd/kosli/getArtifact_test.go
index 8c1f65072..072ac6823 100644
--- a/cmd/kosli/getArtifact_test.go
+++ b/cmd/kosli/getArtifact_test.go
@@ -33,15 +33,15 @@ func (suite *GetArtifactCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.fingerprint, suite.artifactName, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.fingerprint, suite.artifactName, suite.T())
}
func (suite *GetArtifactCommandTestSuite) TestGetArtifactCmd() {
@@ -96,7 +96,7 @@ func (suite *GetArtifactCommandTestSuite) TestGetArtifactCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/getAttestationType_test.go b/cmd/kosli/getAttestationType_test.go
index fc02efe93..85b434a0c 100644
--- a/cmd/kosli/getAttestationType_test.go
+++ b/cmd/kosli/getAttestationType_test.go
@@ -27,9 +27,9 @@ func (suite *GetAttestationTypeCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateCustomAttestationType(suite.attestationTypeName, "testdata/person-schema.json", []string{".age > 21"}, suite.Suite.T())
- CreateCustomAttestationType(suite.archivedTypeName, "testdata/person-schema.json", []string{".age < 21"}, suite.Suite.T())
- ArchiveCustomAttestationType(suite.archivedTypeName, suite.Suite.T())
+ CreateCustomAttestationType(suite.attestationTypeName, "testdata/person-schema.json", []string{".age > 21"}, suite.T())
+ CreateCustomAttestationType(suite.archivedTypeName, "testdata/person-schema.json", []string{".age < 21"}, suite.T())
+ ArchiveCustomAttestationType(suite.archivedTypeName, suite.T())
}
func (suite *GetAttestationTypeCommandTestSuite) TestGetAttestationTypeCmd() {
@@ -79,7 +79,7 @@ func (suite *GetAttestationTypeCommandTestSuite) TestGetAttestationTypeCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/getAttestation_test.go b/cmd/kosli/getAttestation_test.go
index 6e16885ff..ace7338a5 100644
--- a/cmd/kosli/getAttestation_test.go
+++ b/cmd/kosli/getAttestation_test.go
@@ -34,21 +34,21 @@ func (suite *GetAttestationCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.fingerprint, suite.artifactName, suite.Suite.T())
- CreateGenericArtifactAttestation(suite.flowName, suite.trailName, suite.fingerprint, "first-artifact-attestation", true, suite.Suite.T())
- CreateGenericTrailAttestation(suite.flowName, suite.trailName, "first-trail-attestation", suite.Suite.T())
- CreateGenericArtifactAttestation(suite.flowName, suite.trailName, suite.fingerprint, "second-artifact-attestation", true, suite.Suite.T())
- CreateGenericTrailAttestation(suite.flowName, suite.trailName, "second-trail-attestation", suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifactOnTrail(suite.flowName, suite.trailName, "cli", suite.fingerprint, suite.artifactName, suite.T())
+ CreateGenericArtifactAttestation(suite.flowName, suite.trailName, suite.fingerprint, "first-artifact-attestation", true, suite.T())
+ CreateGenericTrailAttestation(suite.flowName, suite.trailName, "first-trail-attestation", suite.T())
+ CreateGenericArtifactAttestation(suite.flowName, suite.trailName, suite.fingerprint, "second-artifact-attestation", true, suite.T())
+ CreateGenericTrailAttestation(suite.flowName, suite.trailName, "second-trail-attestation", suite.T())
- suite.attestationId = GetAttestationId(suite.flowName, suite.trailName, "first-trail-attestation", suite.Suite.T())
+ suite.attestationId = GetAttestationId(suite.flowName, suite.trailName, "first-trail-attestation", suite.T())
}
func (suite *GetAttestationCommandTestSuite) TestGetAttestationCmd() {
@@ -161,7 +161,7 @@ func (suite *GetAttestationCommandTestSuite) TestGetAttestationCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/getDeployment.go b/cmd/kosli/getDeployment.go
index 6ef6e80b6..72c2d86af 100644
--- a/cmd/kosli/getDeployment.go
+++ b/cmd/kosli/getDeployment.go
@@ -126,11 +126,12 @@ func printDeploymentAsTable(raw string, out io.Writer, page int) error {
}
stateString := "Unknown"
- if state == "deploying" {
+ switch state {
+ case "deploying":
stateString = "Deploying"
- } else if state == "running" {
+ case "running":
stateString = fmt.Sprintf("The artifact running since %s", stateTimestamp)
- } else if state == "exited" {
+ case "exited":
stateString = fmt.Sprintf("The artifact exited on %s", stateTimestamp)
}
diff --git a/cmd/kosli/getDeployment_test.go b/cmd/kosli/getDeployment_test.go
index 9270c5137..9d503e3a9 100644
--- a/cmd/kosli/getDeployment_test.go
+++ b/cmd/kosli/getDeployment_test.go
@@ -31,17 +31,17 @@ func (suite *GetDeploymentCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifact(suite.flowName, suite.fingerprint, "arti-name", suite.Suite.T())
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
- ExpectDeployment(suite.flowName, suite.fingerprint, suite.envName, suite.Suite.T())
- ExpectDeployment(suite.flowName, suite.fingerprint, suite.envName, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifact(suite.flowName, suite.fingerprint, "arti-name", suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
+ ExpectDeployment(suite.flowName, suite.fingerprint, suite.envName, suite.T())
+ ExpectDeployment(suite.flowName, suite.fingerprint, suite.envName, suite.T())
}
func (suite *GetDeploymentCommandTestSuite) TestGetDeploymentCmd() {
@@ -98,7 +98,7 @@ func (suite *GetDeploymentCommandTestSuite) TestGetDeploymentCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/getEnvironment_test.go b/cmd/kosli/getEnvironment_test.go
index 8563b75e3..e9560bce8 100644
--- a/cmd/kosli/getEnvironment_test.go
+++ b/cmd/kosli/getEnvironment_test.go
@@ -26,7 +26,7 @@ func (suite *GetEnvironmentCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, suite.envType, suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, suite.envType, suite.T())
}
func (suite *GetEnvironmentCommandTestSuite) TestGetEnvironmentCmd() {
@@ -57,7 +57,7 @@ func (suite *GetEnvironmentCommandTestSuite) TestGetEnvironmentCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/getFlow.go b/cmd/kosli/getFlow.go
index 4b15cd58c..6670c2d72 100644
--- a/cmd/kosli/getFlow.go
+++ b/cmd/kosli/getFlow.go
@@ -86,7 +86,7 @@ func printFlowAsTable(raw string, out io.Writer, page int) error {
lines[0] = "\n" + lines[0]
template = strings.Join(lines, "\n")
} else {
- template = strings.Replace(template, " ", ", ", -1)
+ template = strings.ReplaceAll(template, " ", ", ")
}
tagsOutput := ""
diff --git a/cmd/kosli/getFlow_test.go b/cmd/kosli/getFlow_test.go
index 55980277b..d01698d8d 100644
--- a/cmd/kosli/getFlow_test.go
+++ b/cmd/kosli/getFlow_test.go
@@ -25,7 +25,7 @@ func (suite *GetFlowCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
}
func (suite *GetFlowCommandTestSuite) TestGetFlowCmd() {
@@ -52,7 +52,7 @@ func (suite *GetFlowCommandTestSuite) TestGetFlowCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/getPolicy_test.go b/cmd/kosli/getPolicy_test.go
index f49b54be5..13ef0697d 100644
--- a/cmd/kosli/getPolicy_test.go
+++ b/cmd/kosli/getPolicy_test.go
@@ -24,7 +24,7 @@ func (suite *GetPolicyCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreatePolicy(global.Org, suite.policyName, suite.Suite.T())
+ CreatePolicy(global.Org, suite.policyName, suite.T())
}
func (suite *GetPolicyCommandTestSuite) TestGetPolicyCmd() {
@@ -51,7 +51,7 @@ func (suite *GetPolicyCommandTestSuite) TestGetPolicyCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/getSnapshot_test.go b/cmd/kosli/getSnapshot_test.go
index f7da4368a..286beb416 100644
--- a/cmd/kosli/getSnapshot_test.go
+++ b/cmd/kosli/getSnapshot_test.go
@@ -28,11 +28,11 @@ func (suite *GetSnapshotCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
- ReportServerArtifactToEnv([]string{"testdata/folder1/hello.txt"}, suite.envName, suite.Suite.T())
- ReportServerArtifactToEnv([]string{"testdata/file1"}, suite.envName, suite.Suite.T())
- ReportServerArtifactToEnv([]string{"testdata/report.xml"}, suite.envName, suite.Suite.T())
- CreateEnv(global.Org, suite.emptyEnvName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
+ ReportServerArtifactToEnv([]string{"testdata/folder1/hello.txt"}, suite.envName, suite.T())
+ ReportServerArtifactToEnv([]string{"testdata/file1"}, suite.envName, suite.T())
+ ReportServerArtifactToEnv([]string{"testdata/report.xml"}, suite.envName, suite.T())
+ CreateEnv(global.Org, suite.emptyEnvName, "server", suite.T())
}
// TODO: Add test for a snappish of the environemnt name
@@ -68,7 +68,7 @@ func (suite *GetSnapshotCommandTestSuite) TestGetSnapshotCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
func currentTimeForSnappish() string {
diff --git a/cmd/kosli/getTrail_test.go b/cmd/kosli/getTrail_test.go
index ae3eda698..7500b5e7e 100644
--- a/cmd/kosli/getTrail_test.go
+++ b/cmd/kosli/getTrail_test.go
@@ -27,8 +27,8 @@ func (suite *GetTrailCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail(suite.trailName, suite.flowName, "", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail(suite.trailName, suite.flowName, "", suite.T())
}
func (suite *GetTrailCommandTestSuite) TestGetTrailCmd() {
@@ -62,7 +62,7 @@ func (suite *GetTrailCommandTestSuite) TestGetTrailCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/joinEnvironment_test.go b/cmd/kosli/joinEnvironment_test.go
index 48ec3a62d..0ee1c2fab 100644
--- a/cmd/kosli/joinEnvironment_test.go
+++ b/cmd/kosli/joinEnvironment_test.go
@@ -27,8 +27,8 @@ func (suite *JoinEnvironmentCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.logicalEnvName, "logical", suite.Suite.T())
- CreateEnv(global.Org, suite.physicalEnvName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.logicalEnvName, "logical", suite.T())
+ CreateEnv(global.Org, suite.physicalEnvName, "server", suite.T())
}
func (suite *JoinEnvironmentCommandTestSuite) TestJoinEnvironmentCmd() {
@@ -60,7 +60,7 @@ func (suite *JoinEnvironmentCommandTestSuite) TestJoinEnvironmentCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/listApprovals_test.go b/cmd/kosli/listApprovals_test.go
index 0f5072de1..9243a09b6 100644
--- a/cmd/kosli/listApprovals_test.go
+++ b/cmd/kosli/listApprovals_test.go
@@ -32,16 +32,16 @@ func (suite *ListApprovalsCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName1, suite.Suite.T())
- CreateFlow(suite.flowName2, suite.Suite.T())
+ CreateFlow(suite.flowName1, suite.T())
+ CreateFlow(suite.flowName2, suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifact(suite.flowName2, suite.fingerprint, suite.artifactName, suite.Suite.T())
- CreateApproval(suite.flowName2, suite.fingerprint, false, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifact(suite.flowName2, suite.fingerprint, suite.artifactName, suite.T())
+ CreateApproval(suite.flowName2, suite.fingerprint, false, suite.T())
}
func (suite *ListApprovalsCommandTestSuite) TestListApprovalsCmd() {
@@ -88,7 +88,7 @@ func (suite *ListApprovalsCommandTestSuite) TestListApprovalsCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/listArtifacts_test.go b/cmd/kosli/listArtifacts_test.go
index 2e5b642f3..72ab0aaa8 100644
--- a/cmd/kosli/listArtifacts_test.go
+++ b/cmd/kosli/listArtifacts_test.go
@@ -33,22 +33,22 @@ func (suite *ListArtifactsCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName1, suite.Suite.T())
- CreateFlow(suite.flowName2, suite.Suite.T())
+ CreateFlow(suite.flowName1, suite.T())
+ CreateFlow(suite.flowName2, suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
suite.repoName = "kosli/dev"
SetEnvVars(map[string]string{
"GITHUB_RUN_NUMBER": "1234",
"GITHUB_SERVER_URL": "https://github.com",
"GITHUB_REPOSITORY": suite.repoName,
"GITHUB_REPOSITORY_ID": "1234567890",
- }, suite.Suite.T())
- CreateArtifactOnTrail(suite.flowName2, "trail-1", "backend", suite.fingerprint, suite.artifactName, suite.Suite.T())
+ }, suite.T())
+ CreateArtifactOnTrail(suite.flowName2, "trail-1", "backend", suite.fingerprint, suite.artifactName, suite.T())
}
func (suite *ListArtifactsCommandTestSuite) TearDownTest() {
@@ -57,7 +57,7 @@ func (suite *ListArtifactsCommandTestSuite) TearDownTest() {
"GITHUB_SERVER_URL": "",
"GITHUB_REPOSITORY": "",
"GITHUB_REPOSITORY_ID": "",
- }, suite.Suite.T())
+ }, suite.T())
}
func (suite *ListArtifactsCommandTestSuite) TestListArtifactsCmd() {
@@ -115,7 +115,7 @@ func (suite *ListArtifactsCommandTestSuite) TestListArtifactsCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/listAttestationTypes_test.go b/cmd/kosli/listAttestationTypes_test.go
index faaff79f0..395b3e7ed 100644
--- a/cmd/kosli/listAttestationTypes_test.go
+++ b/cmd/kosli/listAttestationTypes_test.go
@@ -27,9 +27,9 @@ func (suite *ListAttestationTypesCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateCustomAttestationType(suite.attestationName1, "testdata/person-schema.json", []string{".age > 21"}, suite.Suite.T())
- CreateCustomAttestationType(suite.attestationName2, "testdata/person-schema.json", []string{".age < 25"}, suite.Suite.T())
- CreateCustomAttestationType(suite.attestationName1, "testdata/person-schema.json", []string{".age > 21", ".age < 85"}, suite.Suite.T()) //Make a second version
+ CreateCustomAttestationType(suite.attestationName1, "testdata/person-schema.json", []string{".age > 21"}, suite.T())
+ CreateCustomAttestationType(suite.attestationName2, "testdata/person-schema.json", []string{".age < 25"}, suite.T())
+ CreateCustomAttestationType(suite.attestationName1, "testdata/person-schema.json", []string{".age > 21", ".age < 85"}, suite.T()) //Make a second version
global.Org = "acme-org"
global.ApiToken = "v3OWZiYWu9G2IMQStYg9BcPQUQ88lJNNnTJTNq8jfvmkR1C5wVpHSs7F00JcB5i6OGeUzrKt3CwRq7ndcN4TTfMeo8ASVJ5NdHpZT7DkfRfiFvm8s7GbsIHh2PtiQJYs2UoN13T8DblV5C4oKb6-yWH73h67OhotPlKfVKazR-c"
@@ -67,7 +67,7 @@ func (suite *ListAttestationTypesCommandTestSuite) TestListAttestationTypesCmd()
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/listDeployments_test.go b/cmd/kosli/listDeployments_test.go
index 1b820ca01..6d31b9973 100644
--- a/cmd/kosli/listDeployments_test.go
+++ b/cmd/kosli/listDeployments_test.go
@@ -34,17 +34,17 @@ func (suite *ListDeploymentsCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName1, suite.Suite.T())
- CreateFlow(suite.flowName2, suite.Suite.T())
+ CreateFlow(suite.flowName1, suite.T())
+ CreateFlow(suite.flowName2, suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifact(suite.flowName2, suite.fingerprint, suite.artifactName, suite.Suite.T())
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
- ExpectDeployment(suite.flowName2, suite.fingerprint, suite.envName, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifact(suite.flowName2, suite.fingerprint, suite.artifactName, suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
+ ExpectDeployment(suite.flowName2, suite.fingerprint, suite.envName, suite.T())
}
func (suite *ListDeploymentsCommandTestSuite) TestListDeploymentsCmd() {
@@ -102,7 +102,7 @@ func (suite *ListDeploymentsCommandTestSuite) TestListDeploymentsCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/listEnvironments_test.go b/cmd/kosli/listEnvironments_test.go
index 00fd6187e..4641ccbfa 100644
--- a/cmd/kosli/listEnvironments_test.go
+++ b/cmd/kosli/listEnvironments_test.go
@@ -58,7 +58,7 @@ func (suite *ListEnvironmentsCommandTestSuite) TestListEnvironmentsCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/listFlows_test.go b/cmd/kosli/listFlows_test.go
index ce190adde..2999fbb7a 100644
--- a/cmd/kosli/listFlows_test.go
+++ b/cmd/kosli/listFlows_test.go
@@ -59,7 +59,7 @@ func (suite *ListFlowsCommandTestSuite) TestListFlowsCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/listPolicies_test.go b/cmd/kosli/listPolicies_test.go
index 6c7a00716..6c978f221 100644
--- a/cmd/kosli/listPolicies_test.go
+++ b/cmd/kosli/listPolicies_test.go
@@ -23,7 +23,7 @@ func (suite *ListPoliciesCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreatePolicy(global.Org, "test-policy", suite.Suite.T())
+ CreatePolicy(global.Org, "test-policy", suite.T())
global.Org = "acme-org"
global.ApiToken = "v3OWZiYWu9G2IMQStYg9BcPQUQ88lJNNnTJTNq8jfvmkR1C5wVpHSs7F00JcB5i6OGeUzrKt3CwRq7ndcN4TTfMeo8ASVJ5NdHpZT7DkfRfiFvm8s7GbsIHh2PtiQJYs2UoN13T8DblV5C4oKb6-yWH73h67OhotPlKfVKazR-c"
@@ -59,7 +59,7 @@ func (suite *ListPoliciesCommandTestSuite) TestListPoliciesCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/listRepos.go b/cmd/kosli/listRepos.go
index 1e981e3cb..db81d91b6 100644
--- a/cmd/kosli/listRepos.go
+++ b/cmd/kosli/listRepos.go
@@ -55,7 +55,7 @@ func (o *listReposOptions) run(out io.Writer) error {
return err
}
- return output.FormattedPrint(response.Body, o.listOptions.output, out, o.pageNumber,
+ return output.FormattedPrint(response.Body, o.output, out, o.pageNumber,
map[string]output.FormatOutputFunc{
"table": printReposListAsTable,
"json": output.PrintJson,
diff --git a/cmd/kosli/listRepos_test.go b/cmd/kosli/listRepos_test.go
index 8d83e3a0c..d3379b551 100644
--- a/cmd/kosli/listRepos_test.go
+++ b/cmd/kosli/listRepos_test.go
@@ -27,14 +27,14 @@ func (suite *ListReposCommandTestSuite) SetupTest() {
global.Org = "acme-org"
global.ApiToken = "v3OWZiYWu9G2IMQStYg9BcPQUQ88lJNNnTJTNq8jfvmkR1C5wVpHSs7F00JcB5i6OGeUzrKt3CwRq7ndcN4TTfMeo8ASVJ5NdHpZT7DkfRfiFvm8s7GbsIHh2PtiQJYs2UoN13T8DblV5C4oKb6-yWH73h67OhotPlKfVKazR-c"
suite.acmeOrgKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate("list-repos", "testdata/valid_template.yml", suite.Suite.T())
+ CreateFlowWithTemplate("list-repos", "testdata/valid_template.yml", suite.T())
SetEnvVars(map[string]string{
"GITHUB_RUN_NUMBER": "1234",
"GITHUB_SERVER_URL": "https://github.com",
"GITHUB_REPOSITORY": "kosli-dev/cli",
"GITHUB_REPOSITORY_ID": "1234567890",
- }, suite.Suite.T())
- BeginTrail("trail-name", "list-repos", "", suite.Suite.T())
+ }, suite.T())
+ BeginTrail("trail-name", "list-repos", "", suite.T())
}
func (suite *ListReposCommandTestSuite) TearDownTest() {
@@ -43,7 +43,7 @@ func (suite *ListReposCommandTestSuite) TearDownTest() {
"GITHUB_SERVER_URL": "",
"GITHUB_REPOSITORY": "",
"GITHUB_REPOSITORY_ID": "",
- }, suite.Suite.T())
+ }, suite.T())
}
func (suite *ListReposCommandTestSuite) TestListReposCmd() {
@@ -95,7 +95,7 @@ func (suite *ListReposCommandTestSuite) TestListReposCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/listSnapshots_test.go b/cmd/kosli/listSnapshots_test.go
index 581c808b5..cf12459f8 100644
--- a/cmd/kosli/listSnapshots_test.go
+++ b/cmd/kosli/listSnapshots_test.go
@@ -33,7 +33,7 @@ func (suite *ListSnapshotsCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.snapshotsEnvName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.snapshotsEnvName, "server", suite.T())
}
func (suite *ListSnapshotsCommandTestSuite) TestListSnapshotsCmd() {
@@ -116,11 +116,11 @@ func (suite *ListSnapshotsCommandTestSuite) TestListSnapshotsCmd() {
if t.additionalConfig.(listSnapshotsTestConfig).reportToEnv {
// send 2 reports to create 2 snapshots
// every time this is called, will add 2 more snapshots and 2 more events
- ReportServerArtifactToEnv([]string{suite.firstArtifactPath}, suite.snapshotsEnvName, suite.Suite.T())
- ReportServerArtifactToEnv([]string{suite.firstArtifactPath, suite.secondArtifactPath}, suite.snapshotsEnvName, suite.Suite.T())
+ ReportServerArtifactToEnv([]string{suite.firstArtifactPath}, suite.snapshotsEnvName, suite.T())
+ ReportServerArtifactToEnv([]string{suite.firstArtifactPath, suite.secondArtifactPath}, suite.snapshotsEnvName, suite.T())
}
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{t})
+ runTestCmd(suite.T(), []cmdTestCase{t})
}
}
diff --git a/cmd/kosli/listTrails_test.go b/cmd/kosli/listTrails_test.go
index 81c6e700a..1ae06f7d0 100644
--- a/cmd/kosli/listTrails_test.go
+++ b/cmd/kosli/listTrails_test.go
@@ -26,12 +26,12 @@ func (suite *ListTrailsCommandTestSuite) SetupTest() {
suite.flowName = "list-trails"
suite.defaultKosliArguments = fmt.Sprintf(" --flow %s --host %s --org %s --api-token %s", suite.flowName, global.Host, global.Org, global.ApiToken)
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
- BeginTrail("trail-name", suite.flowName, "", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
+ BeginTrail("trail-name", suite.flowName, "", suite.T())
global.Org = "acme-org"
global.ApiToken = "v3OWZiYWu9G2IMQStYg9BcPQUQ88lJNNnTJTNq8jfvmkR1C5wVpHSs7F00JcB5i6OGeUzrKt3CwRq7ndcN4TTfMeo8ASVJ5NdHpZT7DkfRfiFvm8s7GbsIHh2PtiQJYs2UoN13T8DblV5C4oKb6-yWH73h67OhotPlKfVKazR-c"
- CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.Suite.T())
+ CreateFlowWithTemplate(suite.flowName, "testdata/valid_template.yml", suite.T())
suite.acmeOrgKosliArguments = fmt.Sprintf(" --flow %s --host %s --org %s --api-token %s", suite.flowName, global.Host, global.Org, global.ApiToken)
}
@@ -82,7 +82,7 @@ func (suite *ListTrailsCommandTestSuite) TestListTrailsCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/logEnvironment_test.go b/cmd/kosli/logEnvironment_test.go
index 8492a808f..5a6dbec6b 100644
--- a/cmd/kosli/logEnvironment_test.go
+++ b/cmd/kosli/logEnvironment_test.go
@@ -29,7 +29,7 @@ func (suite *LogEnvironmentCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.eventsEnvName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.eventsEnvName, "server", suite.T())
}
func (suite *LogEnvironmentCommandTestSuite) TestLogEnvironmentCmd() {
@@ -112,11 +112,11 @@ func (suite *LogEnvironmentCommandTestSuite) TestLogEnvironmentCmd() {
if t.additionalConfig.(listSnapshotsTestConfig).reportToEnv {
// send 2 reports to create 2 snapshots
// every time this is called, will add 2 more snapshots and 2 more events
- ReportServerArtifactToEnv([]string{suite.firstArtifactPath}, suite.eventsEnvName, suite.Suite.T())
- ReportServerArtifactToEnv([]string{suite.firstArtifactPath, suite.secondArtifactPath}, suite.eventsEnvName, suite.Suite.T())
+ ReportServerArtifactToEnv([]string{suite.firstArtifactPath}, suite.eventsEnvName, suite.T())
+ ReportServerArtifactToEnv([]string{suite.firstArtifactPath, suite.secondArtifactPath}, suite.eventsEnvName, suite.T())
}
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{t})
+ runTestCmd(suite.T(), []cmdTestCase{t})
}
}
diff --git a/cmd/kosli/multiHost_test.go b/cmd/kosli/multiHost_test.go
index 120fca6c5..9edf5dfaa 100644
--- a/cmd/kosli/multiHost_test.go
+++ b/cmd/kosli/multiHost_test.go
@@ -84,7 +84,7 @@ func (suite *MultiHostTestSuite) TestIsMultiHost() {
want: false,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
host := fmt.Sprintf("--host=%s", t.host)
apiToken := fmt.Sprintf("--api-token=%s", t.apiToken)
org := fmt.Sprintf("--org=%s", orgName)
@@ -94,7 +94,7 @@ func (suite *MultiHostTestSuite) TestIsMultiHost() {
os.Args = args
actual := isMultiHost()
- assert.Equal(suite.Suite.T(), t.want, actual, fmt.Sprintf("TestIsMultiHost: %s\n\texpected: '%v'\n\t--actual: '%v'\n", t.name, t.want, actual))
+ assert.Equal(suite.T(), t.want, actual, fmt.Sprintf("TestIsMultiHost: %s\n\texpected: '%v'\n\t--actual: '%v'\n", t.name, t.want, actual))
})
}
}
@@ -126,11 +126,11 @@ func (suite *MultiHostTestSuite) TestRunDoubledHost() {
os.Args = t.args
output, err := runMultiHost(t.args)
- assert.Equal(suite.Suite.T(), t.err, err, fmt.Sprintf("TestRunDoubleHost: %s\n\texpected: '%v'\n\t--actual: '%v'\n", t.name, t.err, err))
+ assert.Equal(suite.T(), t.err, err, fmt.Sprintf("TestRunDoubleHost: %s\n\texpected: '%v'\n\t--actual: '%v'\n", t.name, t.err, err))
lines := strings.Split(output, "\n")
d := diff(t.stdOut, lines)
- assert.Equal(suite.Suite.T(), "", d, fmt.Sprintf("TestRunDoubleHost: %s\n%s\n", t.name, d))
+ assert.Equal(suite.T(), "", d, fmt.Sprintf("TestRunDoubleHost: %s\n%s\n", t.name, d))
}
}
@@ -161,11 +161,11 @@ func (suite *MultiHostTestSuite) TestRunTripledHost() {
os.Args = t.args
output, err := runMultiHost(t.args)
- assert.Equal(suite.Suite.T(), t.err, err, fmt.Sprintf("TestRunTripledHost: %s\n\texpected: '%v'\n\t--actual: '%v'\n", t.name, t.err, err))
+ assert.Equal(suite.T(), t.err, err, fmt.Sprintf("TestRunTripledHost: %s\n\texpected: '%v'\n\t--actual: '%v'\n", t.name, t.err, err))
lines := strings.Split(output, "\n")
d := diff(t.stdOut, lines)
- assert.Equal(suite.Suite.T(), "", d, fmt.Sprintf("TestRunTripledHost: %s\n%s\n", t.name, d))
+ assert.Equal(suite.T(), "", d, fmt.Sprintf("TestRunTripledHost: %s\n%s\n", t.name, d))
}
}
diff --git a/cmd/kosli/pipelineCommand_test.go b/cmd/kosli/pipelineCommand_test.go
index 2af8d0f81..47d1f086f 100644
--- a/cmd/kosli/pipelineCommand_test.go
+++ b/cmd/kosli/pipelineCommand_test.go
@@ -22,12 +22,12 @@ func (suite *PipelineCommandTestSuite) TestPipelineCommandCmd() {
repo, err := git.PlainOpen("../..")
if err != nil {
- suite.Suite.T().Fatal(fmt.Errorf("failed to open git repository at %s: %v", "../..", err))
+ suite.T().Fatal(fmt.Errorf("failed to open git repository at %s: %v", "../..", err))
}
// headHash, err := repo.ResolveRevision(plumbing.Revision("HEAD"))
repoHead, err := repo.Head()
if err != nil {
- suite.Suite.T().Fatal(fmt.Errorf("failed to resolve revision %s: %v", "HEAD", err))
+ suite.T().Fatal(fmt.Errorf("failed to resolve revision %s: %v", "HEAD", err))
}
headHash := repoHead.Hash().String()
@@ -106,7 +106,7 @@ func (suite *PipelineCommandTestSuite) TestPipelineCommandCmd() {
golden: "",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/pullrequest.go b/cmd/kosli/pullrequest.go
index 2af3ea26b..4ab82966c 100644
--- a/cmd/kosli/pullrequest.go
+++ b/cmd/kosli/pullrequest.go
@@ -69,7 +69,11 @@ func (o *pullRequestArtifactOptions) run(out io.Writer, args []string) error {
form, cleanupNeeded, evidencePath, err := newEvidenceForm(o.payload, []string{})
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
if err != nil {
@@ -90,7 +94,7 @@ func (o *pullRequestArtifactOptions) run(out io.Writer, args []string) error {
logger.Info("%s %s evidence is reported to artifact: %s", o.payload.GitProvider, label, o.payload.ArtifactFingerprint)
}
- if len(pullRequestsEvidence) == 0 && o.pullRequestOptions.assert && !global.DryRun {
+ if len(pullRequestsEvidence) == 0 && o.assert && !global.DryRun {
return fmt.Errorf("assert failed: no %s found for the given commit: %s", label, o.commit)
}
return err
@@ -142,7 +146,11 @@ func (o *attestPROptions) run(args []string) error {
}
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
logger.Info("found %d %s(s) for commit: %s", len(pullRequestsEvidence), label, o.payload.Commit.Sha1)
@@ -201,7 +209,11 @@ func (o *pullRequestCommitOptions) run(args []string) error {
form, cleanupNeeded, evidencePath, err := newEvidenceForm(o.payload, []string{})
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
if err != nil {
@@ -221,13 +233,13 @@ func (o *pullRequestCommitOptions) run(args []string) error {
logger.Info("%s %s evidence is reported to commit: %s", o.payload.GitProvider, label, o.payload.CommitSHA)
}
- if len(pullRequestsEvidence) == 0 && o.pullRequestOptions.assert && !global.DryRun {
+ if len(pullRequestsEvidence) == 0 && o.assert && !global.DryRun {
return fmt.Errorf("assert failed: no %s found for the given commit: %s", label, o.payload.CommitSHA)
}
return err
}
-func getGitProviderAndLabel(retriever interface{}) (string, string) {
+func getGitProviderAndLabel(retriever any) (string, string) {
label := "pull request"
provider := ""
t := reflect.TypeOf(retriever)
diff --git a/cmd/kosli/renameEnvironment_test.go b/cmd/kosli/renameEnvironment_test.go
index 018a04f54..f42b52d6a 100644
--- a/cmd/kosli/renameEnvironment_test.go
+++ b/cmd/kosli/renameEnvironment_test.go
@@ -25,7 +25,7 @@ func (suite *RenameEnvironmentCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
}
func (suite *RenameEnvironmentCommandTestSuite) TestRenameEnvironmentCmd() {
@@ -61,7 +61,7 @@ func (suite *RenameEnvironmentCommandTestSuite) TestRenameEnvironmentCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/renameFlow_test.go b/cmd/kosli/renameFlow_test.go
index feaabc51e..aa491c404 100644
--- a/cmd/kosli/renameFlow_test.go
+++ b/cmd/kosli/renameFlow_test.go
@@ -25,7 +25,7 @@ func (suite *RenameFlowCommandTestSuite) SetupTest() {
Host: "http://localhost:8001",
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
}
func (suite *RenameFlowCommandTestSuite) TestRenameFlowCmd() {
@@ -61,7 +61,7 @@ func (suite *RenameFlowCommandTestSuite) TestRenameFlowCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportApproval_test.go b/cmd/kosli/reportApproval_test.go
index c991a4459..ca72e6262 100644
--- a/cmd/kosli/reportApproval_test.go
+++ b/cmd/kosli/reportApproval_test.go
@@ -34,7 +34,7 @@ func (suite *ApprovalReportTestSuite) SetupTest() {
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
suite.flowName = "approval-test"
suite.envName = "staging"
- t := suite.Suite.T()
+ t := suite.T()
gitView, err := gitview.New("../..")
require.NoError(t, err, "Failed to create gitview")
@@ -45,7 +45,7 @@ func (suite *ApprovalReportTestSuite) SetupTest() {
suite.artifactPath = "testdata/report.xml"
// We cannot get the digest of the file by running the 'kosli fingerprint' command
// by using executeCommandC() because this function overwrites the global options
- suite.artifactFingerprint, err = digest.FileSha256(suite.artifactPath)
+ suite.artifactFingerprint, err = digest.FileSha256(suite.artifactPath, logger)
require.NoError(t, err, "Failed to calculate fingerprint")
CreateFlow(suite.flowName, t)
@@ -86,9 +86,9 @@ func (suite *ApprovalReportTestSuite) TestApprovalReportCmd() {
}
for _, t := range tests {
if t.additionalConfig != nil && t.additionalConfig.(reportApprovalTestConfig).createSnapshot {
- ReportServerArtifactToEnv([]string{suite.artifactPath}, suite.envName, suite.Suite.T())
+ ReportServerArtifactToEnv([]string{suite.artifactPath}, suite.envName, suite.T())
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{t})
+ runTestCmd(suite.T(), []cmdTestCase{t})
}
}
diff --git a/cmd/kosli/reportEvidenceArtifactGeneric.go b/cmd/kosli/reportEvidenceArtifactGeneric.go
index 33071705a..89fd92fc0 100644
--- a/cmd/kosli/reportEvidenceArtifactGeneric.go
+++ b/cmd/kosli/reportEvidenceArtifactGeneric.go
@@ -141,7 +141,11 @@ func (o *reportEvidenceArtifactGenericOptions) run(args []string) error {
form, cleanupNeeded, evidencePath, err := newEvidenceForm(o.payload, o.evidencePaths)
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
if err != nil {
diff --git a/cmd/kosli/reportEvidenceArtifactGeneric_test.go b/cmd/kosli/reportEvidenceArtifactGeneric_test.go
index 17eaa06e5..ff6f408e7 100644
--- a/cmd/kosli/reportEvidenceArtifactGeneric_test.go
+++ b/cmd/kosli/reportEvidenceArtifactGeneric_test.go
@@ -31,7 +31,7 @@ func (suite *ArtifactEvidenceGenericCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- t := suite.Suite.T()
+ t := suite.T()
CreateFlow(suite.flowName, t)
CreateArtifact(suite.flowName, suite.artifactFingerprint, "FooBar_1", t)
@@ -47,7 +47,7 @@ func (suite *ArtifactEvidenceGenericCommandTestSuite) SetupTest() {
--flow ` + suite.flowName + ` --build-url https://www.yr.no --commit-url https://www.nrk.no --repo-root ../..` + suite.defaultKosliArguments,
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
func (suite *ArtifactEvidenceGenericCommandTestSuite) TestArtifactEvidenceGenericCommandCmd() {
@@ -145,7 +145,7 @@ func (suite *ArtifactEvidenceGenericCommandTestSuite) TestArtifactEvidenceGeneri
evidenceName, suite.flowName, suite.defaultKosliArguments),
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceArtifactJUnit_test.go b/cmd/kosli/reportEvidenceArtifactJUnit_test.go
index 931222f38..e80c07078 100644
--- a/cmd/kosli/reportEvidenceArtifactJUnit_test.go
+++ b/cmd/kosli/reportEvidenceArtifactJUnit_test.go
@@ -27,8 +27,8 @@ func (suite *ArtifactEvidenceJUnitCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
- CreateArtifact(suite.flowName, suite.artifactFingerprint, "FooBar_1", suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
+ CreateArtifact(suite.flowName, suite.artifactFingerprint, "FooBar_1", suite.T())
}
func (suite *ArtifactEvidenceJUnitCommandTestSuite) TestArtifactEvidenceJUnitCommandCmd() {
@@ -87,7 +87,7 @@ func (suite *ArtifactEvidenceJUnitCommandTestSuite) TestArtifactEvidenceJUnitCom
goldenRegex: "Error: required flag\\(s\\) \"flow\" not set\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceArtifactJunit.go b/cmd/kosli/reportEvidenceArtifactJunit.go
index 7963e6479..37a92d23c 100644
--- a/cmd/kosli/reportEvidenceArtifactJunit.go
+++ b/cmd/kosli/reportEvidenceArtifactJunit.go
@@ -138,7 +138,11 @@ func (o *reportEvidenceArtifactJunitOptions) run(args []string) error {
form, cleanupNeeded, evidencePath, err := newEvidenceForm(o.payload, junitFilenames)
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
if err != nil {
diff --git a/cmd/kosli/reportEvidenceArtifactPRAzure_test.go b/cmd/kosli/reportEvidenceArtifactPRAzure_test.go
index dbb5dde66..c1f3aac9c 100644
--- a/cmd/kosli/reportEvidenceArtifactPRAzure_test.go
+++ b/cmd/kosli/reportEvidenceArtifactPRAzure_test.go
@@ -19,7 +19,7 @@ type ArtifactEvidencePRAzureCommandTestSuite struct {
}
func (suite *ArtifactEvidencePRAzureCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_AZURE_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_AZURE_TOKEN"})
suite.flowName = "azure-pr"
suite.artifactFingerprint = "847411c6124e719a4e8da2550ac5c116b7ff930493ce8a061486b48db8a5aaa0"
@@ -30,8 +30,8 @@ func (suite *ArtifactEvidencePRAzureCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
- CreateArtifact(suite.flowName, suite.artifactFingerprint, "foobar", suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
+ CreateArtifact(suite.flowName, suite.artifactFingerprint, "foobar", suite.T())
}
func (suite *ArtifactEvidencePRAzureCommandTestSuite) TestArtifactEvidencePRAzureCmd() {
@@ -144,7 +144,7 @@ func (suite *ArtifactEvidencePRAzureCommandTestSuite) TestArtifactEvidencePRAzur
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceArtifactPRBitbucket_test.go b/cmd/kosli/reportEvidenceArtifactPRBitbucket_test.go
index cc28634b8..6c7348796 100644
--- a/cmd/kosli/reportEvidenceArtifactPRBitbucket_test.go
+++ b/cmd/kosli/reportEvidenceArtifactPRBitbucket_test.go
@@ -19,7 +19,7 @@ type ArtifactEvidencePRBitbucketCommandTestSuite struct {
}
func (suite *ArtifactEvidencePRBitbucketCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_BITBUCKET_ACCESS_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_BITBUCKET_ACCESS_TOKEN"})
suite.flowName = "bitbucket-pr"
suite.artifactFingerprint = "847411c6124e719a4e8da2550ac5c116b7ff930493ce8a061486b48db8a5aaa0"
@@ -30,8 +30,8 @@ func (suite *ArtifactEvidencePRBitbucketCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
- CreateArtifact(suite.flowName, suite.artifactFingerprint, "foobar", suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
+ CreateArtifact(suite.flowName, suite.artifactFingerprint, "foobar", suite.T())
}
func (suite *ArtifactEvidencePRBitbucketCommandTestSuite) TestArtifactEvidencePRBitbucketCmd() {
@@ -131,7 +131,7 @@ func (suite *ArtifactEvidencePRBitbucketCommandTestSuite) TestArtifactEvidencePR
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceArtifactPRGithub_test.go b/cmd/kosli/reportEvidenceArtifactPRGithub_test.go
index 2cfd77a99..e21dcac08 100644
--- a/cmd/kosli/reportEvidenceArtifactPRGithub_test.go
+++ b/cmd/kosli/reportEvidenceArtifactPRGithub_test.go
@@ -20,7 +20,7 @@ type ArtifactEvidencePRGithubCommandTestSuite struct {
}
func (suite *ArtifactEvidencePRGithubCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
suite.flowName = "github-pr"
suite.artifactFingerprint = "847411c6124e719a4e8da2550ac5c116b7ff930493ce8a061486b48db8a5aaa0"
@@ -32,8 +32,8 @@ func (suite *ArtifactEvidencePRGithubCommandTestSuite) SetupTest() {
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
suite.commitWithPR = testHelpers.GithubCommitWithPR()
- CreateFlow(suite.flowName, suite.Suite.T())
- CreateArtifact(suite.flowName, suite.artifactFingerprint, "foobar", suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
+ CreateArtifact(suite.flowName, suite.artifactFingerprint, "foobar", suite.T())
}
func (suite *ArtifactEvidencePRGithubCommandTestSuite) TestArtifactEvidencePRGithubCmd() {
@@ -141,7 +141,7 @@ func (suite *ArtifactEvidencePRGithubCommandTestSuite) TestArtifactEvidencePRGit
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceArtifactPRGitlab_test.go b/cmd/kosli/reportEvidenceArtifactPRGitlab_test.go
index 32ccfa345..56a3be0d6 100644
--- a/cmd/kosli/reportEvidenceArtifactPRGitlab_test.go
+++ b/cmd/kosli/reportEvidenceArtifactPRGitlab_test.go
@@ -19,7 +19,7 @@ type ArtifactEvidencePRGitlabCommandTestSuite struct {
}
func (suite *ArtifactEvidencePRGitlabCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
suite.flowName = "gitlab-pr"
suite.artifactFingerprint = "847411c6124e719a4e8da2550ac5c116b7ff930493ce8a061486b48db8a5aaa0"
@@ -30,8 +30,8 @@ func (suite *ArtifactEvidencePRGitlabCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
- CreateArtifact(suite.flowName, suite.artifactFingerprint, "foobar", suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
+ CreateArtifact(suite.flowName, suite.artifactFingerprint, "foobar", suite.T())
}
func (suite *ArtifactEvidencePRGitlabCommandTestSuite) TestArtifactEvidencePRGitlabCmd() {
@@ -139,7 +139,7 @@ func (suite *ArtifactEvidencePRGitlabCommandTestSuite) TestArtifactEvidencePRGit
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceArtifactSnyk.go b/cmd/kosli/reportEvidenceArtifactSnyk.go
index 91f6a8a22..25c9c41ac 100644
--- a/cmd/kosli/reportEvidenceArtifactSnyk.go
+++ b/cmd/kosli/reportEvidenceArtifactSnyk.go
@@ -139,7 +139,11 @@ func (o *reportEvidenceArtifactSnykOptions) run(args []string) error {
form, cleanupNeeded, evidencePath, err := newEvidenceForm(o.payload, attachments)
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
if err != nil {
diff --git a/cmd/kosli/reportEvidenceArtifactSnyk_test.go b/cmd/kosli/reportEvidenceArtifactSnyk_test.go
index a30c13ceb..8045c6759 100644
--- a/cmd/kosli/reportEvidenceArtifactSnyk_test.go
+++ b/cmd/kosli/reportEvidenceArtifactSnyk_test.go
@@ -28,8 +28,8 @@ func (suite *ArtifactEvidenceSnykCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
- CreateArtifact(suite.flowName, suite.artifactFingerprint, "FooBar_1", suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
+ CreateArtifact(suite.flowName, suite.artifactFingerprint, "FooBar_1", suite.T())
}
func (suite *ArtifactEvidenceSnykCommandTestSuite) TestArtifactEvidenceSnykCmd() {
@@ -101,7 +101,7 @@ func (suite *ArtifactEvidenceSnykCommandTestSuite) TestArtifactEvidenceSnykCmd()
goldenRegex: "snyk scan evidence is reported to artifact: " + suite.artifactFingerprint + "\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceCommitGeneric.go b/cmd/kosli/reportEvidenceCommitGeneric.go
index 39cc9232c..df52e0a37 100644
--- a/cmd/kosli/reportEvidenceCommitGeneric.go
+++ b/cmd/kosli/reportEvidenceCommitGeneric.go
@@ -93,7 +93,11 @@ func (o *reportEvidenceCommitGenericOptions) run(args []string) error {
form, cleanupNeeded, evidencePath, err := newEvidenceForm(o.payload, o.evidencePaths)
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
if err != nil {
diff --git a/cmd/kosli/reportEvidenceCommitGeneric_test.go b/cmd/kosli/reportEvidenceCommitGeneric_test.go
index e92b7659d..36c10327f 100644
--- a/cmd/kosli/reportEvidenceCommitGeneric_test.go
+++ b/cmd/kosli/reportEvidenceCommitGeneric_test.go
@@ -27,7 +27,7 @@ func (suite *CommitEvidenceGenericCommandTestSuite) SetupTest() {
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowNames, suite.Suite.T())
+ CreateFlow(suite.flowNames, suite.T())
}
func (suite *CommitEvidenceGenericCommandTestSuite) TestCommitEvidenceGenericCommandCmd() {
@@ -133,7 +133,7 @@ func (suite *CommitEvidenceGenericCommandTestSuite) TestCommitEvidenceGenericCom
goldenRegex: "Error: open non-existing-file: no such file or directory\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceCommitJUnit.go b/cmd/kosli/reportEvidenceCommitJUnit.go
index 5a918faba..4c36d5bc4 100644
--- a/cmd/kosli/reportEvidenceCommitJUnit.go
+++ b/cmd/kosli/reportEvidenceCommitJUnit.go
@@ -102,7 +102,11 @@ func (o *reportEvidenceCommitJunitOptions) run(args []string) error {
form, cleanupNeeded, evidencePath, err := newEvidenceForm(o.payload, junitFilenames)
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
if err != nil {
diff --git a/cmd/kosli/reportEvidenceCommitJUnit_test.go b/cmd/kosli/reportEvidenceCommitJUnit_test.go
index 11591f1d5..043c51b97 100644
--- a/cmd/kosli/reportEvidenceCommitJUnit_test.go
+++ b/cmd/kosli/reportEvidenceCommitJUnit_test.go
@@ -27,7 +27,7 @@ func (suite *CommitEvidenceJUnitCommandTestSuite) SetupTest() {
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowNames, suite.Suite.T())
+ CreateFlow(suite.flowNames, suite.T())
}
func (suite *CommitEvidenceJUnitCommandTestSuite) TestCommitEvidenceJUnitCommandCmd() {
@@ -87,7 +87,7 @@ func (suite *CommitEvidenceJUnitCommandTestSuite) TestCommitEvidenceJUnitCommand
goldenRegex: "Error: required flag\\(s\\) \"commit\" not set\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceCommitJira.go b/cmd/kosli/reportEvidenceCommitJira.go
index 0042d7997..f969da4a3 100644
--- a/cmd/kosli/reportEvidenceCommitJira.go
+++ b/cmd/kosli/reportEvidenceCommitJira.go
@@ -201,7 +201,11 @@ func (o *reportEvidenceCommitJiraOptions) run(args []string) error {
form, cleanupNeeded, evidencePath, err := newEvidenceForm(o.payload, o.evidencePaths)
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
if err != nil {
diff --git a/cmd/kosli/reportEvidenceCommitJira_test.go b/cmd/kosli/reportEvidenceCommitJira_test.go
index 670d62b69..f296b3d35 100644
--- a/cmd/kosli/reportEvidenceCommitJira_test.go
+++ b/cmd/kosli/reportEvidenceCommitJira_test.go
@@ -25,7 +25,7 @@ type CommitEvidenceJiraCommandTestSuite struct {
}
func (suite *CommitEvidenceJiraCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_JIRA_API_TOKEN", "KOSLI_JIRA_USERNAME"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_JIRA_API_TOKEN", "KOSLI_JIRA_USERNAME"})
global = &GlobalOpts{
ApiToken: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNkNzg4OTg5In0.e8i_lA_QrEhFncb05Xw6E_tkCHU9QfcY4OLTVUCHffY",
Org: "docs-cmd-test-user-shared",
@@ -36,16 +36,17 @@ func (suite *CommitEvidenceJiraCommandTestSuite) SetupTest() {
global.Host, global.Org, global.ApiToken)
var err error
suite.tmpDir, err = os.MkdirTemp("", "testDir")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
_, suite.workTree, suite.fs, err = testHelpers.InitializeGitRepo(suite.tmpDir)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
suite.flowName = "flow-for-jira-testing"
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
}
func (suite *CommitEvidenceJiraCommandTestSuite) TearDownSuite() {
- os.RemoveAll(suite.tmpDir)
+ err := os.RemoveAll(suite.tmpDir)
+ require.NoError(suite.T(), err, "failed to remove temp dir %s", suite.tmpDir)
}
type jiraTestsAdditionalConfig struct {
@@ -202,17 +203,17 @@ func funcName(test cmdTestCase, suite *CommitEvidenceJiraCommandTestSuite) {
branchName := test.additionalConfig.(jiraTestsAdditionalConfig).branchName
if branchName != "" {
err := testHelpers.CheckoutNewBranch(suite.workTree, branchName)
- require.NoError(suite.Suite.T(), err)
- defer testHelpers.CheckoutMaster(suite.workTree, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ defer testHelpers.CheckoutMaster(suite.workTree, suite.T())
}
msg := test.additionalConfig.(jiraTestsAdditionalConfig).commitMessage
commitSha, err := testHelpers.CommitToRepo(suite.workTree, suite.fs, msg)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
test.cmd = test.cmd + " --commit " + commitSha
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{test})
+ runTestCmd(suite.T(), []cmdTestCase{test})
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceCommitPRAzure_test.go b/cmd/kosli/reportEvidenceCommitPRAzure_test.go
index 0dcbe6c77..3c06d71cc 100644
--- a/cmd/kosli/reportEvidenceCommitPRAzure_test.go
+++ b/cmd/kosli/reportEvidenceCommitPRAzure_test.go
@@ -18,7 +18,7 @@ type CommitEvidencePRAzureCommandTestSuite struct {
}
func (suite *CommitEvidencePRAzureCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_AZURE_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_AZURE_TOKEN"})
suite.flowNames = "azure-pr"
global = &GlobalOpts{
@@ -28,7 +28,7 @@ func (suite *CommitEvidencePRAzureCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowNames, suite.Suite.T())
+ CreateFlow(suite.flowNames, suite.T())
}
func (suite *CommitEvidencePRAzureCommandTestSuite) TestCommitEvidencePRAzureCmd() {
@@ -112,7 +112,7 @@ func (suite *CommitEvidencePRAzureCommandTestSuite) TestCommitEvidencePRAzureCmd
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceCommitPRBitbucket_test.go b/cmd/kosli/reportEvidenceCommitPRBitbucket_test.go
index 2074c0458..28e36a308 100644
--- a/cmd/kosli/reportEvidenceCommitPRBitbucket_test.go
+++ b/cmd/kosli/reportEvidenceCommitPRBitbucket_test.go
@@ -18,7 +18,7 @@ type CommitEvidencePRBitbucketCommandTestSuite struct {
}
func (suite *CommitEvidencePRBitbucketCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_BITBUCKET_ACCESS_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_BITBUCKET_ACCESS_TOKEN"})
suite.flowNames = "bitbucket-pr"
global = &GlobalOpts{
@@ -28,7 +28,7 @@ func (suite *CommitEvidencePRBitbucketCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowNames, suite.Suite.T())
+ CreateFlow(suite.flowNames, suite.T())
}
func (suite *CommitEvidencePRBitbucketCommandTestSuite) TestCommitEvidencePRBitbucketCmd() {
@@ -100,7 +100,7 @@ func (suite *CommitEvidencePRBitbucketCommandTestSuite) TestCommitEvidencePRBitb
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceCommitPRGithub_test.go b/cmd/kosli/reportEvidenceCommitPRGithub_test.go
index a13ccf206..81ddeebf0 100644
--- a/cmd/kosli/reportEvidenceCommitPRGithub_test.go
+++ b/cmd/kosli/reportEvidenceCommitPRGithub_test.go
@@ -19,7 +19,7 @@ type CommitEvidencePRGithubCommandTestSuite struct {
}
func (suite *CommitEvidencePRGithubCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
suite.flowNames = "github-pr"
global = &GlobalOpts{
@@ -30,7 +30,7 @@ func (suite *CommitEvidencePRGithubCommandTestSuite) SetupTest() {
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
suite.commitWithPR = testHelpers.GithubCommitWithPR()
- CreateFlow(suite.flowNames, suite.Suite.T())
+ CreateFlow(suite.flowNames, suite.T())
}
func (suite *CommitEvidencePRGithubCommandTestSuite) TestCommitEvidencePRGithubCmd() {
@@ -114,7 +114,7 @@ func (suite *CommitEvidencePRGithubCommandTestSuite) TestCommitEvidencePRGithubC
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceCommitPRGitlab_test.go b/cmd/kosli/reportEvidenceCommitPRGitlab_test.go
index 94b37476d..3b91e39ef 100644
--- a/cmd/kosli/reportEvidenceCommitPRGitlab_test.go
+++ b/cmd/kosli/reportEvidenceCommitPRGitlab_test.go
@@ -18,7 +18,7 @@ type CommitEvidencePRGitlabCommandTestSuite struct {
}
func (suite *CommitEvidencePRGitlabCommandTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
suite.flowName = "gitlab-pr"
global = &GlobalOpts{
@@ -28,7 +28,7 @@ func (suite *CommitEvidencePRGitlabCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
}
func (suite *CommitEvidencePRGitlabCommandTestSuite) TestCommitEvidencePRGitlabCmd() {
@@ -107,7 +107,7 @@ func (suite *CommitEvidencePRGitlabCommandTestSuite) TestCommitEvidencePRGitlabC
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/reportEvidenceCommitSnyk.go b/cmd/kosli/reportEvidenceCommitSnyk.go
index 8671341c5..e3393ad83 100644
--- a/cmd/kosli/reportEvidenceCommitSnyk.go
+++ b/cmd/kosli/reportEvidenceCommitSnyk.go
@@ -116,7 +116,11 @@ func (o *reportEvidenceCommitSnykOptions) run(args []string) error {
form, cleanupNeeded, evidencePath, err := newEvidenceForm(o.payload, attachments)
// if we created a tar package, remove it after uploading it
if cleanupNeeded {
- defer os.Remove(evidencePath)
+ defer func() {
+ if err := os.Remove(evidencePath); err != nil {
+ logger.Warn("failed to remove evidence file %s: %v", evidencePath, err)
+ }
+ }()
}
if err != nil {
diff --git a/cmd/kosli/reportEvidenceCommitSnyk_test.go b/cmd/kosli/reportEvidenceCommitSnyk_test.go
index bd78f7566..aaaab09a5 100644
--- a/cmd/kosli/reportEvidenceCommitSnyk_test.go
+++ b/cmd/kosli/reportEvidenceCommitSnyk_test.go
@@ -25,7 +25,7 @@ func (suite *CommitEvidenceSnykCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
}
func (suite *CommitEvidenceSnykCommandTestSuite) TestCommitEvidenceSnykCmd() {
@@ -90,7 +90,7 @@ func (suite *CommitEvidenceSnykCommandTestSuite) TestCommitEvidenceSnykCmd() {
goldenRegex: "snyk scan evidence is reported to commit: 239d7cee00ca341f124fa710fc694b67cdf8011b\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/root_test.go b/cmd/kosli/root_test.go
index 1f5a09ab9..aa65f130b 100644
--- a/cmd/kosli/root_test.go
+++ b/cmd/kosli/root_test.go
@@ -22,7 +22,7 @@ func (suite *RootCommandTestSuite) TestConfigProcessing() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/search.go b/cmd/kosli/search.go
index 9023a309b..9390e4343 100644
--- a/cmd/kosli/search.go
+++ b/cmd/kosli/search.go
@@ -130,11 +130,12 @@ func printSearchAsTableWrapper(responseRaw string, out io.Writer, pageNumber int
countFingerprints := searchResult.ResolvedTo.Fingerprints.Count
countCommits := searchResult.ResolvedTo.Commits.Count
fullMatch := searchResult.ResolvedTo.FullMatch
- if searchResult.ResolvedTo.Type == "commit" {
+ switch searchResult.ResolvedTo.Type {
+ case "commit":
logger.Info("Search result resolved to commit %s", fullMatch)
- } else if searchResult.ResolvedTo.Type == "fingerprint" {
+ case "fingerprint":
logger.Info("Search result resolved to artifact with fingerprint %s", fullMatch)
- } else {
+ default:
logger.Info("Search result resolved to %d fingerprint(s) and %d commit(s) across %d artifacts\n", countFingerprints, countCommits, len(searchResult.Artifacts))
}
diff --git a/cmd/kosli/search_test.go b/cmd/kosli/search_test.go
index 648cc4cdf..636050f83 100644
--- a/cmd/kosli/search_test.go
+++ b/cmd/kosli/search_test.go
@@ -31,14 +31,14 @@ func (suite *SearchCommandTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
fingerprintOptions := &fingerprintOptions{
artifactType: "file",
}
var err error
suite.fingerprint, err = GetSha256Digest(suite.artifactPath, fingerprintOptions, logger)
- require.NoError(suite.Suite.T(), err)
- CreateArtifact(suite.flowName, suite.fingerprint, suite.artifactName, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ CreateArtifact(suite.flowName, suite.fingerprint, suite.artifactName, suite.T())
}
func (suite *SearchCommandTestSuite) TestSearchCmd() {
@@ -95,7 +95,7 @@ func (suite *SearchCommandTestSuite) TestSearchCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/snapshotAzureApps_test.go b/cmd/kosli/snapshotAzureApps_test.go
index 7017d9f78..a4ca1a5c8 100644
--- a/cmd/kosli/snapshotAzureApps_test.go
+++ b/cmd/kosli/snapshotAzureApps_test.go
@@ -20,7 +20,7 @@ type SnapshotAzureAppsTestSuite struct {
}
func (suite *SnapshotAzureAppsTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{
"INTEGRATION_TEST_AZURE_CLIENT_SECRET",
"INTEGRATION_TEST_AZURE_CLIENT_ID",
})
@@ -45,7 +45,7 @@ func (suite *SnapshotAzureAppsTestSuite) SetupTest() {
azureClientSecret, azureClientID, azureTenantID, azureSubscriptionID, azureResourceGroupName,
)
- CreateEnv(global.Org, suite.envName, "azure-apps", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "azure-apps", suite.T())
}
func (suite *SnapshotAzureAppsTestSuite) TestSnapshotAzureAppsCmd() {
@@ -112,7 +112,7 @@ func (suite *SnapshotAzureAppsTestSuite) TestSnapshotAzureAppsCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/snapshotDocker_test.go b/cmd/kosli/snapshotDocker_test.go
index 5c7c0da0b..8f89c2eb6 100644
--- a/cmd/kosli/snapshotDocker_test.go
+++ b/cmd/kosli/snapshotDocker_test.go
@@ -22,13 +22,13 @@ type SnapshotDockerTestSuite struct {
func (suite *SnapshotDockerTestSuite) SetupSuite() {
suite.imageName = "library/alpine@sha256:e15947432b813e8ffa90165da919953e2ce850bef511a0ad1287d7cb86de84b5"
err := docker.PullDockerImage(suite.imageName)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
func (suite *SnapshotDockerTestSuite) TearDownSuite() {
for _, id := range suite.createdContainerIDs {
err := docker.RemoveDockerContainer(id)
- require.NoError(suite.Suite.T(), err, fmt.Sprintf("RemoveDockerContainer: %s", id))
+ require.NoError(suite.T(), err, fmt.Sprintf("RemoveDockerContainer: %s", id))
}
}
@@ -44,23 +44,23 @@ func (suite *SnapshotDockerTestSuite) TestCreateDockerArtifactsData() {
expectedSha256: "e15947432b813e8ffa90165da919953e2ce850bef511a0ad1287d7cb86de84b5",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
suite.withRunningContainer(t.imageName)
- assert.Contains(suite.Suite.T(), suite.containerDigests(), t.expectedSha256)
+ assert.Contains(suite.T(), suite.containerDigests(), t.expectedSha256)
})
}
}
func (suite *SnapshotDockerTestSuite) withRunningContainer(imageName string) {
containerID, err := docker.RunDockerContainer(imageName)
- require.NoError(suite.Suite.T(), err, fmt.Sprintf("RunDockerContainer for %s", imageName))
+ require.NoError(suite.T(), err, fmt.Sprintf("RunDockerContainer for %s", imageName))
suite.createdContainerIDs = append(suite.createdContainerIDs, containerID)
}
func (suite *SnapshotDockerTestSuite) containerDigests() []string {
data, err := CreateDockerArtifactsData()
- require.NoError(suite.Suite.T(), err, "CreateDockerArtifactsData")
+ require.NoError(suite.T(), err, "CreateDockerArtifactsData")
var actualDigests []string
for _, item := range data {
diff --git a/cmd/kosli/snapshotECS_test.go b/cmd/kosli/snapshotECS_test.go
index 4b360f74d..415f335b0 100644
--- a/cmd/kosli/snapshotECS_test.go
+++ b/cmd/kosli/snapshotECS_test.go
@@ -30,7 +30,7 @@ func (suite *SnapshotECSTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "ECS", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "ECS", suite.T())
}
func (suite *SnapshotECSTestSuite) TestSnapshotECSCmd() {
@@ -123,9 +123,9 @@ func (suite *SnapshotECSTestSuite) TestSnapshotECSCmd() {
for _, t := range tests {
if t.additionalConfig != nil && t.additionalConfig.(snapshotECSTestConfig).requireAuthToBeSet {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"})
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{t})
+ runTestCmd(suite.T(), []cmdTestCase{t})
}
}
diff --git a/cmd/kosli/snapshotK8S_test.go b/cmd/kosli/snapshotK8S_test.go
index 5ec1d32a2..1f0190bac 100644
--- a/cmd/kosli/snapshotK8S_test.go
+++ b/cmd/kosli/snapshotK8S_test.go
@@ -25,7 +25,7 @@ func (suite *SnapshotK8STestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "K8S", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "K8S", suite.T())
}
func (suite *SnapshotK8STestSuite) TestSnapshotK8SCmd() {
@@ -50,7 +50,7 @@ func (suite *SnapshotK8STestSuite) TestSnapshotK8SCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/snapshotLambda_test.go b/cmd/kosli/snapshotLambda_test.go
index a609f82ae..de3b3a65f 100644
--- a/cmd/kosli/snapshotLambda_test.go
+++ b/cmd/kosli/snapshotLambda_test.go
@@ -34,7 +34,7 @@ func (suite *SnapshotLambdaTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "lambda", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "lambda", suite.T())
}
func (suite *SnapshotLambdaTestSuite) TestSnapshotLambdaCmd() {
@@ -133,9 +133,9 @@ func (suite *SnapshotLambdaTestSuite) TestSnapshotLambdaCmd() {
for _, t := range tests {
if t.additionalConfig != nil && t.additionalConfig.(snapshotLambdaTestConfig).requireAuthToBeSet {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"})
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{t})
+ runTestCmd(suite.T(), []cmdTestCase{t})
}
}
diff --git a/cmd/kosli/snapshotPath_test.go b/cmd/kosli/snapshotPath_test.go
index c7affbd74..f5805c01b 100644
--- a/cmd/kosli/snapshotPath_test.go
+++ b/cmd/kosli/snapshotPath_test.go
@@ -25,7 +25,7 @@ func (suite *SnapshotPathTestSuite) SetupSuite() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
}
func (suite *SnapshotPathTestSuite) TestSnapshotPathCmd() {
@@ -60,7 +60,7 @@ func (suite *SnapshotPathTestSuite) TestSnapshotPathCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
diff --git a/cmd/kosli/snapshotPaths_test.go b/cmd/kosli/snapshotPaths_test.go
index d1cd472c6..9810a4b92 100644
--- a/cmd/kosli/snapshotPaths_test.go
+++ b/cmd/kosli/snapshotPaths_test.go
@@ -25,7 +25,7 @@ func (suite *SnapshotPathsTestSuite) SetupSuite() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
}
func (suite *SnapshotPathsTestSuite) TestSnapshotPathsCmd() {
@@ -65,7 +65,7 @@ func (suite *SnapshotPathsTestSuite) TestSnapshotPathsCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
diff --git a/cmd/kosli/snapshotS3_test.go b/cmd/kosli/snapshotS3_test.go
index de945b4eb..0c8f01182 100644
--- a/cmd/kosli/snapshotS3_test.go
+++ b/cmd/kosli/snapshotS3_test.go
@@ -32,7 +32,7 @@ func (suite *SnapshotS3TestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "S3", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "S3", suite.T())
}
func (suite *SnapshotS3TestSuite) TestSnapshotS3Cmd() {
@@ -92,9 +92,9 @@ func (suite *SnapshotS3TestSuite) TestSnapshotS3Cmd() {
for _, t := range tests {
if t.additionalConfig != nil && t.additionalConfig.(snapshotS3TestConfig).requireAuthToBeSet {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"})
}
- runTestCmd(suite.Suite.T(), []cmdTestCase{t})
+ runTestCmd(suite.T(), []cmdTestCase{t})
}
}
diff --git a/cmd/kosli/snapshotServer_test.go b/cmd/kosli/snapshotServer_test.go
index 929903b9c..b7aee5f2e 100644
--- a/cmd/kosli/snapshotServer_test.go
+++ b/cmd/kosli/snapshotServer_test.go
@@ -25,7 +25,7 @@ func (suite *SnapshotServerTestSuite) SetupSuite() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateEnv(global.Org, suite.envName, "server", suite.Suite.T())
+ CreateEnv(global.Org, suite.envName, "server", suite.T())
}
func (suite *SnapshotServerTestSuite) TestSnapshotServerCmd() {
@@ -62,7 +62,7 @@ func (suite *SnapshotServerTestSuite) TestSnapshotServerCmd() {
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
diff --git a/cmd/kosli/status_test.go b/cmd/kosli/status_test.go
index cfc45daa8..642c86e80 100644
--- a/cmd/kosli/status_test.go
+++ b/cmd/kosli/status_test.go
@@ -26,7 +26,7 @@ func (suite *StatusTestSuite) TestStatusCmd() {
wantError: true,
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/tag_test.go b/cmd/kosli/tag_test.go
index cebb762e9..9e3962236 100644
--- a/cmd/kosli/tag_test.go
+++ b/cmd/kosli/tag_test.go
@@ -29,8 +29,8 @@ func (suite *TagTestSuite) SetupTest() {
}
suite.defaultKosliArguments = fmt.Sprintf(" --host %s --org %s --api-token %s", global.Host, global.Org, global.ApiToken)
- CreateFlow(suite.flowName, suite.Suite.T())
- CreateEnv(global.Org, suite.envName, suite.envType, suite.Suite.T())
+ CreateFlow(suite.flowName, suite.T())
+ CreateEnv(global.Org, suite.envName, suite.envType, suite.T())
}
func (suite *TagTestSuite) TestTagCmd() {
@@ -66,7 +66,7 @@ func (suite *TagTestSuite) TestTagCmd() {
golden: "Tag(s) [foo] added for flow 'tag-flow'\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/cmd/kosli/testHelpers.go b/cmd/kosli/testHelpers.go
index 3f914b905..c1e25fd40 100644
--- a/cmd/kosli/testHelpers.go
+++ b/cmd/kosli/testHelpers.go
@@ -199,7 +199,12 @@ func compareAgainstFile(actual []byte, filename string) error {
if err != nil {
return errors.Wrapf(err, "unable to read golden file %s", filename)
}
- defer expectedFile.Close()
+ defer func() {
+ if err := expectedFile.Close(); err != nil {
+ // Log warning but don't fail the test for cleanup errors
+ logger.Warn("failed to close file %s: %v", filename, err)
+ }
+ }()
// Scanner to read the expected file line by line
expectedScanner := bufio.NewScanner(expectedFile)
@@ -269,7 +274,7 @@ func compareFileBytes(actual, expected []byte) error {
}
func normalize(in []byte) []byte {
- normalized := bytes.Replace(in, []byte("\r\n"), []byte("\n"), -1)
+ normalized := bytes.ReplaceAll(in, []byte("\r\n"), []byte("\n"))
return []byte(strings.TrimSpace(string(normalized)))
}
diff --git a/cmd/kosli/version_test.go b/cmd/kosli/version_test.go
index c39663795..52b272427 100644
--- a/cmd/kosli/version_test.go
+++ b/cmd/kosli/version_test.go
@@ -27,7 +27,7 @@ func (suite *VersionTestSuite) TestVersionCmd() {
golden: "main\n",
},
}
- runTestCmd(suite.Suite.T(), tests)
+ runTestCmd(suite.T(), tests)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/go.mod b/go.mod
index f12b2cdae..c32f6f560 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/kosli-dev/cli
-go 1.24.4
+go 1.25.0
require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0
@@ -33,34 +33,34 @@ require (
github.com/pkg/errors v0.9.1
github.com/rjeczalik/notify v0.9.3
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466
- github.com/spf13/cobra v1.9.1
- github.com/spf13/pflag v1.0.6
+ github.com/spf13/cobra v1.10.0
+ github.com/spf13/pflag v1.0.9
github.com/spf13/viper v1.20.1
- github.com/stretchr/testify v1.10.0
+ github.com/stretchr/testify v1.11.1
github.com/xeonx/timeago v1.0.0-rc5
github.com/yargevad/filepathx v1.0.0
github.com/zalando/go-keyring v0.2.6
gitlab.com/gitlab-org/api/client-go v0.127.0
- golang.org/x/oauth2 v0.29.0
- k8s.io/api v0.32.3
- k8s.io/apimachinery v0.32.3
+ golang.org/x/oauth2 v0.30.0
+ k8s.io/api v0.35.0
+ k8s.io/apimachinery v0.35.0
k8s.io/client-go v1.5.2
- k8s.io/kubernetes v1.31.6
+ k8s.io/kubernetes v1.35.0
sigs.k8s.io/kind v0.11.1
)
require (
al.essio.dev/pkg/shellescape v1.6.0 // indirect
+ cel.dev/expr v0.24.0 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
github.com/BurntSushi/toml v1.5.0 // indirect
+ github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
- github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/ProtonMail/go-crypto v1.2.0 // indirect
github.com/alessio/shellescape v1.4.2 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
- github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
@@ -82,10 +82,8 @@ require (
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
github.com/containers/ocicrypt v1.2.1 // indirect
github.com/containers/storage v1.57.2 // indirect
- github.com/coreos/go-semver v0.3.1 // indirect
- github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
- github.com/cyphar/filepath-securejoin v0.4.1 // indirect
+ github.com/cyphar/filepath-securejoin v0.6.0 // indirect
github.com/danieljoos/wincred v1.2.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
@@ -99,10 +97,10 @@ require (
github.com/fatih/structs v1.1.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
- github.com/fxamacker/cbor/v2 v2.8.0 // indirect
+ github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
- github.com/go-logr/logr v1.4.2 // indirect
+ github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
@@ -116,42 +114,37 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
- github.com/golang/protobuf v1.5.4 // indirect
- github.com/google/cel-go v0.20.1 // indirect
- github.com/google/gnostic-models v0.6.9 // indirect
+ github.com/google/cel-go v0.26.0 // indirect
+ github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
- github.com/google/gofuzz v1.2.0 // indirect
- github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
+ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
- github.com/gorilla/websocket v1.5.0 // indirect
- github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
+ github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
- github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
- github.com/klauspost/compress v1.17.11 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
- github.com/moby/spdystream v0.4.0 // indirect
+ github.com/moby/spdystream v0.5.0 // indirect
github.com/moby/sys/capability v0.4.0 // indirect
github.com/moby/sys/mountinfo v0.7.2 // indirect
github.com/moby/sys/user v0.4.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
- github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
- github.com/onsi/ginkgo/v2 v2.19.0 // indirect
- github.com/onsi/gomega v1.34.1 // indirect
+ github.com/onsi/ginkgo/v2 v2.27.2 // indirect
+ github.com/onsi/gomega v1.38.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/opencontainers/runtime-spec v1.2.1 // indirect
@@ -161,10 +154,11 @@ require (
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
- github.com/prometheus/client_golang v1.20.5 // indirect
- github.com/prometheus/client_model v0.6.1 // indirect
- github.com/prometheus/common v0.57.0 // indirect
- github.com/prometheus/procfs v0.15.1 // indirect
+ github.com/prometheus/client_golang v1.23.2 // indirect
+ github.com/prometheus/client_model v0.6.2 // indirect
+ github.com/prometheus/common v0.66.1 // indirect
+ github.com/prometheus/procfs v0.16.1 // indirect
+ github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.9.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
@@ -173,30 +167,28 @@ require (
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.14.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
- github.com/stoewer/go-strcase v1.2.0 // indirect
+ github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/trivago/tgo v1.0.7 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
- go.etcd.io/etcd/api/v3 v3.5.14 // indirect
- go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect
- go.etcd.io/etcd/client/v3 v3.5.14 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
- go.opentelemetry.io/otel v1.35.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
+ go.opentelemetry.io/otel v1.36.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 // indirect
- go.opentelemetry.io/otel/metric v1.35.0 // indirect
- go.opentelemetry.io/otel/sdk v1.35.0 // indirect
- go.opentelemetry.io/otel/trace v1.35.0 // indirect
- go.opentelemetry.io/proto/otlp v1.3.1 // indirect
+ go.opentelemetry.io/otel/metric v1.36.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.36.0 // indirect
+ go.opentelemetry.io/otel/trace v1.36.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.5.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.uber.org/zap v1.26.0 // indirect
+ go.yaml.in/yaml/v2 v2.4.3 // indirect
+ go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
+ golang.org/x/mod v0.29.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.38.0 // indirect
@@ -204,96 +196,94 @@ require (
golang.org/x/text v0.31.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/tools v0.38.0 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d // indirect
- google.golang.org/grpc v1.69.4 // indirect
- google.golang.org/protobuf v1.36.6 // indirect
- gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
+ google.golang.org/grpc v1.72.2 // indirect
+ google.golang.org/protobuf v1.36.8 // indirect
+ gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
- gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
- gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.0.0 // indirect
- k8s.io/apiserver v0.31.6 // indirect
- k8s.io/cloud-provider v0.0.0 // indirect
- k8s.io/component-base v0.31.6 // indirect
- k8s.io/component-helpers v0.31.6 // indirect
- k8s.io/controller-manager v0.31.6 // indirect
+ k8s.io/apiserver v0.35.0 // indirect
+ k8s.io/component-base v0.35.0 // indirect
+ k8s.io/component-helpers v0.35.0 // indirect
+ k8s.io/controller-manager v0.35.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
- k8s.io/kms v0.31.6 // indirect
- k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
+ k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
k8s.io/kubectl v0.0.0 // indirect
k8s.io/kubelet v0.0.0 // indirect
k8s.io/pod-security-admission v0.0.0 // indirect
- k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect
- sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect
- sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
+ k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
+ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
+ sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
- sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
- sigs.k8s.io/yaml v1.4.0 // indirect
+ sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
+ sigs.k8s.io/yaml v1.6.0 // indirect
)
-replace k8s.io/client-go => k8s.io/client-go v0.31.6
+replace k8s.io/client-go => k8s.io/client-go v0.35.0
-replace k8s.io/api => k8s.io/api v0.31.6
+replace k8s.io/api => k8s.io/api v0.35.0
-replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.31.6
+replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.35.0
-replace k8s.io/apimachinery => k8s.io/apimachinery v0.31.6
+replace k8s.io/apimachinery => k8s.io/apimachinery v0.35.0
-replace k8s.io/apiserver => k8s.io/apiserver v0.31.6
+replace k8s.io/apiserver => k8s.io/apiserver v0.35.0
-replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.31.6
+replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.35.0
-replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.31.6
+replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.35.0
-replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.31.6
+replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.35.0
-replace k8s.io/code-generator => k8s.io/code-generator v0.31.6
+replace k8s.io/code-generator => k8s.io/code-generator v0.35.0
-replace k8s.io/component-base => k8s.io/component-base v0.31.6
+replace k8s.io/component-base => k8s.io/component-base v0.35.0
-replace k8s.io/component-helpers => k8s.io/component-helpers v0.31.6
+replace k8s.io/component-helpers => k8s.io/component-helpers v0.35.0
-replace k8s.io/controller-manager => k8s.io/controller-manager v0.31.6
+replace k8s.io/controller-manager => k8s.io/controller-manager v0.35.0
-replace k8s.io/cri-api => k8s.io/cri-api v0.31.6
+replace k8s.io/cri-api => k8s.io/cri-api v0.35.0
-replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.31.6
+replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.35.0
-replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.31.6
+replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.35.0
-replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.31.6
+replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.35.0
-replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.31.6
+replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.35.0
-replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.31.6
+replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.35.0
-replace k8s.io/kubectl => k8s.io/kubectl v0.31.6
+replace k8s.io/kubectl => k8s.io/kubectl v0.35.0
-replace k8s.io/kubelet => k8s.io/kubelet v0.31.6
+replace k8s.io/kubelet => k8s.io/kubelet v0.35.0
replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.30.3
-replace k8s.io/metrics => k8s.io/metrics v0.31.6
+replace k8s.io/metrics => k8s.io/metrics v0.35.0
-replace k8s.io/mount-utils => k8s.io/mount-utils v0.31.6
+replace k8s.io/mount-utils => k8s.io/mount-utils v0.35.0
-replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.31.6
+replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.35.0
-replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.31.6
+replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.35.0
-replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.31.6
+replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.35.0
-replace k8s.io/sample-controller => k8s.io/sample-controller v0.31.6
+replace k8s.io/sample-controller => k8s.io/sample-controller v0.35.0
replace github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.2
-replace k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.31.6
+replace k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.35.0
-replace k8s.io/kms => k8s.io/kms v0.31.6
+replace k8s.io/kms => k8s.io/kms v0.35.0
-replace k8s.io/endpointslice => k8s.io/endpointslice v0.31.6
+replace k8s.io/endpointslice => k8s.io/endpointslice v0.35.0
-replace k8s.io/cri-client => k8s.io/cri-client v0.31.6
+replace k8s.io/cri-client => k8s.io/cri-client v0.35.0
+
+replace k8s.io/externaljwt => k8s.io/externaljwt v0.35.0
diff --git a/go.sum b/go.sum
index 4a05ea14b..dfb4ba9f1 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,7 @@
al.essio.dev/pkg/shellescape v1.6.0 h1:NxFcEqzFSEVCGN2yq7Huv/9hyCEGVa/TncnOOBBeXHA=
al.essio.dev/pkg/shellescape v1.6.0/go.mod h1:6sIqp7X2P6mThCQ7twERpZTuigpr6KbZWtls1U8I890=
+cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY=
+cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
@@ -27,8 +29,8 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 h1:FPKJS1T+clwv+OLGt13a8U
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v2 v2.3.0 h1:JI8PcWOImyvIUEZ0Bbmfe05FOlWkMi2KhjG+cAKaUms=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v2 v2.3.0/go.mod h1:nJLFPGJkyKfDDyJiPuHIXsCi/gpJkm07EvRgiX7SGlI=
-github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
-github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
+github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
+github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE=
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs=
@@ -37,11 +39,12 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
+github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
+github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
+github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
-github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
-github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/ProtonMail/go-crypto v1.2.0 h1:+PhXXn4SPGd+qk76TlEePBfOfivE0zkWFenhGhFLzWs=
@@ -63,9 +66,6 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
-github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
-github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
-github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM=
github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 h1:zAybnyUQXIZ5mok5Jqwlf58/TFE7uvd3IAsa1aF9cXs=
@@ -108,11 +108,14 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 h1:1XuUZ8mYJw9B6lzAkXhqHlJd/Xv
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19/go.mod h1:cQnB8CUnxbMU82JvlqjKR2HBOm3fe9pWorWBza6MBJ4=
github.com/aws/smithy-go v1.22.3 h1:Z//5NuZCSW6R4PhQ93hShNbyBbn8BWCmCVCt+Q8Io5k=
github.com/aws/smithy-go v1.22.3/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
+github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
+github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
+github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
@@ -121,6 +124,15 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
+github.com/charmbracelet/colorprofile v0.3.1/go.mod h1:/GkGusxNs8VB/RSOh3fu0TJmQ4ICMMPApIIVn0KszZ0=
+github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
+github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
+github.com/charmbracelet/x/ansi v0.9.2/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE=
+github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
+github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
+github.com/charmbracelet/x/exp/golden v0.0.0-20240806155701-69247e0abc2a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
+github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs=
github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
@@ -146,18 +158,14 @@ github.com/containers/storage v1.57.2/go.mod h1:i/Hb4lu7YgFr9G0K6BMjqW0BLJO1sFsn
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
-github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
-github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
-github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
-github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
-github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s=
-github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
+github.com/cyphar/filepath-securejoin v0.6.0 h1:BtGB77njd6SVO6VztOHfPxKitJvd/VPT+OFBFMOi1Is=
+github.com/cyphar/filepath-securejoin v0.6.0/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc=
github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0=
github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -184,11 +192,9 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
-github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
-github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o=
github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE=
-github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
+github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
@@ -208,12 +214,17 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
-github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
-github.com/fxamacker/cbor/v2 v2.8.0 h1:fFtUGXUzXPHTIUdne5+zzMPTfffl3RD5qYnkY40vtxU=
-github.com/fxamacker/cbor/v2 v2.8.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
+github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
+github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs=
+github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo=
+github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M=
+github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk=
+github.com/gkampitakis/go-snaps v0.5.15 h1:amyJrvM1D33cPHwVrjo9jQxX8g/7E2wYdZ+01KS3zGE=
+github.com/gkampitakis/go-snaps v0.5.15/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc=
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
@@ -234,13 +245,15 @@ github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
-github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
+github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
+github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
@@ -248,7 +261,7 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
-github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
+github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU=
github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
@@ -269,7 +282,8 @@ github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
-github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
+github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
+github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -305,13 +319,10 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
-github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
-github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
-github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84=
-github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg=
-github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
-github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw=
-github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw=
+github.com/google/cel-go v0.26.0 h1:DPGjXackMpJWH680oGY4lZhYjIameYmR+/6RBdDGmaI=
+github.com/google/cel-go v0.26.0/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM=
+github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
+github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
@@ -328,22 +339,20 @@ github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vK
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
-github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
-github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
-github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
+github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
+github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
+github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8=
+github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
@@ -352,18 +361,13 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
-github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
+github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo=
+github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
-github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
-github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
-github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
-github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
-github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
@@ -393,8 +397,6 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
-github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
-github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
@@ -402,8 +404,6 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
-github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
-github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE=
@@ -421,8 +421,8 @@ github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXw
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
-github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
+github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
+github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=
github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -440,10 +440,13 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+
github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
+github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
+github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
+github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
@@ -451,11 +454,14 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/maxcnunes/httpfake v1.2.4 h1:l7s/N7zuG6XpzG+5dUolg5SSoR3hANQxqzAkv+lREko=
github.com/maxcnunes/httpfake v1.2.4/go.mod h1:rWVxb0bLKtOUM/5hN3UO1VEdEitz1hfcTXs7UyiK6r0=
+github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE=
+github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A=
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 h1:YH424zrwLTlyHSH/GzLMJeu5zhYVZSx5RQxGKm1h96s=
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5/go.mod h1:PoGiBqKSQK1vIfQ+yVaFcGjDySHvym6FM1cNYnwzbrY=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
@@ -470,8 +476,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
-github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8=
-github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
+github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU=
+github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk=
github.com/moby/sys/capability v0.4.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I=
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
@@ -484,11 +490,12 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=
+github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
-github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
+github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
@@ -517,8 +524,13 @@ github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs=
github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc=
-github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA=
github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
+github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
+github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM=
+github.com/onsi/ginkgo/v2 v2.23.3/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM=
+github.com/onsi/ginkgo/v2 v2.25.1/go.mod h1:ppTWQ1dh9KM/F1XgpeRqelR+zHVwV81DGRSDnFxK7Sk=
+github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
+github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
@@ -539,8 +551,12 @@ github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3ev
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY=
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
-github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
+github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
+github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
+github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0=
+github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
+github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
@@ -575,31 +591,37 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
+github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
-github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
-github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
+github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
+github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
-github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
+github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
+github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY=
-github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI=
+github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
+github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
-github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
+github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
+github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM=
github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA=
+github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY=
github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc=
+github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
+github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
+github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -623,8 +645,6 @@ github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQ
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
-github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
-github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
@@ -635,18 +655,19 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU
github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y=
github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
-github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
-github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
+github.com/spf13/cobra v1.10.0 h1:a5/WeUlSDCvV5a45ljW2ZFtV0bTDpkfSAj3uqB6Sc+0=
+github.com/spf13/cobra v1.10.0/go.mod h1:9dhySC7dnTtEiqzmqfkLj47BslqLCUPMXjG2lj/NgoE=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
-github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/spf13/pflag v1.0.8/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
+github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4=
github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
-github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
-github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
+github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
+github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
@@ -664,14 +685,22 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
-github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
+github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
+github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
+github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
+github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
+github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
+github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
+github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
+github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
+github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
+github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
+github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
-github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
-github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM=
github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc=
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
@@ -686,8 +715,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xeonx/timeago v1.0.0-rc5 h1:pwcQGpaH3eLfPtXeyPA4DmHWjoQt0Ea7/++FwpxqLxg=
github.com/xeonx/timeago v1.0.0-rc5/go.mod h1:qDLrYEFynLO7y5Ho7w3GwgtYgpy5UfhcXIIQvMKVDkA=
-github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
+github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc=
github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -700,57 +729,46 @@ github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uU
gitlab.com/gitlab-org/api/client-go v0.127.0 h1:8xnxcNKGF2gDazEoMs+hOZfOspSSw8D0vAoWhQk9U+U=
gitlab.com/gitlab-org/api/client-go v0.127.0/go.mod h1:bYC6fPORKSmtuPRyD9Z2rtbAjE7UeNatu2VWHRf4/LE=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
-go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
-go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
-go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0=
-go.etcd.io/etcd/api/v3 v3.5.14/go.mod h1:BmtWcRlQvwa1h3G2jvKYwIQy4PkHlDej5t7uLMUdJUU=
-go.etcd.io/etcd/client/pkg/v3 v3.5.14 h1:SaNH6Y+rVEdxfpA2Jr5wkEvN6Zykme5+YnbCkxvuWxQ=
-go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSvPjFMunkgeZI=
-go.etcd.io/etcd/client/v2 v2.305.13 h1:RWfV1SX5jTU0lbCvpVQe3iPQeAHETWdOTb6pxhd77C8=
-go.etcd.io/etcd/client/v2 v2.305.13/go.mod h1:iQnL7fepbiomdXMb3om1rHq96htNNGv2sJkEcZGDRRg=
-go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg=
-go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk=
-go.etcd.io/etcd/pkg/v3 v3.5.13 h1:st9bDWNsKkBNpP4PR1MvM/9NqUPfvYZx/YXegsYEH8M=
-go.etcd.io/etcd/pkg/v3 v3.5.13/go.mod h1:N+4PLrp7agI/Viy+dUYpX7iRtSPvKq+w8Y14d1vX+m0=
-go.etcd.io/etcd/raft/v3 v3.5.13 h1:7r/NKAOups1YnKcfro2RvGGo2PTuizF/xh26Z2CTAzA=
-go.etcd.io/etcd/raft/v3 v3.5.13/go.mod h1:uUFibGLn2Ksm2URMxN1fICGhk8Wu96EfDQyuLhAcAmw=
-go.etcd.io/etcd/server/v3 v3.5.13 h1:V6KG+yMfMSqWt+lGnhFpP5z5dRUj1BDRJ5k1fQ9DFok=
-go.etcd.io/etcd/server/v3 v3.5.13/go.mod h1:K/8nbsGupHqmr5MkgaZpLlH1QdX1pcNQLAkODy44XcQ=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ=
-go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
-go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q=
+go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
+go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 h1:umZgi92IyxfXd/l4kaDhnKgY8rnN/cZcF1LKc6I8OQ8=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0/go.mod h1:4lVs6obhSVRb1EW5FhOuBTyiQhtRtAnnva9vD3yRfq8=
-go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
-go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
-go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
-go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
-go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
-go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
-go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
-go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
-go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
-go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
+go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
+go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
+go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs=
+go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY=
+go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis=
+go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4=
+go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
+go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
+go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
+go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
+go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
+go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
+go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
+go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI=
+go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
+go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@@ -772,6 +790,20 @@ golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOM
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
+golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
+golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
+golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
+golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
+golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
+golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
+golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
+golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
+golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
+golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
+golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
+golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
+golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
+golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -779,6 +811,8 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
+golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
+golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM=
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
@@ -807,6 +841,19 @@ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
+golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
+golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
+golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
+golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
+golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ=
+golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
+golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI=
+golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
+golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -852,13 +899,27 @@ golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
+golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
+golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
+golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
+golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
+golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
+golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
+golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
+golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
+golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
+golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
+golang.org/x/net v0.45.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
+golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98=
-golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
+golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
+golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -874,6 +935,14 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
+golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
+golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
+golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
+golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -932,10 +1001,26 @@ golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
+golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
-golang.org/x/telemetry v0.0.0-20240208230135-b75ee8823808/go.mod h1:KG1lNk5ZFNssSZLrpVb4sMXKMpGwGXOxSG3rnu2gZQQ=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
+golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0=
+golang.org/x/telemetry v0.0.0-20250710130107-8d8967aff50b/go.mod h1:4ZwOYna0/zsOKwuR5X/m0QFOJpSZvAxFfkQT+Erd9D4=
+golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488/go.mod h1:fGb/2+tgXXjhjHsTNdVEEMZNWA0quBnfrO+AfoDSAKw=
+golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053/go.mod h1:+nZKN+XVh4LCiA9DV3ywrzN4gumyCnKjau3NGb9SGoE=
+golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -957,6 +1042,17 @@ golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0=
+golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
+golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
+golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
+golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
+golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
+golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
+golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
+golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0=
+golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
+golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
+golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -978,11 +1074,22 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
+golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
+golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
+golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
+golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
+golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
+golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
+golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
+golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
+golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
+golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
+golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -1018,17 +1125,29 @@ golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
-golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg=
golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
+golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
+golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
+golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
+golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
+golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
+golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
+golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
+golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
+golang.org/x/tools v0.34.1-0.20250613162507-3f93fece84c7/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
+golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw=
+golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
+golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
+golang.org/x/tools/go/expect v0.1.0-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=
+golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
@@ -1048,17 +1167,15 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY=
-google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
-google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 h1:fVoAXEKA4+yufmbdVYv+SE73+cPZbbbe8paLsHfkK+U=
-google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53/go.mod h1:riSXTwQ4+nqmPGtobMFyW5FqVAmIs0St6VPp4Ug7CE4=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d h1:xJJRGY7TJcvIlpSrN3K6LAWgNFUILlO+OMAqtg9aqnw=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4=
+google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950=
+google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
-google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A=
-google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
+google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8=
+google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -1067,12 +1184,15 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
-google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
-google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
-google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
+google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
+google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
+google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
+google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
+google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
+google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -1080,14 +1200,12 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
-gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
-gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
+gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo=
+gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
-gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
-gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
@@ -1098,7 +1216,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
@@ -1111,62 +1228,55 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
-k8s.io/api v0.31.6 h1:ocWG/UhC9Mqp5oEfYWy9wCddbZiZyBAFTlBt0LVlhDg=
-k8s.io/api v0.31.6/go.mod h1:i16xSiKMgVIVhsJMxfWq0mJbXA+Z7KhjPgYmwT41hl4=
-k8s.io/apiextensions-apiserver v0.31.6 h1:v9sqyWlrgFZpAPdEb/bEiXfM98TfSppwRF0X/uWKXh0=
-k8s.io/apiextensions-apiserver v0.31.6/go.mod h1:QVH3CFwqzGZtwsxPYzJlA/Qiwgb5FXmRMGls3CjzvbI=
-k8s.io/apimachinery v0.31.6 h1:Pn96A0wHD0X8+l7QTdAzdLQPrpav1s8rU6A+v2/9UEY=
-k8s.io/apimachinery v0.31.6/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
-k8s.io/apiserver v0.31.6 h1:FEhEGLsz1PbMOHeQZDbOUlMh36zRZbjgKwJCoMhdGmw=
-k8s.io/apiserver v0.31.6/go.mod h1:dpFh+xqFQ02O8vLYCIqoiV7sJIpZsUULeNuag6Y9HGo=
-k8s.io/client-go v0.31.6 h1:51HT40qVIZ13BrHKeWxFuU52uoPnFhxTYJnv4+LTgp4=
-k8s.io/client-go v0.31.6/go.mod h1:MEq7JQJelUQ0/4fMoPEUrc/OOFyGo/9LmGA38H6O6xY=
-k8s.io/cloud-provider v0.31.6 h1:5vVMyf/m/n8ij/GmSJLRcatchmciRr0gs4peBcxqvKk=
-k8s.io/cloud-provider v0.31.6/go.mod h1:iT6kIEMEXrTIvRBAaRU5qefRzgPaSV6kwTc6mjhhnEw=
-k8s.io/component-base v0.31.6 h1:FgI25PuZtCp2n7AFpOaDpMQOLieFdrpAbpeoZu7VhDI=
-k8s.io/component-base v0.31.6/go.mod h1:aVRrh8lAI1kSShFmwcKLhc3msQoUcmFWPBDf0sXaISM=
-k8s.io/component-helpers v0.31.6 h1:Af8BcE6pElKlLaerwW9s04jTQVFa66wmI1pkaNfDWzE=
-k8s.io/component-helpers v0.31.6/go.mod h1:6CRV6M+7R13eqtz4FBm2ty9eH+QajDcP3y0Bklzh2FA=
-k8s.io/controller-manager v0.31.6 h1:HQRUV6nogHo2N7vr3cgVNjZ+wvHIMvxEMjTeCrHitE4=
-k8s.io/controller-manager v0.31.6/go.mod h1:0HDNTZVapQFa9G96jNxrU99ht7fQJVEKBXDzqKDMez0=
-k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
+k8s.io/api v0.35.0 h1:iBAU5LTyBI9vw3L5glmat1njFK34srdLmktWwLTprlY=
+k8s.io/api v0.35.0/go.mod h1:AQ0SNTzm4ZAczM03QH42c7l3bih1TbAXYo0DkF8ktnA=
+k8s.io/apiextensions-apiserver v0.35.0 h1:3xHk2rTOdWXXJM+RDQZJvdx0yEOgC0FgQ1PlJatA5T4=
+k8s.io/apiextensions-apiserver v0.35.0/go.mod h1:E1Ahk9SADaLQ4qtzYFkwUqusXTcaV2uw3l14aqpL2LU=
+k8s.io/apimachinery v0.35.0 h1:Z2L3IHvPVv/MJ7xRxHEtk6GoJElaAqDCCU0S6ncYok8=
+k8s.io/apimachinery v0.35.0/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns=
+k8s.io/apiserver v0.35.0 h1:CUGo5o+7hW9GcAEF3x3usT3fX4f9r8xmgQeCBDaOgX4=
+k8s.io/apiserver v0.35.0/go.mod h1:QUy1U4+PrzbJaM3XGu2tQ7U9A4udRRo5cyxkFX0GEds=
+k8s.io/client-go v0.35.0 h1:IAW0ifFbfQQwQmga0UdoH0yvdqrbwMdq9vIFEhRpxBE=
+k8s.io/client-go v0.35.0/go.mod h1:q2E5AAyqcbeLGPdoRB+Nxe3KYTfPce1Dnu1myQdqz9o=
+k8s.io/component-base v0.35.0 h1:+yBrOhzri2S1BVqyVSvcM3PtPyx5GUxCK2tinZz1G94=
+k8s.io/component-base v0.35.0/go.mod h1:85SCX4UCa6SCFt6p3IKAPej7jSnF3L8EbfSyMZayJR0=
+k8s.io/component-helpers v0.35.0 h1:wcXv7HJRksgVjM4VlXJ1CNFBpyDHruRI99RrBtrJceA=
+k8s.io/component-helpers v0.35.0/go.mod h1:ahX0m/LTYmu7fL3W8zYiIwnQ/5gT28Ex4o2pymF63Co=
+k8s.io/controller-manager v0.35.0 h1:KteodmfVIRzfZ3RDaxhnHb72rswBxEngvdL9vuZOA9A=
+k8s.io/controller-manager v0.35.0/go.mod h1:1bVuPNUG6/dpWpevsJpXioS0E0SJnZ7I/Wqc9Awyzm4=
+k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
-k8s.io/kms v0.31.6 h1:p7OY+9Hp8nPtgzm0vT9TrERNigQQSu8tkgWqn+GvB2w=
-k8s.io/kms v0.31.6/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94=
-k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
-k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4=
-k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8=
-k8s.io/kubectl v0.31.6 h1:ngzql/UugqpEbeeyQX678BlVHXks19JR3CFjwKnWuFI=
-k8s.io/kubectl v0.31.6/go.mod h1:m6OXbx9s0sZiaZrfHHSEmJUD5CjWPA5+cVg0GZnVdzM=
-k8s.io/kubelet v0.31.6 h1:lxVvyLNDcb/QTpQNkDySk3iscgq4zubeSZs3cF6PmaA=
-k8s.io/kubelet v0.31.6/go.mod h1:BPghO52ilF7UzFEVBmYFOxdVtLge0P1gixjz84lBzzc=
-k8s.io/kubernetes v1.31.6 h1:zVhgWDFHmIj51o5sNARmjdgNvpq4K2Smya8pS5vxqlc=
-k8s.io/kubernetes v1.31.6/go.mod h1:9xmT2buyTYj8TRKwRae7FcuY8k5+xlxv7VivvO0KKfs=
-k8s.io/pod-security-admission v0.31.6 h1:5WnXyl+UNmQb73O0L1w82uaUEPuvp+sxdhXRiOLdCkY=
-k8s.io/pod-security-admission v0.31.6/go.mod h1:b+ZpSSR+XMx3t9Pvy/GdcXoI0CEpiWGT7IGAhcOBcGM=
-k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE=
+k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
+k8s.io/kubectl v0.35.0 h1:cL/wJKHDe8E8+rP3G7avnymcMg6bH6JEcR5w5uo06wc=
+k8s.io/kubectl v0.35.0/go.mod h1:VR5/TSkYyxZwrRwY5I5dDq6l5KXmiCb+9w8IKplk3Qo=
+k8s.io/kubelet v0.35.0 h1:8cgJHCBCKLYuuQ7/Pxb/qWbJfX1LXIw7790ce9xHq7c=
+k8s.io/kubelet v0.35.0/go.mod h1:ciRzAXn7C4z5iB7FhG1L2CGPPXLTVCABDlbXt/Zz8YA=
+k8s.io/kubernetes v1.35.0 h1:PUOojD8c8E3csMP5NX+nLLne6SGqZjrYCscptyBfWMY=
+k8s.io/kubernetes v1.35.0/go.mod h1:Tzk9Y9W/XUFFFgTUVg+BAowoFe+Pc7koGLuaiLHdcFg=
+k8s.io/pod-security-admission v0.35.0 h1:tT3UHC+Q1mpFRe4IoVTu20ZAx+kqgKBZnewRnsDcyfc=
+k8s.io/pod-security-admission v0.35.0/go.mod h1:S+57PAqNo6DaUYjmtINiiXlYnEdShrOVMwSc7C4oYPg=
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e h1:KqK5c/ghOm8xkHYhlodbp6i6+r+ChV2vuAuVRdFbLro=
-k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
+k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
-sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
-sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
+sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
+sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
sigs.k8s.io/kind v0.11.1 h1:pVzOkhUwMBrCB0Q/WllQDO3v14Y+o2V0tFgjTqIUjwA=
sigs.k8s.io/kind v0.11.1/go.mod h1:fRpgVhtqAWrtLB9ED7zQahUimpUXuG/iHT88xYqEGIA=
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
-sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
-sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
-sigs.k8s.io/structured-merge-diff/v4 v4.7.0 h1:qPeWmscJcXP0snki5IYF79Z8xrl8ETFxgMd7wez1XkI=
-sigs.k8s.io/structured-merge-diff/v4 v4.7.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
+sigs.k8s.io/structured-merge-diff/v6 v6.2.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
+sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=
+sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
-sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
+sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
+sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
diff --git a/internal/aws/aws.go b/internal/aws/aws.go
index 02db3400a..86b0befcd 100644
--- a/internal/aws/aws.go
+++ b/internal/aws/aws.go
@@ -335,7 +335,11 @@ func (staticCreds *AWSStaticCreds) GetS3Data(bucket string, includePaths, exclud
if err != nil {
return s3Data, err
}
- defer os.RemoveAll(tempDirName)
+ defer func() {
+ if err := os.RemoveAll(tempDirName); err != nil {
+ logger.Warn("failed to remove temp dir %s: %v", tempDirName, err)
+ }
+ }()
client, err := staticCreds.NewS3Client()
if err != nil {
@@ -384,7 +388,7 @@ func (staticCreds *AWSStaticCreds) GetS3Data(bucket string, includePaths, exclud
var sha256 string
artifactName := bucket
if fileSnapshot {
- sha256, err = digest.FileSha256(artifactPath)
+ sha256, err = digest.FileSha256(artifactPath, logger)
if err != nil {
return s3Data, err
}
@@ -406,7 +410,11 @@ func downloadFileFromBucket(downloader *s3manager.Downloader, dirName, key, buck
if err != nil {
return err
}
- defer file.Close()
+ defer func() {
+ if err := file.Close(); err != nil {
+ logger.Warn("failed to close file %s: %v", file.Name(), err)
+ }
+ }()
numBytes, err := downloader.Download(context.TODO(), file,
&s3.GetObjectInput{
diff --git a/internal/aws/aws_test.go b/internal/aws/aws_test.go
index 7d226325b..210298ab7 100644
--- a/internal/aws/aws_test.go
+++ b/internal/aws/aws_test.go
@@ -33,14 +33,14 @@ func (suite *AWSTestSuite) TestFormatLambdaLastModified() {
wantErr: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
got, err := formatLambdaLastModified(t.lastModified)
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"formatLambdaLastModified() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
date, err := time.Parse("2006-01-02T15:04:05.000+0000", t.lastModified)
- require.NoError(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), date, got)
+ require.NoError(suite.T(), err)
+ require.Equal(suite.T(), date, got)
}
})
}
@@ -64,12 +64,12 @@ func (suite *AWSTestSuite) TestDecodeLambdaFingerprint() {
wantErr: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
got, err := decodeLambdaFingerprint(t.base64Fingerprint)
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"decodeLambdaFingerprint() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
- require.Equal(suite.Suite.T(), t.wantFingerprint, got)
+ require.Equal(suite.T(), t.wantFingerprint, got)
}
})
}
@@ -89,7 +89,7 @@ func (suite *AWSTestSuite) TestNewEcsTaskData() {
StartedAt: time.Unix(),
}
got := NewEcsTaskData(taskARN, cluster, service, digests, time)
- require.Equal(suite.Suite.T(), expected, got)
+ require.Equal(suite.T(), expected, got)
}
func (suite *AWSTestSuite) TestGetConfigOptFns() {
@@ -136,9 +136,9 @@ func (suite *AWSTestSuite) TestGetConfigOptFns() {
wantedLength: 1,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
got := t.creds.GetConfigOptFns()
- require.Len(suite.Suite.T(), got, t.wantedLength)
+ require.Len(suite.T(), got, t.wantedLength)
})
}
}
@@ -173,20 +173,20 @@ func (suite *AWSTestSuite) TestNewAWSConfigFromEnvOrFlags() {
checkAuth: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
config, err := t.creds.NewAWSConfigFromEnvOrFlags()
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"NewAWSConfigFromEnvOrFlags() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
- require.NotNil(suite.Suite.T(), config)
+ require.NotNil(suite.T(), config)
if t.checkRegion {
- require.Equal(suite.Suite.T(), config.Region, t.creds.Region)
+ require.Equal(suite.T(), config.Region, t.creds.Region)
}
if t.checkAuth {
c, err := config.Credentials.Retrieve(context.TODO())
- require.NoError(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), c.AccessKeyID, t.creds.AccessKeyID)
- require.Equal(suite.Suite.T(), c.SecretAccessKey, t.creds.SecretAccessKey)
+ require.NoError(suite.T(), err)
+ require.Equal(suite.T(), c.AccessKeyID, t.creds.AccessKeyID)
+ require.Equal(suite.T(), c.SecretAccessKey, t.creds.SecretAccessKey)
}
}
})
@@ -218,26 +218,26 @@ func (suite *AWSTestSuite) TestAWSClients() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
s3Client, err := t.creds.NewS3Client()
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"NewS3Client() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
- require.NotNil(suite.Suite.T(), s3Client)
+ require.NotNil(suite.T(), s3Client)
}
lambdaClient, err := t.creds.NewLambdaClient()
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"NewLambdaClient() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
- require.NotNil(suite.Suite.T(), lambdaClient)
+ require.NotNil(suite.T(), lambdaClient)
}
ecsClient, err := t.creds.NewECSClient()
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"NewECSClient() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
- require.NotNil(suite.Suite.T(), ecsClient)
+ require.NotNil(suite.T(), ecsClient)
}
})
}
@@ -363,14 +363,14 @@ func (suite *AWSTestSuite) TestGetLambdaPackageData() {
requireEnvVars: true,
},
} {
- suite.Suite.Run(t.name, func() {
- skipOrSetCreds(suite.Suite.T(), t.requireEnvVars, t.creds)
+ suite.Run(t.name, func() {
+ skipOrSetCreds(suite.T(), t.requireEnvVars, t.creds)
data, err := t.creds.GetLambdaPackageData(t.filter)
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"GetLambdaPackageData() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
matchFound := false
- require.Len(suite.Suite.T(), data, len(t.expectedFunctions))
+ require.Len(suite.T(), data, len(t.expectedFunctions))
if len(t.expectedFunctions) == 0 {
matchFound = true
}
@@ -382,12 +382,12 @@ func (suite *AWSTestSuite) TestGetLambdaPackageData() {
matchFound = true
break loop1
} else {
- suite.Suite.T().Logf("fingerprint did not match: GOT %s -- WANT %s", fingerprint, expectedFunction.fingerprint)
+ suite.T().Logf("fingerprint did not match: GOT %s -- WANT %s", fingerprint, expectedFunction.fingerprint)
}
}
}
}
- require.True(suite.Suite.T(), matchFound)
+ require.True(suite.T(), matchFound)
}
})
}
@@ -507,19 +507,19 @@ func (suite *AWSTestSuite) TestGetS3Data() {
wantArtifactName: "README.md",
},
} {
- suite.Suite.Run(t.name, func() {
- skipOrSetCreds(suite.Suite.T(), t.requireEnvVars, t.creds)
+ suite.Run(t.name, func() {
+ skipOrSetCreds(suite.T(), t.requireEnvVars, t.creds)
data, err := t.creds.GetS3Data(t.bucketName, t.includePaths, t.excludePaths, logger.NewStandardLogger())
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"GetS3Data() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
if t.wantArtifactName == "" {
t.wantArtifactName = t.bucketName
}
if t.wantFingerprint == "" {
- require.Contains(suite.Suite.T(), data[0].Digests, t.wantArtifactName)
+ require.Contains(suite.T(), data[0].Digests, t.wantArtifactName)
} else {
- require.Equal(suite.Suite.T(), t.wantFingerprint, data[0].Digests[t.wantArtifactName])
+ require.Equal(suite.T(), t.wantFingerprint, data[0].Digests[t.wantArtifactName])
}
}
})
@@ -650,8 +650,8 @@ func (suite *AWSTestSuite) TestGetEcsTasksData() {
requireEnvVars: true,
},
} {
- suite.Suite.Run(t.name, func() {
- skipOrSetCreds(suite.Suite.T(), t.requireEnvVars, t.creds)
+ suite.Run(t.name, func() {
+ skipOrSetCreds(suite.T(), t.requireEnvVars, t.creds)
if t.clusterFilter == nil {
t.clusterFilter = new(filters.ResourceFilterOptions)
}
@@ -659,10 +659,10 @@ func (suite *AWSTestSuite) TestGetEcsTasksData() {
t.serviceFilter = new(filters.ResourceFilterOptions)
}
data, err := t.creds.GetEcsTasksData(t.clusterFilter, t.serviceFilter, logger.NewStandardLogger())
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"GetEcsTasksData() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
- require.GreaterOrEqual(suite.Suite.T(), len(data), t.minNumberOfArtifacts)
+ require.GreaterOrEqual(suite.T(), len(data), t.minNumberOfArtifacts)
}
})
}
diff --git a/internal/azure/azure_apps.go b/internal/azure/azure_apps.go
index 00471d9a6..eddbf0bd3 100644
--- a/internal/azure/azure_apps.go
+++ b/internal/azure/azure_apps.go
@@ -145,7 +145,7 @@ func (azureClient *AzureClient) NewAppData(app *armappservice.Site, logger *logg
}
// getBearerToken gets a bearer token
-func (azureClient *AzureClient) getBearerToken() (string, error) {
+func (azureClient *AzureClient) getBearerToken(logger *logger.Logger) (string, error) {
oauthURL := fmt.Sprintf("https://login.microsoftonline.com/%s/oauth2/token", azureClient.Credentials.TenantId)
data := url.Values{}
@@ -166,7 +166,12 @@ func (azureClient *AzureClient) getBearerToken() (string, error) {
if err != nil {
return "", err
}
- defer resp.Body.Close()
+ defer func() {
+ if err := resp.Body.Close(); err != nil {
+ // Log warning for cleanup error
+ logger.Warn("failed to close response body: %v", err)
+ }
+ }()
body, err := io.ReadAll(resp.Body)
if err != nil {
@@ -195,7 +200,12 @@ func downloadAppPackage(appName, bearerToken, destination string) error {
if err != nil {
return err
}
- defer resp.Body.Close()
+ defer func() {
+ if err := resp.Body.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close response body: %v\n", err)
+ }
+ }()
if resp.StatusCode == http.StatusServiceUnavailable {
return ErrAppUnavailable
}
@@ -207,7 +217,12 @@ func downloadAppPackage(appName, bearerToken, destination string) error {
if err != nil {
return err
}
- defer out.Close()
+ defer func() {
+ if err := out.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close file %s: %v\n", destination, err)
+ }
+ }()
_, err = io.Copy(out, resp.Body)
if err != nil {
@@ -218,7 +233,7 @@ func downloadAppPackage(appName, bearerToken, destination string) error {
func (azureClient *AzureClient) fingerprintZipService(app *armappservice.Site, logger *logger.Logger) (AppData, error) {
// get bearer token
- token, err := azureClient.getBearerToken()
+ token, err := azureClient.getBearerToken(logger)
if err != nil {
return AppData{}, err
}
@@ -227,7 +242,11 @@ func (azureClient *AzureClient) fingerprintZipService(app *armappservice.Site, l
if err != nil {
return AppData{}, err
}
- defer os.RemoveAll(tmpDir)
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ logger.Warn("failed to remove temp dir %s: %v", tmpDir, err)
+ }
+ }()
packagePath := filepath.Join(tmpDir, *app.Name+".zip")
err = downloadAppPackage(*app.Name, token, packagePath)
@@ -241,7 +260,7 @@ func (azureClient *AzureClient) fingerprintZipService(app *armappservice.Site, l
// unzip the downloaded package
destDir := filepath.Join(tmpDir, "extracted")
- err = unzip(packagePath, destDir)
+ err = unzip(packagePath, destDir, logger)
if err != nil {
return AppData{}, fmt.Errorf("failed to unzip downloaded package for app [%s]: %v", *app.Name, err)
}
@@ -286,12 +305,17 @@ func (azureClient *AzureClient) fingerprintZipService(app *armappservice.Site, l
}
// unzip extracts a zip archive to a specified destination directory.
-func unzip(zipFile, destDir string) error {
+func unzip(zipFile, destDir string, logger *logger.Logger) error {
r, err := zip.OpenReader(zipFile)
if err != nil {
return err
}
- defer r.Close()
+ defer func() {
+ if err := r.Close(); err != nil {
+ // Log warning for cleanup error
+ logger.Warn("failed to close zip reader: %v", err)
+ }
+ }()
for _, f := range r.File {
filePath := filepath.Join(destDir, f.Name)
@@ -326,8 +350,14 @@ func unzip(zipFile, destDir string) error {
_, err = io.Copy(destFile, zipFile)
// Close the open files
- destFile.Close()
- zipFile.Close()
+ if closeErr := destFile.Close(); closeErr != nil {
+ // Log warning for cleanup error
+ logger.Warn("failed to close destination file %s: %v", filePath, closeErr)
+ }
+ if closeErr := zipFile.Close(); closeErr != nil {
+ // Log warning for cleanup error
+ logger.Warn("failed to close zip file: %v", closeErr)
+ }
if err != nil {
return err
@@ -476,7 +506,11 @@ func (azureClient *AzureClient) GetDockerLogsForApp(appServiceName string, logge
}
logger.Debug("Got logs for app service: ", appServiceName)
if response.Body != nil {
- defer response.Body.Close()
+ defer func() {
+ if err := response.Body.Close(); err != nil {
+ logger.Warn("failed to close response body: %v", err)
+ }
+ }()
}
logger.Debug("Reading logs for app service: ", appServiceName)
body, err := io.ReadAll(response.Body)
@@ -497,7 +531,11 @@ func (azureClient *AzureClient) GetDockerLogsForApp(appServiceName string, logge
if err != nil {
return nil, err
}
- defer response.Body.Close()
+ defer func() {
+ if err := response.Body.Close(); err != nil {
+ logger.Warn("failed to close response body: %v", err)
+ }
+ }()
body, err := io.ReadAll(response.Body)
if err != nil {
diff --git a/internal/azure/azure_apps_test.go b/internal/azure/azure_apps_test.go
index 465f63010..737739e9b 100644
--- a/internal/azure/azure_apps_test.go
+++ b/internal/azure/azure_apps_test.go
@@ -23,7 +23,7 @@ type AzureAppsTestSuite struct {
}
func (suite *AzureAppsTestSuite) SetupTest() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{
"INTEGRATION_TEST_AZURE_CLIENT_SECRET",
"INTEGRATION_TEST_AZURE_CLIENT_ID",
})
@@ -36,30 +36,38 @@ func (suite *AzureAppsTestSuite) SetupTest() {
}
var err error
suite.defaultClient, err = suite.staticCreds.NewAzureClient()
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
func (suite *AzureAppsTestSuite) TestCanDownloadAppZip() {
- token, err := suite.defaultClient.getBearerToken()
- require.NoError(suite.Suite.T(), err)
- require.NotEmpty(suite.Suite.T(), token)
+ token, err := suite.defaultClient.getBearerToken(logger.NewStandardLogger())
+ require.NoError(suite.T(), err)
+ require.NotEmpty(suite.T(), token)
appName := "kosli-dev-WaveApp"
tmpDir, err := os.MkdirTemp("", "*")
- require.NoError(suite.Suite.T(), err)
- defer os.RemoveAll(tmpDir)
+ require.NoError(suite.T(), err)
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ require.NoError(suite.T(), err, "failed to remove temp dir %s", tmpDir)
+ }
+ }()
dest := filepath.Join(tmpDir, appName+".zip")
err = downloadAppPackage(appName, token, dest)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
// check download file exists
_, err = os.Stat(dest)
- require.False(suite.Suite.T(), os.IsNotExist(err))
+ require.False(suite.T(), os.IsNotExist(err))
// check downloaded file is a valid zip
r, err := zip.OpenReader(dest)
- require.NoError(suite.Suite.T(), err)
- defer r.Close()
+ require.NoError(suite.T(), err)
+ defer func() {
+ if err := r.Close(); err != nil {
+ suite.T().Logf("warning: failed to close zip reader: %v", err)
+ }
+ }()
}
@@ -67,13 +75,13 @@ func (suite *AzureAppsTestSuite) TestFingerprintZipService() {
appName := "kosli-dev-WaveApp"
appKind := "app"
appData, err := suite.defaultClient.fingerprintZipService(&armappservice.Site{Name: &appName, Kind: &appKind}, logger.NewStandardLogger())
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
digest := appData.Digests[appName]
sha256Regex := regexp.MustCompile(`^[a-f0-9]{64}$`)
- require.True(suite.Suite.T(), sha256Regex.MatchString(digest))
+ require.True(suite.T(), sha256Regex.MatchString(digest))
- require.EqualValues(suite.Suite.T(), appData, AppData{AppName: appName,
+ require.EqualValues(suite.T(), appData, AppData{AppName: appName,
AppKind: appKind,
DigestsSource: "kosli-cli",
StartedAt: 0,
@@ -84,7 +92,7 @@ func (suite *AzureAppsTestSuite) TestFingerprintZipService() {
unknownAppName := "unknown"
_, err = suite.defaultClient.fingerprintZipService(&armappservice.Site{Name: &unknownAppName}, logger.NewStandardLogger())
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/internal/azure/azure_test.go b/internal/azure/azure_test.go
index bc9e81f1e..65ffdd593 100644
--- a/internal/azure/azure_test.go
+++ b/internal/azure/azure_test.go
@@ -18,8 +18,8 @@ type AzureTestSuite struct {
// suite.
func (suite *AzureTestSuite) TestNewAzureClientFromToken() {
client, err := NewAzureClientFromToken(context.Background(), "some_fake_token", "https://dev.azure.com/kosli_xxxxx")
- require.Error(suite.Suite.T(), err)
- require.Nil(suite.Suite.T(), client)
+ require.Error(suite.T(), err)
+ require.Nil(suite.T(), client)
}
func (suite *AzureTestSuite) TestPREvidenceForCommit() {
@@ -61,17 +61,17 @@ func (suite *AzureTestSuite) TestPREvidenceForCommit() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
if t.requireEnvVars {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_AZURE_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_AZURE_TOKEN"})
t.config.Token = os.Getenv("KOSLI_AZURE_TOKEN")
}
prs, err := t.config.PREvidenceForCommitV1(t.commit)
if t.result.wantError {
- require.Errorf(suite.Suite.T(), err, "expected an error but got: %s", err)
+ require.Errorf(suite.T(), err, "expected an error but got: %s", err)
} else {
- require.NoErrorf(suite.Suite.T(), err, "was NOT expecting error but got: %s", err)
- require.Len(suite.Suite.T(), prs, t.result.numberOfPRs)
+ require.NoErrorf(suite.T(), err, "was NOT expecting error but got: %s", err)
+ require.Len(suite.T(), prs, t.result.numberOfPRs)
}
})
}
@@ -102,8 +102,8 @@ func (suite *AzureTestSuite) TestPullRequestsForCommit() {
},
},
} {
- suite.Suite.Run(t.name, func() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_AZURE_TOKEN"})
+ suite.Run(t.name, func() {
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_AZURE_TOKEN"})
token := os.Getenv("KOSLI_AZURE_TOKEN")
c := &AzureConfig{
Token: token,
@@ -114,10 +114,10 @@ func (suite *AzureTestSuite) TestPullRequestsForCommit() {
prs, err := c.PullRequestsForCommit(t.commit)
if t.result.wantError {
- require.Errorf(suite.Suite.T(), err, "expected an error but got: %s", err)
+ require.Errorf(suite.T(), err, "expected an error but got: %s", err)
} else {
- require.NoErrorf(suite.Suite.T(), err, "was NOT expecting error but got: %s", err)
- require.Lenf(suite.Suite.T(), prs, t.result.numberOfPRs, "expected %d PRs but got %d", t.result.numberOfPRs, len(prs))
+ require.NoErrorf(suite.T(), err, "was NOT expecting error but got: %s", err)
+ require.Lenf(suite.T(), prs, t.result.numberOfPRs, "expected %d PRs but got %d", t.result.numberOfPRs, len(prs))
}
})
}
@@ -167,8 +167,8 @@ func (suite *AzureTestSuite) TestGetPullRequestApprovers() {
},
},
} {
- suite.Suite.Run(t.name, func() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_AZURE_TOKEN"})
+ suite.Run(t.name, func() {
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_AZURE_TOKEN"})
token := os.Getenv("KOSLI_AZURE_TOKEN")
c := &AzureConfig{
Token: token,
@@ -178,10 +178,10 @@ func (suite *AzureTestSuite) TestGetPullRequestApprovers() {
}
approvers, err := c.GetPullRequestApprovers(t.number)
if t.result.wantError {
- require.Errorf(suite.Suite.T(), err, "expected an error but got: %s", err)
+ require.Errorf(suite.T(), err, "expected an error but got: %s", err)
} else {
- require.NoErrorf(suite.Suite.T(), err, "was NOT expecting error but got: %s", err)
- require.ElementsMatchf(suite.Suite.T(), t.result.approvers, approvers, "want approvers: %v, got approvers: %v",
+ require.NoErrorf(suite.T(), err, "was NOT expecting error but got: %s", err)
+ require.ElementsMatchf(suite.T(), t.result.approvers, approvers, "want approvers: %v, got approvers: %v",
t.result.approvers, approvers)
}
})
@@ -205,9 +205,9 @@ func (suite *AzureTestSuite) TestExtractRepoName() {
want: "cli",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
repo := extractRepoName(t.input)
- require.Equalf(suite.Suite.T(), t.want, repo, "expected %s but got %s", t.want, repo)
+ require.Equalf(suite.T(), t.want, repo, "expected %s but got %s", t.want, repo)
})
}
}
diff --git a/internal/digest/digest.go b/internal/digest/digest.go
index f6f2acbcd..999995ddc 100644
--- a/internal/digest/digest.go
+++ b/internal/digest/digest.go
@@ -48,13 +48,22 @@ func DirSha256(dirPath string, excludePaths []string, logger *logger.Logger) (st
if err != nil {
return "", err
}
- defer os.RemoveAll(tmpDir)
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ logger.Warn("failed to remove temp dir %s: %v", tmpDir, err)
+ }
+ }()
digestsFile, err := os.Create(filepath.Join(tmpDir, "digests"))
if err != nil {
return "", err
}
- defer digestsFile.Close()
+ defer func() {
+ if err := digestsFile.Close(); err != nil {
+ // Log warning for cleanup error
+ logger.Warn("failed to close digests file: %v", err)
+ }
+ }()
ignoreFilePath := filepath.Join(dirPath, ".kosli_ignore")
ignoredPaths, err := excludePathsFromFile(ignoreFilePath)
if err != nil {
@@ -69,7 +78,7 @@ func DirSha256(dirPath string, excludePaths []string, logger *logger.Logger) (st
return "", err
}
- return FileSha256(digestsFile.Name())
+ return FileSha256(digestsFile.Name(), logger)
}
// OciSha256 gets the digest of a docker/OCI image from its registry
@@ -148,7 +157,7 @@ func calculateDirContentSha256(digestsFile *os.File, dirPath, tmpDir string, exc
stat = resolved
}
- nameSha256, err := addNameDigest(tmpDir, info.Name(), digestsFile)
+ nameSha256, err := addNameDigest(tmpDir, info.Name(), digestsFile, logger)
if err != nil {
return err
}
@@ -164,7 +173,7 @@ func calculateDirContentSha256(digestsFile *os.File, dirPath, tmpDir string, exc
}
// Calculate fingerprint of what link points to (for this: a -> c/d calculate the fingerprint of c/d)
- targetSha256, err := addNameDigest(tmpDir, targetPath, digestsFile)
+ targetSha256, err := addNameDigest(tmpDir, targetPath, digestsFile, logger)
if err != nil {
return err
}
@@ -176,7 +185,7 @@ func calculateDirContentSha256(digestsFile *os.File, dirPath, tmpDir string, exc
} else {
// File or symlink -> file
logger.Debug("file path: %s -- filename digest: %s", path, nameSha256)
- fileContentSha256, err := FileSha256(path)
+ fileContentSha256, err := FileSha256(path, logger)
if err != nil {
return err
}
@@ -191,14 +200,14 @@ func calculateDirContentSha256(digestsFile *os.File, dirPath, tmpDir string, exc
}
// addNameDigest calculates the sha256 digest of the filename and adds it to the digests file
-func addNameDigest(tmpDir string, filename string, digestsFile *os.File) (string, error) {
+func addNameDigest(tmpDir string, filename string, digestsFile *os.File, logger *logger.Logger) (string, error) {
nameFilePath := filepath.Join(tmpDir, "name")
err := utils.CreateFileWithContent(nameFilePath, filename)
if err != nil {
return "", err
}
- nameSha256, err := FileSha256(nameFilePath)
+ nameSha256, err := FileSha256(nameFilePath, logger)
if err != nil {
return "", err
}
@@ -209,7 +218,7 @@ func addNameDigest(tmpDir string, filename string, digestsFile *os.File) (string
}
// FileSha256 returns a sha256 digest of a file.
-func FileSha256(filepath string) (string, error) {
+func FileSha256(filepath string, logger *logger.Logger) (string, error) {
hasher := sha256.New()
f, err := os.Open(filepath)
if err != nil {
@@ -218,7 +227,12 @@ func FileSha256(filepath string) (string, error) {
}
return "", err
}
- defer f.Close()
+ defer func() {
+ if err := f.Close(); err != nil {
+ // Log warning for cleanup error
+ logger.Warn("failed to close file %s: %v", filepath, err)
+ }
+ }()
if _, err := io.Copy(hasher, f); err != nil {
return "", err
}
@@ -347,7 +361,12 @@ func ValidateDigest(sha256ToCheck string) error {
func excludePathsFromFile(path string) ([]string, error) {
file, err := os.Open(path)
if err == nil {
- defer file.Close()
+ defer func() {
+ if err := file.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close file %s: %v\n", path, err)
+ }
+ }()
var excludes = []string{}
scanner := bufio.NewScanner(file)
for scanner.Scan() {
diff --git a/internal/digest/digest_test.go b/internal/digest/digest_test.go
index 1cd5e1cd4..c75860a6b 100644
--- a/internal/digest/digest_test.go
+++ b/internal/digest/digest_test.go
@@ -26,13 +26,13 @@ type DigestTestSuite struct {
func (suite *DigestTestSuite) SetupTest() {
var err error
suite.tmpDir, err = os.MkdirTemp("", "testDir")
- require.NoError(suite.Suite.T(), err, "error creating a temporary test directory")
+ require.NoError(suite.T(), err, "error creating a temporary test directory")
}
// clean up tmpDir after each test
func (suite *DigestTestSuite) AfterTest() {
err := os.RemoveAll(suite.tmpDir)
- require.NoErrorf(suite.Suite.T(), err, "error cleaning up the temporary test directory %s", suite.tmpDir)
+ require.NoErrorf(suite.T(), err, "error cleaning up the temporary test directory %s", suite.tmpDir)
}
// All methods that begin with "Test" are run as tests within a
@@ -80,17 +80,17 @@ func (suite *DigestTestSuite) TestFileSha256() {
want: "a50afcf37a327e0715b3148c2625bc28b3e4dcdf32b6cf78c8b8fa3ac1ebfe47",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
testFile, err := os.Create(filepath.Join(suite.tmpDir, t.args.filename))
- require.NoErrorf(suite.Suite.T(), err, "error creating test file %s", t.args.filename)
+ require.NoErrorf(suite.T(), err, "error creating test file %s", t.args.filename)
_, err = testFile.Write([]byte(t.args.content))
- require.NoErrorf(suite.Suite.T(), err, "error writing content to test file %s", t.args.filename)
+ require.NoErrorf(suite.T(), err, "error writing content to test file %s", t.args.filename)
- sha256, err := FileSha256(filepath.Join(suite.tmpDir, t.args.filename))
- require.NoErrorf(suite.Suite.T(), err, "error creating digest for test file %s", t.args.filename)
+ sha256, err := FileSha256(filepath.Join(suite.tmpDir, t.args.filename), logger.NewStandardLogger())
+ require.NoErrorf(suite.T(), err, "error creating digest for test file %s", t.args.filename)
- assert.Equal(suite.Suite.T(), t.want, sha256, fmt.Sprintf("TestFileSha256: %s , got: %v -- want: %v", t.name, sha256, t.want))
+ assert.Equal(suite.T(), t.want, sha256, fmt.Sprintf("TestFileSha256: %s , got: %v -- want: %v", t.name, sha256, t.want))
})
}
}
@@ -509,19 +509,19 @@ func (suite *DigestTestSuite) TestDirSha256() {
want: "4048004ce6f91e8ce27c35e5e857948a46750567cf7c873ee32b120f4318363c",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
topLevelPath := filepath.Join(suite.tmpDir, t.args.dirName)
err := os.Mkdir(topLevelPath, 0777)
- require.NoErrorf(suite.Suite.T(), err, "error creating test dir %s", t.args.dirName)
+ require.NoErrorf(suite.T(), err, "error creating test dir %s", t.args.dirName)
for _, entry := range t.args.dirContent {
suite.createNestedDir(topLevelPath, entry.files, entry.dirs)
}
sha256, err := DirSha256(topLevelPath, t.args.excludePaths, logger.NewStandardLogger())
- require.NoErrorf(suite.Suite.T(), err, "error creating digest for test dir %s", topLevelPath)
+ require.NoErrorf(suite.T(), err, "error creating digest for test dir %s", topLevelPath)
- assert.Equal(suite.Suite.T(), t.want, sha256, fmt.Sprintf("TestDirSha256: %s , got: %v -- want: %v", t.name, sha256, t.want))
+ assert.Equal(suite.T(), t.want, sha256, fmt.Sprintf("TestDirSha256: %s , got: %v -- want: %v", t.name, sha256, t.want))
})
}
}
@@ -534,7 +534,7 @@ func (suite *DigestTestSuite) createNestedDir(path string, files []fileEntry, di
for _, d := range dirs {
nestedPath := filepath.Join(path, d.name)
err := os.Mkdir(nestedPath, 0777)
- require.NoErrorf(suite.Suite.T(), err, "error creating nested test dir %s", nestedPath)
+ require.NoErrorf(suite.T(), err, "error creating nested test dir %s", nestedPath)
suite.createNestedDir(nestedPath, d.files, d.dirs)
}
}
@@ -574,7 +574,7 @@ func (suite *DigestTestSuite) TestDirSha256Validation() {
errExpected: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
dirPath := filepath.Join(suite.tmpDir, t.args.name)
if t.args.isAbsolute {
dirPath = t.args.name
@@ -586,7 +586,7 @@ func (suite *DigestTestSuite) TestDirSha256Validation() {
_, err := DirSha256(dirPath, []string{}, logger.NewStandardLogger())
if t.errExpected {
- require.Errorf(suite.Suite.T(), err, "TestDirSha256Validation: error was expected")
+ require.Errorf(suite.T(), err, "TestDirSha256Validation: error was expected")
}
})
@@ -595,7 +595,7 @@ func (suite *DigestTestSuite) TestDirSha256Validation() {
func (suite *DigestTestSuite) createFileWithContent(path, content string) {
err := utils.CreateFileWithContent(path, content)
- require.NoErrorf(suite.Suite.T(), err, "error creating file %s", path)
+ require.NoErrorf(suite.T(), err, "error creating file %s", path)
}
func (suite *DigestTestSuite) TestValidateDigest() {
@@ -625,12 +625,12 @@ func (suite *DigestTestSuite) TestValidateDigest() {
expectError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
err := ValidateDigest(t.sha256)
if t.expectError {
- require.Errorf(suite.Suite.T(), err, "TestValidateDigest: error was expected")
+ require.Errorf(suite.T(), err, "TestValidateDigest: error was expected")
} else {
- require.NoErrorf(suite.Suite.T(), err, "TestValidateDigest: error was NOT expected")
+ require.NoErrorf(suite.T(), err, "TestValidateDigest: error was NOT expected")
}
})
@@ -674,17 +674,17 @@ func (suite *DigestTestSuite) TestDockerImageSha256() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
if t.pullImage {
err := docker.PullDockerImage(t.imageName)
- require.NoErrorf(suite.Suite.T(), err, "TestDockerImageSha256: test image should be pullable")
+ require.NoErrorf(suite.T(), err, "TestDockerImageSha256: test image should be pullable")
}
actual, err := DockerImageSha256(t.imageName)
if t.want.expectError {
- require.Errorf(suite.Suite.T(), err, "TestDockerImageSha256: error was expected")
+ require.Errorf(suite.T(), err, "TestDockerImageSha256: error was expected")
} else {
- require.NoErrorf(suite.Suite.T(), err, "TestDockerImageSha256: error was NOT expected")
- assert.Equal(suite.Suite.T(), t.want.sha256, actual, fmt.Sprintf("TestDockerImageSha256: want %s -- got %s", t.want.sha256, actual))
+ require.NoErrorf(suite.T(), err, "TestDockerImageSha256: error was NOT expected")
+ assert.Equal(suite.T(), t.want.sha256, actual, fmt.Sprintf("TestDockerImageSha256: want %s -- got %s", t.want.sha256, actual))
}
})
@@ -732,25 +732,25 @@ func (suite *DigestTestSuite) TestRemoteDockerImageSha256() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
if t.pullImage {
err := docker.PullDockerImage(t.imageName)
- require.NoErrorf(suite.Suite.T(), err, "TestRemoteDockerImageSha256: test image should be pullable")
+ require.NoErrorf(suite.T(), err, "TestRemoteDockerImageSha256: test image should be pullable")
localImage := fmt.Sprintf("localhost:5001/%s:%s", t.localImageName, t.localImageTag)
err = docker.TagDockerImage(t.imageName, localImage)
- require.NoErrorf(suite.Suite.T(), err, "TestRemoteDockerImageSha256: test image should be taggable")
+ require.NoErrorf(suite.T(), err, "TestRemoteDockerImageSha256: test image should be taggable")
err = docker.PushDockerImage(localImage)
- require.NoErrorf(suite.Suite.T(), err, "TestRemoteDockerImageSha256: test image should be pushable")
+ require.NoErrorf(suite.T(), err, "TestRemoteDockerImageSha256: test image should be pushable")
}
actual, err := RemoteDockerImageSha256(t.localImageName, t.localImageTag, "http://localhost:5001/v2", "secret",
logger.NewStandardLogger())
if t.want.expectError {
- require.Errorf(suite.Suite.T(), err, "TestRemoteDockerImageSha256: error was expected")
+ require.Errorf(suite.T(), err, "TestRemoteDockerImageSha256: error was expected")
} else {
- require.NoErrorf(suite.Suite.T(), err, "TestRemoteDockerImageSha256: error was NOT expected")
- assert.Equal(suite.Suite.T(), t.want.sha256, actual, fmt.Sprintf("TestRemoteDockerImageSha256: want %s -- got %s", t.want.sha256, actual))
+ require.NoErrorf(suite.T(), err, "TestRemoteDockerImageSha256: error was NOT expected")
+ assert.Equal(suite.T(), t.want.sha256, actual, fmt.Sprintf("TestRemoteDockerImageSha256: want %s -- got %s", t.want.sha256, actual))
}
})
@@ -859,13 +859,13 @@ func (suite *DigestTestSuite) TestExtractImageDigestFromRepoDigest() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
actual, err := extractImageDigestFromRepoDigest(t.imageID, t.repoDigests)
if t.want.expectError {
- require.Errorf(suite.Suite.T(), err, "TestExtractImageDigestFromRepoDigest: error was expected")
+ require.Errorf(suite.T(), err, "TestExtractImageDigestFromRepoDigest: error was expected")
} else {
- require.NoErrorf(suite.Suite.T(), err, "TestExtractImageDigestFromRepoDigest: error was NOT expected")
- assert.Equal(suite.Suite.T(), t.want.sha256, actual, fmt.Sprintf("TestExtractImageDigestFromRepoDigest: want %s -- got %s", t.want.sha256, actual))
+ require.NoErrorf(suite.T(), err, "TestExtractImageDigestFromRepoDigest: error was NOT expected")
+ assert.Equal(suite.T(), t.want.sha256, actual, fmt.Sprintf("TestExtractImageDigestFromRepoDigest: want %s -- got %s", t.want.sha256, actual))
}
})
}
@@ -944,23 +944,23 @@ func (suite *DigestTestSuite) TestGetExcludePathsFromIgnoreFile() {
},
},
} {
- suite.Suite.Run(t.name, func() {
- assert.False(suite.Suite.T(), t.ignoreFileName == "", "ignoreFileName cannot be empty string")
+ suite.Run(t.name, func() {
+ assert.False(suite.T(), t.ignoreFileName == "", "ignoreFileName cannot be empty string")
ignoreFilePath := filepath.Join(suite.tmpDir, t.ignoreFileName)
if t.ignoreFileName != MISSING_FILE_NAME {
testFile, err := os.Create(ignoreFilePath)
- require.NoErrorf(suite.Suite.T(), err, "error creating test file %s: %s", t.ignoreFileName, err)
+ require.NoErrorf(suite.T(), err, "error creating test file %s: %s", t.ignoreFileName, err)
_, err = testFile.Write([]byte(t.content))
- require.NoErrorf(suite.Suite.T(), err, "error writing content to test file %s: %s", t.ignoreFileName, err)
+ require.NoErrorf(suite.T(), err, "error writing content to test file %s: %s", t.ignoreFileName, err)
}
actual, err := excludePathsFromFile(ignoreFilePath)
if t.want.expectError {
- require.Errorf(suite.Suite.T(), err, "TestGetExcludePathsFromIgnoreFile: error was expected: %s", err)
+ require.Errorf(suite.T(), err, "TestGetExcludePathsFromIgnoreFile: error was expected: %s", err)
} else {
- require.NoErrorf(suite.Suite.T(), err, "TestGetExcludePathsFromIgnoreFile: error was NOT expected: %s", err)
- assert.Equal(suite.Suite.T(), t.want.excludePaths, actual, fmt.Sprintf("TestGetExcludePathsFromIgnoreFile: want %s -- got %s", t.want.excludePaths, actual))
+ require.NoErrorf(suite.T(), err, "TestGetExcludePathsFromIgnoreFile: error was NOT expected: %s", err)
+ assert.Equal(suite.T(), t.want.excludePaths, actual, fmt.Sprintf("TestGetExcludePathsFromIgnoreFile: want %s -- got %s", t.want.excludePaths, actual))
}
})
}
diff --git a/internal/docker/docker.go b/internal/docker/docker.go
index a25d0dabc..cd1f3a70d 100644
--- a/internal/docker/docker.go
+++ b/internal/docker/docker.go
@@ -4,6 +4,7 @@ import (
"context"
"encoding/base64"
"encoding/json"
+ "fmt"
"io"
"os"
@@ -24,7 +25,12 @@ func PullDockerImage(imageName string) error {
if err != nil {
return err
}
- defer rc.Close()
+ defer func() {
+ if err := rc.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close image pull reader: %v\n", err)
+ }
+ }()
_, err = io.Copy(os.Stdout, rc)
if err != nil {
return err
@@ -51,7 +57,12 @@ func PushDockerImage(imageName string) error {
if err != nil {
return err
}
- defer rc.Close()
+ defer func() {
+ if err := rc.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close image push reader: %v\n", err)
+ }
+ }()
_, err = io.Copy(os.Stdout, rc)
if err != nil {
return err
diff --git a/internal/docker/docker_test.go b/internal/docker/docker_test.go
index 04fa14a7a..b48af72eb 100644
--- a/internal/docker/docker_test.go
+++ b/internal/docker/docker_test.go
@@ -18,7 +18,7 @@ func (suite *DockerTestSuite) SetupSuite() {
func (suite *DockerTestSuite) SetupTest() {
err := PullDockerImage(suite.testImageName)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
func (suite *DockerTestSuite) TestPullDockerImage() {
@@ -38,12 +38,12 @@ func (suite *DockerTestSuite) TestPullDockerImage() {
},
}
for _, tt := range tests {
- suite.Suite.Run(tt.name, func() {
+ suite.Run(tt.name, func() {
err := PullDockerImage(tt.imageName)
if tt.wantErr {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
})
}
@@ -68,19 +68,19 @@ func (suite *DockerTestSuite) TestPushDockerImage() {
},
}
for _, tt := range tests {
- suite.Suite.Run(tt.name, func() {
+ suite.Run(tt.name, func() {
if tt.tagImageAs != "" {
err := TagDockerImage(tt.imageName, tt.tagImageAs)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
} else {
tt.tagImageAs = tt.imageName
}
err := PushDockerImage(tt.tagImageAs)
if tt.wantErr {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
})
}
@@ -88,26 +88,26 @@ func (suite *DockerTestSuite) TestPushDockerImage() {
func (suite *DockerTestSuite) TestTagDockerImage() {
err := TagDockerImage(suite.testImageName, "new-tag")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
func (suite *DockerTestSuite) TestRemoveDockerImage() {
err := RemoveDockerImage(suite.testImageName)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
err = RemoveDockerImage("non-existing-image")
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
}
func (suite *DockerTestSuite) TestRunDockerContainer() {
id, err := RunDockerContainer(suite.testImageName)
- require.NoError(suite.Suite.T(), err)
- require.NotEmpty(suite.Suite.T(), id)
+ require.NoError(suite.T(), err)
+ require.NotEmpty(suite.T(), id)
err = RemoveDockerContainer(id)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
id, err = RunDockerContainer("not-existing-image")
- require.Error(suite.Suite.T(), err)
- require.Empty(suite.Suite.T(), id)
+ require.Error(suite.T(), err)
+ require.Empty(suite.T(), id)
}
func TestDockerTestSuite(t *testing.T) {
diff --git a/internal/filters/resourceFilter_test.go b/internal/filters/resourceFilter_test.go
index ebd7f95ca..f11ad5362 100644
--- a/internal/filters/resourceFilter_test.go
+++ b/internal/filters/resourceFilter_test.go
@@ -100,13 +100,13 @@ func (suite *FiltersSuite) TestShouldInclude() {
wantErr: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
answer, err := t.filter.ShouldInclude(t.input)
- require.False(suite.Suite.T(), (err != nil) != t.wantErr,
+ require.False(suite.T(), (err != nil) != t.wantErr,
"ShouldInclude() error = %v, wantErr %v", err, t.wantErr)
if !t.wantErr {
- require.NoError(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), answer, t.want)
+ require.NoError(suite.T(), err)
+ require.Equal(suite.T(), answer, t.want)
}
})
}
diff --git a/internal/github/github.go b/internal/github/github.go
index cd04c675b..3815e0099 100644
--- a/internal/github/github.go
+++ b/internal/github/github.go
@@ -233,7 +233,10 @@ func (c *GithubConfig) PREvidenceForCommitV2(commit string) ([]*types.PREvidence
type GitObjectID string
func (v GitObjectID) MarshalGQL(w io.Writer) {
- fmt.Fprintf(w, `"%s"`, string(v))
+ if _, err := fmt.Fprintf(w, `"%s"`, string(v)); err != nil {
+ // Log warning for output error
+ fmt.Printf("warning: failed to write GitObjectID: %v\n", err)
+ }
}
func (c *GithubConfig) PREvidenceForCommitV1(commit string) ([]*types.PREvidence, error) {
diff --git a/internal/github/github_test.go b/internal/github/github_test.go
index 7845e8a69..44017b0e5 100644
--- a/internal/github/github_test.go
+++ b/internal/github/github_test.go
@@ -32,10 +32,10 @@ func (suite *GithubTestSuite) TestNewGithubClientFromToken() {
baseURL: "https://github.example.com",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
client, err := NewGithubClientFromToken(context.Background(), t.token, t.baseURL)
- require.NoErrorf(suite.Suite.T(), err, "was NOT expecting error but got: %s", err)
- require.NotNilf(suite.Suite.T(), client, "client should not be nil")
+ require.NoErrorf(suite.T(), err, "was NOT expecting error but got: %s", err)
+ require.NotNilf(suite.T(), client, "client should not be nil")
})
}
}
@@ -87,9 +87,9 @@ func (suite *GithubTestSuite) TestPREvidenceForCommit() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
if t.requireEnvVars {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
t.config.Token = os.Getenv("KOSLI_GITHUB_TOKEN")
}
if t.commit == "" {
@@ -97,10 +97,10 @@ func (suite *GithubTestSuite) TestPREvidenceForCommit() {
}
prs, err := t.config.PREvidenceForCommitV2(t.commit)
if t.result.wantError {
- require.Errorf(suite.Suite.T(), err, "expected an error but got: %s", err)
+ require.Errorf(suite.T(), err, "expected an error but got: %s", err)
} else {
- require.NoErrorf(suite.Suite.T(), err, "was NOT expecting error but got: %s", err)
- require.Len(suite.Suite.T(), prs, t.result.numberOfPRs)
+ require.NoErrorf(suite.T(), err, "was NOT expecting error but got: %s", err)
+ require.Len(suite.T(), prs, t.result.numberOfPRs)
}
})
}
@@ -137,8 +137,8 @@ func (suite *GithubTestSuite) TestPullRequestsForCommit() {
},
},
} {
- suite.Suite.Run(t.name, func() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
+ suite.Run(t.name, func() {
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
token := os.Getenv("KOSLI_GITHUB_TOKEN")
c := &GithubConfig{
Token: token,
@@ -150,10 +150,10 @@ func (suite *GithubTestSuite) TestPullRequestsForCommit() {
}
prs, err := c.PullRequestsForCommit(t.commit)
if t.result.wantError {
- require.Errorf(suite.Suite.T(), err, "expected an error but got: %s", err)
+ require.Errorf(suite.T(), err, "expected an error but got: %s", err)
} else {
- require.NoErrorf(suite.Suite.T(), err, "was NOT expecting error but got: %s", err)
- require.Lenf(suite.Suite.T(), prs, t.result.numberOfPRs, "expected %d PRs but got %d", t.result.numberOfPRs, len(prs))
+ require.NoErrorf(suite.T(), err, "was NOT expecting error but got: %s", err)
+ require.Lenf(suite.T(), prs, t.result.numberOfPRs, "expected %d PRs but got %d", t.result.numberOfPRs, len(prs))
}
})
}
@@ -199,8 +199,8 @@ func (suite *GithubTestSuite) TestGetPullRequestApprovers() {
},
},
} {
- suite.Suite.Run(t.name, func() {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
+ suite.Run(t.name, func() {
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITHUB_TOKEN"})
token := os.Getenv("KOSLI_GITHUB_TOKEN")
c := &GithubConfig{
Token: token,
@@ -209,10 +209,10 @@ func (suite *GithubTestSuite) TestGetPullRequestApprovers() {
}
approvers, err := c.GetPullRequestApprovers(t.number)
if t.result.wantError {
- require.Errorf(suite.Suite.T(), err, "expected an error but got: %s", err)
+ require.Errorf(suite.T(), err, "expected an error but got: %s", err)
} else {
- require.NoErrorf(suite.Suite.T(), err, "was NOT expecting error but got: %s", err)
- require.ElementsMatchf(suite.Suite.T(), t.result.approvers, approvers, "want approvers: %v, got approvers: %v",
+ require.NoErrorf(suite.T(), err, "was NOT expecting error but got: %s", err)
+ require.ElementsMatchf(suite.T(), t.result.approvers, approvers, "want approvers: %v, got approvers: %v",
t.result.approvers, approvers)
}
})
@@ -236,9 +236,9 @@ func (suite *GithubTestSuite) TestExtractRepoName() {
want: "cli",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
repo := extractRepoName(t.input)
- require.Equalf(suite.Suite.T(), t.want, repo, "expected %s but got %s", t.want, repo)
+ require.Equalf(suite.T(), t.want, repo, "expected %s but got %s", t.want, repo)
})
}
}
diff --git a/internal/gitlab/gitlab_test.go b/internal/gitlab/gitlab_test.go
index 6e317b113..5961640a0 100644
--- a/internal/gitlab/gitlab_test.go
+++ b/internal/gitlab/gitlab_test.go
@@ -27,10 +27,10 @@ func (suite *GitlabTestSuite) TestNewGitlabClientFromToken() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
client, err := t.gitlabConfig.NewGitlabClientFromToken()
- require.NoError(suite.Suite.T(), err)
- require.NotNilf(suite.Suite.T(), client, "client should not be nil")
+ require.NoError(suite.T(), err)
+ require.NotNilf(suite.T(), client, "client should not be nil")
})
}
}
@@ -57,11 +57,11 @@ func (suite *GitlabTestSuite) TestGetClientOptFns() {
expectedURL: "https://gitlab.com/api/v4/",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
client, err := t.gitlabConfig.NewGitlabClientFromToken()
- require.NoError(suite.Suite.T(), err)
- require.NotNilf(suite.Suite.T(), client, "client should not be nil")
- require.Equal(suite.Suite.T(), t.expectedURL, client.BaseURL().String())
+ require.NoError(suite.T(), err)
+ require.NotNilf(suite.T(), client, "client should not be nil")
+ require.Equal(suite.T(), t.expectedURL, client.BaseURL().String())
})
}
}
@@ -72,7 +72,7 @@ func (suite *GitlabTestSuite) TestProjectID() {
Repository: "test",
}
projectID := gitlabConfig.ProjectID()
- require.Equal(suite.Suite.T(), "my_org/test", projectID)
+ require.Equal(suite.T(), "my_org/test", projectID)
}
func (suite *GitlabTestSuite) TestMergeRequestsForCommit() {
@@ -134,17 +134,17 @@ func (suite *GitlabTestSuite) TestMergeRequestsForCommit() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
if t.requireEnvVars {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
t.gitlabConfig.Token = os.Getenv("KOSLI_GITLAB_TOKEN")
}
prs, err := t.gitlabConfig.MergeRequestsForCommit(t.commit)
if t.result.wantError {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.NoError(suite.Suite.T(), err)
- require.Len(suite.Suite.T(), prs, t.result.numberOfPRs)
+ require.NoError(suite.T(), err)
+ require.Len(suite.T(), prs, t.result.numberOfPRs)
}
})
}
@@ -209,17 +209,17 @@ func (suite *GitlabTestSuite) TestPREvidenceForCommit() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
if t.requireEnvVars {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
t.gitlabConfig.Token = os.Getenv("KOSLI_GITLAB_TOKEN")
}
prs, err := t.gitlabConfig.PREvidenceForCommitV2(t.commit)
if t.result.wantError {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.NoError(suite.Suite.T(), err)
- require.Len(suite.Suite.T(), prs, t.result.numberOfPRs)
+ require.NoError(suite.T(), err)
+ require.Len(suite.T(), prs, t.result.numberOfPRs)
}
})
}
@@ -283,17 +283,17 @@ func (suite *GitlabTestSuite) TestGetMergeRequestApprovers() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
if t.requireEnvVars {
- testHelpers.SkipIfEnvVarUnset(suite.Suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
+ testHelpers.SkipIfEnvVarUnset(suite.T(), []string{"KOSLI_GITLAB_TOKEN"})
t.gitlabConfig.Token = os.Getenv("KOSLI_GITLAB_TOKEN")
}
approvers, err := t.gitlabConfig.GetMergeRequestApprovers(t.mrIID, 1)
if t.result.wantError {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.NoError(suite.Suite.T(), err)
- require.ElementsMatch(suite.Suite.T(), t.result.approvers, approvers)
+ require.NoError(suite.T(), err)
+ require.ElementsMatch(suite.T(), t.result.approvers, approvers)
}
})
}
diff --git a/internal/gitview/gitView_test.go b/internal/gitview/gitView_test.go
index 97b9daa28..212ffb431 100644
--- a/internal/gitview/gitView_test.go
+++ b/internal/gitview/gitView_test.go
@@ -2,11 +2,12 @@ package gitview
import (
"fmt"
- "github.com/kosli-dev/cli/internal/jira"
"os"
"path/filepath"
"testing"
+ "github.com/kosli-dev/cli/internal/jira"
+
"github.com/go-git/go-billy/v5/osfs"
git "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/cache"
@@ -30,27 +31,27 @@ func (suite *GitViewTestSuite) SetupSuite() {
func (suite *GitViewTestSuite) SetupTest() {
var err error
suite.tmpDir, err = os.MkdirTemp("", "testRepoDir")
- require.NoError(suite.Suite.T(), err, "error creating a temporary test directory")
+ require.NoError(suite.T(), err, "error creating a temporary test directory")
}
// clean up tmpDir after each test
func (suite *GitViewTestSuite) AfterTest() {
err := os.RemoveAll(suite.tmpDir)
- require.NoErrorf(suite.Suite.T(), err, "error cleaning up the temporary test directory %s", suite.tmpDir)
+ require.NoErrorf(suite.T(), err, "error cleaning up the temporary test directory %s", suite.tmpDir)
}
func (suite *GitViewTestSuite) TestNewGitView() {
dirPath := filepath.Join(suite.tmpDir, "repoName")
_, worktree, err := initializeRepoAndCommit(dirPath, 1)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
gv, err := New(worktree.Filesystem.Root())
- require.NoError(suite.Suite.T(), err)
- require.NotNil(suite.Suite.T(), gv)
- require.Equal(suite.Suite.T(), worktree.Filesystem.Root(), gv.repositoryRoot)
+ require.NoError(suite.T(), err)
+ require.NotNil(suite.T(), gv)
+ require.Equal(suite.T(), worktree.Filesystem.Root(), gv.repositoryRoot)
_, err = New(filepath.Join(suite.tmpDir, "non-existing"))
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
}
func (suite *GitViewTestSuite) TestCommitsBetween() {
@@ -105,20 +106,20 @@ func (suite *GitViewTestSuite) TestCommitsBetween() {
expectError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
repoName := fmt.Sprintf("test-%d", i)
dirPath := filepath.Join(suite.tmpDir, repoName)
_, worktree, err := initializeRepoAndCommit(dirPath, t.commitsNumber)
- require.NoErrorf(suite.Suite.T(), err, "error creating test repository %s", repoName)
- // suite.Suite.T().Logf("repo dir is: %s", worktree.Filesystem.Root())
+ require.NoErrorf(suite.T(), err, "error creating test repository %s", repoName)
+ // suite.T().Logf("repo dir is: %s", worktree.Filesystem.Root())
gv, err := New(worktree.Filesystem.Root())
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
commits, err := gv.CommitsBetween(t.oldestCommit, t.newestCommit, suite.logger)
if t.expectError {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.Len(suite.Suite.T(), commits, t.expectedNumberOfCommits)
+ require.Len(suite.T(), commits, t.expectedNumberOfCommits)
}
})
}
@@ -182,20 +183,20 @@ func (suite *GitViewTestSuite) TestChangeLog() {
expectedNumberOfCommits: 1,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
repoName := fmt.Sprintf("test-%d", i)
dirPath := filepath.Join(suite.tmpDir, repoName)
_, worktree, err := initializeRepoAndCommit(dirPath, t.commitsNumber)
- require.NoErrorf(suite.Suite.T(), err, "error creating test repository %s", repoName)
- // suite.Suite.T().Logf("repo dir is: %s", worktree.Filesystem.Root())
+ require.NoErrorf(suite.T(), err, "error creating test repository %s", repoName)
+ // suite.T().Logf("repo dir is: %s", worktree.Filesystem.Root())
gv, err := New(worktree.Filesystem.Root())
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
commitsInfo, err := gv.ChangeLog(t.currentCommit, t.previousCommit, suite.logger)
if t.expectError {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.Len(suite.Suite.T(), commitsInfo, t.expectedNumberOfCommits)
+ require.Len(suite.T(), commitsInfo, t.expectedNumberOfCommits)
}
})
}
@@ -204,15 +205,15 @@ func (suite *GitViewTestSuite) TestChangeLog() {
func (suite *GitViewTestSuite) TestRepoURL() {
dirPath := filepath.Join(suite.tmpDir, "repoName")
_, worktree, err := initializeRepoAndCommit(dirPath, 1)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
gv, err := New(worktree.Filesystem.Root())
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
// the created repo does not have origin remote yet
_, err = gv.RepoURL()
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
expectedError := fmt.Sprintf("remote('origin') is not found in git repository: %s", gv.repositoryRoot)
- require.Equal(suite.Suite.T(), expectedError, err.Error())
+ require.Equal(suite.T(), expectedError, err.Error())
}
func (suite *GitViewTestSuite) TestExtractRepoURLFromRemote() {
@@ -237,9 +238,9 @@ func (suite *GitViewTestSuite) TestExtractRepoURLFromRemote() {
want: "https://github.com/kosli-dev/cli",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
actual, _ := ExtractRepoURLFromRemote(t.remoteURL)
- require.Equal(suite.Suite.T(), t.want, actual)
+ require.Equal(suite.T(), t.want, actual)
})
}
}
@@ -272,10 +273,10 @@ func (suite *GitViewTestSuite) TestRemoveUsernamePasswordFromURL() {
wantError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
actual, err := removeUsernamePasswordFromURL(t.inputURL)
- require.Equal(suite.Suite.T(), t.wantError, err != nil)
- require.Equal(suite.Suite.T(), t.want, actual)
+ require.Equal(suite.T(), t.wantError, err != nil)
+ require.Equal(suite.T(), t.want, actual)
})
}
}
@@ -318,9 +319,9 @@ func (suite *GitViewTestSuite) TestGetCommitURL() {
want: "https://custom-domain-name.com/kosli-dev/cli/commit/089615f84caedd6280689da694e71052cbdfb84d",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
actual := getCommitURL(t.repoURL, t.commitHash)
- require.Equal(suite.Suite.T(), t.want, actual)
+ require.Equal(suite.T(), t.want, actual)
})
}
}
@@ -328,38 +329,38 @@ func (suite *GitViewTestSuite) TestGetCommitURL() {
func (suite *GitViewTestSuite) TestGetCommitInfoFromCommitSHA() {
dirPath := filepath.Join(suite.tmpDir, "repoName")
_, worktree, err := initializeRepoAndCommit(dirPath, 1)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
gv, err := New(worktree.Filesystem.Root())
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
_, err = gv.GetCommitInfoFromCommitSHA("58a9461c5a42d83bd5731485a72ddae542ac99d8", true, []string{})
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
expected := "failed to resolve git reference 58a9461c5a42d83bd5731485a72ddae542ac99d8: reference not found"
- require.Equal(suite.Suite.T(), expected, err.Error())
+ require.Equal(suite.T(), expected, err.Error())
_, err = gv.GetCommitInfoFromCommitSHA("HEAD~2", true, []string{})
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
expected = "failed to resolve git reference HEAD~2: EOF"
- require.Equal(suite.Suite.T(), expected, err.Error())
+ require.Equal(suite.T(), expected, err.Error())
commitInfo, err := gv.GetCommitInfoFromCommitSHA("HEAD", false, []string{})
- require.NoError(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), "Added file 1", commitInfo.Message)
- require.Equal(suite.Suite.T(), "master", commitInfo.Branch)
- require.Empty(suite.Suite.T(), commitInfo.Parents)
- require.Empty(suite.Suite.T(), commitInfo.URL)
+ require.NoError(suite.T(), err)
+ require.Equal(suite.T(), "Added file 1", commitInfo.Message)
+ require.Equal(suite.T(), "master", commitInfo.Branch)
+ require.Empty(suite.T(), commitInfo.Parents)
+ require.Empty(suite.T(), commitInfo.URL)
commitInfo, err = gv.GetCommitInfoFromCommitSHA("HEAD", false, []string{"author", "message", "branch"})
- require.NoError(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), redactedCommitInfoValue, commitInfo.Author)
- require.Equal(suite.Suite.T(), redactedCommitInfoValue, commitInfo.Message)
- require.Equal(suite.Suite.T(), redactedCommitInfoValue, commitInfo.Branch)
+ require.NoError(suite.T(), err)
+ require.Equal(suite.T(), redactedCommitInfoValue, commitInfo.Author)
+ require.Equal(suite.T(), redactedCommitInfoValue, commitInfo.Message)
+ require.Equal(suite.T(), redactedCommitInfoValue, commitInfo.Branch)
}
func (suite *GitViewTestSuite) TestMatchPatternInCommitMessageORBranchName() {
_, workTree, fs, err := testHelpers.InitializeGitRepo(suite.tmpDir)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
defaultJiraPattern := "[A-Z][A-Z0-9]{1,9}-[0-9]+"
for _, t := range []struct {
@@ -487,25 +488,25 @@ func (suite *GitViewTestSuite) TestMatchPatternInCommitMessageORBranchName() {
wantError: false,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
if t.commitSha == "" {
t.commitSha, err = testHelpers.CommitToRepo(workTree, fs, t.commitMessage)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
}
if t.branchName != "" {
err := testHelpers.CheckoutNewBranch(workTree, t.branchName)
- require.NoError(suite.Suite.T(), err)
- defer testHelpers.CheckoutMaster(workTree, suite.Suite.T())
+ require.NoError(suite.T(), err)
+ defer testHelpers.CheckoutMaster(workTree, suite.T())
}
gitView, err := New(suite.tmpDir)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
actual, _, err := gitView.MatchPatternInCommitMessageORBranchName(t.pattern, t.commitSha, t.secondarySource, t.ignoreBranchMatch)
- require.True(suite.Suite.T(), (err != nil) == t.wantError)
- require.ElementsMatch(suite.Suite.T(), t.want, actual)
+ require.True(suite.T(), (err != nil) == t.wantError)
+ require.ElementsMatch(suite.T(), t.want, actual)
})
}
@@ -513,16 +514,16 @@ func (suite *GitViewTestSuite) TestMatchPatternInCommitMessageORBranchName() {
func (suite *GitViewTestSuite) TestResolveRevision() {
_, workTree, fs, err := testHelpers.InitializeGitRepo(suite.tmpDir)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
FirstCommitSha, err := testHelpers.CommitToRepo(workTree, fs, "Test commit message 1")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
SecondCommitSha, err := testHelpers.CommitToRepo(workTree, fs, "Test commit message 2")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
ThirdCommitSha, err := testHelpers.CommitToRepo(workTree, fs, "Test commit message 3")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
for _, t := range []struct {
name string
@@ -560,14 +561,14 @@ func (suite *GitViewTestSuite) TestResolveRevision() {
wantError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
gitView, err := New(suite.tmpDir)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
actual, err := gitView.ResolveRevision(t.commitSHAOrRef)
- require.True(suite.Suite.T(), (err != nil) == t.wantError)
- require.Equal(suite.Suite.T(), t.want, actual)
+ require.True(suite.T(), (err != nil) == t.wantError)
+ require.Equal(suite.T(), t.want, actual)
})
}
diff --git a/internal/kube/kube_test.go b/internal/kube/kube_test.go
index ec5140d54..2c8179622 100644
--- a/internal/kube/kube_test.go
+++ b/internal/kube/kube_test.go
@@ -38,12 +38,12 @@ func (suite *KubeTestSuite) SetupSuite() {
createOptions := cluster.CreateWithWaitForReady(300 * time.Second)
suite.provider = cluster.NewProvider(cluster.ProviderWithDocker())
err := suite.provider.Create(suite.clusterName, createOptions)
- require.NoError(suite.Suite.T(), err, "creating test k8s cluster failed")
+ require.NoError(suite.T(), err, "creating test k8s cluster failed")
suite.tmpDir, err = os.MkdirTemp("", "testDir")
- require.NoError(suite.Suite.T(), err, "error creating a temporary test directory")
+ require.NoError(suite.T(), err, "error creating a temporary test directory")
suite.kubeConfigPath = filepath.Join(suite.tmpDir, "kubeconfig")
err = suite.provider.ExportKubeConfig(suite.clusterName, suite.kubeConfigPath)
- require.NoError(suite.Suite.T(), err, "exporting kubeconfig failed")
+ require.NoError(suite.T(), err, "exporting kubeconfig failed")
ctx := context.Background()
suite.clientset = suite.getK8sClient(ctx)
}
@@ -51,20 +51,20 @@ func (suite *KubeTestSuite) SetupSuite() {
// delete the KIND cluster and the tmp dir after the suite execution
func (suite *KubeTestSuite) TearDownSuite() {
err := suite.provider.Delete(suite.clusterName, suite.kubeConfigPath)
- require.NoError(suite.Suite.T(), err, "deleting KIND cluster failed")
+ require.NoError(suite.T(), err, "deleting KIND cluster failed")
err = os.RemoveAll(suite.tmpDir)
- require.NoErrorf(suite.Suite.T(), err, "error cleaning up the temporary test directory %s", suite.tmpDir)
+ require.NoErrorf(suite.T(), err, "error cleaning up the temporary test directory %s", suite.tmpDir)
}
func (suite *KubeTestSuite) AfterTest(_, _ string) {
ctx := context.Background()
namespaces, err := suite.clientset.Clientset.CoreV1().Namespaces().List(ctx, metav1.ListOptions{LabelSelector: suite.namespacesLabel})
- require.NoErrorf(suite.Suite.T(), err, "error listing test namespaces with label %s", suite.namespacesLabel)
+ require.NoErrorf(suite.T(), err, "error listing test namespaces with label %s", suite.namespacesLabel)
for _, ns := range namespaces.Items {
err = suite.clientset.Clientset.CoreV1().Namespaces().Delete(ctx, ns.Name, metav1.DeleteOptions{})
- require.NoErrorf(suite.Suite.T(), err, "error deleting namespace %s", ns.Name)
+ require.NoErrorf(suite.T(), err, "error deleting namespace %s", ns.Name)
}
}
@@ -160,7 +160,7 @@ func (suite *KubeTestSuite) TestGetPodsData() {
wantMinimumPods: 2,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
// create namespaces
for _, ns := range t.args.namespaces {
suite.createNamespace(ns)
@@ -173,7 +173,7 @@ func (suite *KubeTestSuite) TestGetPodsData() {
}
// Get pods data
podsData, err := suite.clientset.GetPodsData(t.args.filter, logger.NewStandardLogger())
- require.NoErrorf(suite.Suite.T(), err, "error getting pods data for test %s", t.name)
+ require.NoErrorf(suite.T(), err, "error getting pods data for test %s", t.name)
actual := []*comparablePodData{}
for _, pd := range podsData {
actual = append(actual, &comparablePodData{
@@ -183,10 +183,10 @@ func (suite *KubeTestSuite) TestGetPodsData() {
})
}
if len(t.want) > 0 {
- require.Equal(suite.Suite.T(), t.want, actual, fmt.Sprintf("want: %v -- got: %v", t.want, actual))
+ require.Equal(suite.T(), t.want, actual, fmt.Sprintf("want: %v -- got: %v", t.want, actual))
} else if len(t.wantSubset) > 0 {
- require.Subset(suite.Suite.T(), actual, t.wantSubset)
- require.GreaterOrEqual(suite.Suite.T(), len(actual), t.wantMinimumPods)
+ require.Subset(suite.T(), actual, t.wantSubset)
+ require.GreaterOrEqual(suite.T(), len(actual), t.wantMinimumPods)
}
})
}
@@ -201,8 +201,8 @@ func (suite *KubeTestSuite) TestGetPodsDataWithThrottling() {
startTime := time.Now()
_, err := suite.clientset.GetPodsData(&filters.ResourceFilterOptions{IncludeNamesRegex: []string{"^ns-.*"}}, logger.NewStandardLogger())
duration := time.Since(startTime)
- require.NoErrorf(suite.Suite.T(), err, "error getting pods data for test GetPodsDataWithThrottling")
- require.LessOrEqual(suite.Suite.T(), duration, 5*time.Second, "GetPodsData should complete within 5 seconds, but took %v", duration)
+ require.NoErrorf(suite.T(), err, "error getting pods data for test GetPodsDataWithThrottling")
+ require.LessOrEqual(suite.T(), duration, 5*time.Second, "GetPodsData should complete within 5 seconds, but took %v", duration)
}
func (suite *KubeTestSuite) TestFilterNamespaces() {
@@ -231,13 +231,13 @@ func (suite *KubeTestSuite) TestFilterNamespaces() {
want: []string{},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
result, err := suite.clientset.filterNamespaces(t.args.filter)
if t.expectError {
- require.Error(suite.Suite.T(), err, "error was expected but got none.")
+ require.Error(suite.T(), err, "error was expected but got none.")
} else {
- require.NoErrorf(suite.Suite.T(), err, "error was NOT expected but got: %v.", err)
- require.Equal(suite.Suite.T(), t.want, result, "TestFilterNamespaces: got %v -- want %v", result, t.want)
+ require.NoErrorf(suite.T(), err, "error was NOT expected but got: %v.", err)
+ require.Equal(suite.T(), t.want, result, "TestFilterNamespaces: got %v -- want %v", result, t.want)
}
})
}
@@ -247,7 +247,7 @@ func (suite *KubeTestSuite) TestFilterNamespaces() {
// getK8sClient creates a k8s client set
func (suite *KubeTestSuite) getK8sClient(ctx context.Context) *K8SConnection {
clientset, err := NewK8sClientSet(suite.kubeConfigPath)
- require.NoErrorf(suite.Suite.T(), err, "error creating k8s client set for kubeconfig %s", suite.kubeConfigPath)
+ require.NoErrorf(suite.T(), err, "error creating k8s client set for kubeconfig %s", suite.kubeConfigPath)
return clientset
}
@@ -263,7 +263,7 @@ func (suite *KubeTestSuite) createNamespace(name string) {
},
}
_, err := suite.clientset.Clientset.CoreV1().Namespaces().Create(ctx, namespace, metav1.CreateOptions{})
- require.NoErrorf(suite.Suite.T(), err, "error creating namespace %s", name)
+ require.NoErrorf(suite.T(), err, "error creating namespace %s", name)
}
// getPodPayload creates a k8s Pod struct
@@ -292,9 +292,9 @@ func (suite *KubeTestSuite) getPodPayload(name string, images []string) *corev1.
func (suite *KubeTestSuite) createPod(namespace string, pod *corev1.Pod) {
ctx := context.Background()
_, err := suite.clientset.Clientset.CoreV1().Pods(namespace).Create(ctx, pod, metav1.CreateOptions{})
- require.NoErrorf(suite.Suite.T(), err, "error creating pod %s", pod.Name)
+ require.NoErrorf(suite.T(), err, "error creating pod %s", pod.Name)
err = e2epod.WaitForPodNameRunningInNamespace(ctx, suite.clientset, pod.Name, namespace)
- require.NoErrorf(suite.Suite.T(), err, "error waiting for pod %s to be running in namespace %s", pod.Name, namespace)
+ require.NoErrorf(suite.T(), err, "error waiting for pod %s to be running in namespace %s", pod.Name, namespace)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/internal/output/output.go b/internal/output/output.go
index 12d58ea8a..508717465 100644
--- a/internal/output/output.go
+++ b/internal/output/output.go
@@ -25,6 +25,8 @@ func PrintJson(raw string, out io.Writer, page int) error {
return err
}
- fmt.Fprint(out, prettyJSON.String())
+ if _, err := fmt.Fprint(out, prettyJSON.String()); err != nil {
+ return fmt.Errorf("failed to write JSON output: %v", err)
+ }
return nil
}
diff --git a/internal/requests/requests.go b/internal/requests/requests.go
index a2ce97536..4f648ebed 100644
--- a/internal/requests/requests.go
+++ b/internal/requests/requests.go
@@ -53,7 +53,7 @@ func (cl *CustomLogger) Printf(format string, args ...interface{}) {
msg = strings.TrimPrefix(msg, "[DEBUG]")
// Call the underlying log.Logger's Printf method with the cleaned message
- cl.Logger.Print(msg)
+ cl.Print(msg)
}
func NewKosliClient(httpProxyURL string, maxAPIRetries int, debug bool, logger *logger.Logger) (*Client, error) {
@@ -99,7 +99,7 @@ type RequestParams struct {
DryRun bool
}
-func (p *RequestParams) newHTTPRequest() (*http.Request, map[string]interface{}, error) {
+func (p *RequestParams) newHTTPRequest() (*http.Request, map[string]any, error) {
if len(p.AdditionalHeaders) == 0 {
p.AdditionalHeaders = make(map[string]string)
}
@@ -154,16 +154,22 @@ func (p *RequestParams) newHTTPRequest() (*http.Request, map[string]interface{},
// - request body for the multipart form in the form of bytes.Buffer
// - a map of the JSON fields to log during dry-run
// - error, if any occurred
-func createMultipartRequestBody(items []FormItem) (string, *bytes.Buffer, map[string]interface{}, error) {
+func createMultipartRequestBody(items []FormItem) (string, *bytes.Buffer, map[string]any, error) {
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
- defer writer.Close()
+ defer func() {
+ if err := writer.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close multipart writer: %v\n", err)
+ }
+ }()
// Map to store the JSON fields for logging during dry-run
jsonFields := make(map[string]interface{})
for _, item := range items {
- if item.Type == "field" {
+ switch item.Type {
+ case "field":
part, err := writer.CreateFormField(item.FieldName)
if err != nil {
return "", body, nil, err
@@ -182,14 +188,19 @@ func createMultipartRequestBody(items []FormItem) (string, *bytes.Buffer, map[st
// Add the JSON field to jsonFields map for dry-run logging
jsonFields[item.FieldName] = jsonBytes
- } else if item.Type == "file" {
+ case "file":
// Handle file upload separately
filename := item.Content.(string)
file, err := os.Open(filename)
if err != nil {
return "", body, nil, err
}
- defer file.Close()
+ defer func() {
+ if err := file.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close file %s: %v\n", filename, err)
+ }
+ }()
part, err := writer.CreateFormFile(item.FieldName, filepath.Base(filename))
if err != nil {
@@ -240,7 +251,11 @@ func (c *Client) Do(p *RequestParams) (*HTTPResponse, error) {
return nil, fmt.Errorf("%v", err)
}
- defer resp.Body.Close()
+ defer func() {
+ if err := resp.Body.Close(); err != nil {
+ c.Logger.Warn("failed to close response body: %v", err)
+ }
+ }()
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read response from %s request to %s : %v", req.Method, req.URL, err)
@@ -249,7 +264,7 @@ func (c *Client) Do(p *RequestParams) (*HTTPResponse, error) {
c.Logger.Debug("request made to %s and got status %d", req.URL, resp.StatusCode)
if resp.StatusCode != 200 && resp.StatusCode != 201 {
- var respBody interface{}
+ var respBody any
err := json.Unmarshal([]byte(body), &respBody)
if err != nil {
return &HTTPResponse{}, err
@@ -260,7 +275,7 @@ func (c *Client) Do(p *RequestParams) (*HTTPResponse, error) {
} else if reflect.ValueOf(respBody).Kind() == reflect.Map {
// Error response from kosli application SW contains a "message"
// Error response from the API schema validation contains a "message" and a list of "errors"
- respBodyMap := respBody.(map[string]interface{})
+ respBodyMap := respBody.(map[string]any)
message, ok := respBodyMap["message"]
if ok {
errors, ok := respBodyMap["errors"]
@@ -280,7 +295,7 @@ func (c *Client) Do(p *RequestParams) (*HTTPResponse, error) {
}
}
-func (c *Client) PayloadOutput(req *http.Request, jsonFields map[string]interface{}, message string) error {
+func (c *Client) PayloadOutput(req *http.Request, jsonFields map[string]any, message string) error {
// Check the content type to determine what to log
contentType := req.Header.Get("Content-Type")
if strings.Contains(contentType, "multipart/form-data") {
diff --git a/internal/requests/requests_test.go b/internal/requests/requests_test.go
index dec330da8..ead8c64e8 100644
--- a/internal/requests/requests_test.go
+++ b/internal/requests/requests_test.go
@@ -98,15 +98,15 @@ func (suite *RequestsTestSuite) TestNewKosliClient() {
wantError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
client, err := NewKosliClient(t.httpProxy, t.maxRetries, t.debug, logger.NewStandardLogger())
if !t.wantError {
- require.NoError(suite.Suite.T(), err)
- require.NotNil(suite.Suite.T(), client)
- require.Equal(suite.Suite.T(), t.maxRetries, client.MaxAPIRetries)
- require.Equal(suite.Suite.T(), t.debug, client.Debug)
+ require.NoError(suite.T(), err)
+ require.NotNil(suite.T(), client)
+ require.Equal(suite.T(), t.maxRetries, client.MaxAPIRetries)
+ require.Equal(suite.T(), t.debug, client.Debug)
} else {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
}
})
@@ -225,33 +225,33 @@ func (suite *RequestsTestSuite) TestNewHttpRequest() {
wantError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
req, _, err := t.params.newHTTPRequest()
if t.wantError {
- require.Error(suite.Suite.T(), err)
+ require.Error(suite.T(), err)
} else {
- require.NoError(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), t.params.Method, req.Method)
- require.Equal(suite.Suite.T(), "Kosli/"+version.GetVersion(), req.UserAgent())
+ require.NoError(suite.T(), err)
+ require.Equal(suite.T(), t.params.Method, req.Method)
+ require.Equal(suite.T(), "Kosli/"+version.GetVersion(), req.UserAgent())
if t.expectedContentTypePrefix == "" {
t.expectedContentTypePrefix = "application/json; charset=utf-8"
}
- require.True(suite.Suite.T(), strings.HasPrefix(req.Header.Get("Content-Type"), t.expectedContentTypePrefix))
+ require.True(suite.T(), strings.HasPrefix(req.Header.Get("Content-Type"), t.expectedContentTypePrefix))
if t.params.Username != "" || t.params.Password != "" {
user, pass, ok := req.BasicAuth()
- require.True(suite.Suite.T(), ok)
- require.Equal(suite.Suite.T(), t.params.Username, user)
- require.Equal(suite.Suite.T(), t.params.Password, pass)
+ require.True(suite.T(), ok)
+ require.Equal(suite.T(), t.params.Username, user)
+ require.Equal(suite.T(), t.params.Password, pass)
}
if t.params.Token != "" {
- require.Equal(suite.Suite.T(), fmt.Sprintf("Bearer %s", t.params.Token), req.Header.Get("Authorization"))
+ require.Equal(suite.T(), fmt.Sprintf("Bearer %s", t.params.Token), req.Header.Get("Authorization"))
}
for k, v := range t.params.AdditionalHeaders {
- require.Equal(suite.Suite.T(), v, req.Header.Get(k))
+ require.Equal(suite.T(), v, req.Header.Get(k))
}
if t.params.Method == http.MethodGet {
- require.Nil(suite.Suite.T(), req.Body)
+ require.Nil(suite.T(), req.Body)
}
}
})
@@ -378,20 +378,20 @@ func (suite *RequestsTestSuite) TestDo() {
expectedErrorMsg: "unexpected end of JSON input",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
buf := new(bytes.Buffer)
client, err := NewKosliClient("", 1, false, logger.NewLogger(buf, buf, false))
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
resp, err := client.Do(t.params)
if t.wantError {
- require.Error(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), t.expectedErrorMsg, err.Error())
+ require.Error(suite.T(), err)
+ require.Equal(suite.T(), t.expectedErrorMsg, err.Error())
} else {
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
output := buf.String()
- require.Equal(suite.Suite.T(), t.expectedLog, output)
+ require.Equal(suite.T(), t.expectedLog, output)
if t.expectedBody != "" {
- require.Equal(suite.Suite.T(), t.expectedBody, resp.Body)
+ require.Equal(suite.T(), t.expectedBody, resp.Body)
}
}
@@ -440,17 +440,17 @@ func (suite *RequestsTestSuite) TestDebugPayloadOutput() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
buf := new(bytes.Buffer)
client, err := NewKosliClient("", 1, true, logger.NewLogger(buf, buf, false))
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
resp, err := client.Do(t.params)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
output := buf.String()
- require.Equal(suite.Suite.T(), t.expectedLog, output)
+ require.Equal(suite.T(), t.expectedLog, output)
if t.expectedBody != "" {
- require.Equal(suite.Suite.T(), t.expectedBody, resp.Body)
+ require.Equal(suite.T(), t.expectedBody, resp.Body)
}
})
}
@@ -514,10 +514,10 @@ func (suite *RequestsTestSuite) TestCreateMultipartRequestBody() {
wantError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
contentType, _, _, err := createMultipartRequestBody(t.formItems)
- require.True(suite.Suite.T(), t.wantError == (err != nil))
- require.True(suite.Suite.T(), strings.HasPrefix(contentType, t.expectedContentTypePrefix))
+ require.True(suite.T(), t.wantError == (err != nil))
+ require.True(suite.T(), strings.HasPrefix(contentType, t.expectedContentTypePrefix))
})
}
}
diff --git a/internal/security/security_test.go b/internal/security/security_test.go
index 9b7521fea..24acd5e0c 100644
--- a/internal/security/security_test.go
+++ b/internal/security/security_test.go
@@ -25,17 +25,17 @@ func (suite *SecurityTestSuite) TestAESEncryptionDecryption() {
{input: "S3cur3P@55w0rd"},
{input: "3st!ng123"},
} {
- suite.Suite.Run(t.input, func() {
+ suite.Run(t.input, func() {
keyBytes, err := GenerateRandomAESKey()
- require.NoError(suite.Suite.T(), err)
- require.Len(suite.Suite.T(), keyBytes, 32)
+ require.NoError(suite.T(), err)
+ require.Len(suite.T(), keyBytes, 32)
encryptedBytes, err := AESEncrypt(t.input, keyBytes)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
decrypted_bytes, err := AESDecrypt(encryptedBytes, keyBytes)
- require.NoError(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), t.input, string(decrypted_bytes))
+ require.NoError(suite.T(), err)
+ require.Equal(suite.T(), t.input, string(decrypted_bytes))
})
}
@@ -46,10 +46,10 @@ func (suite *SecurityTestSuite) TestSetSecretInCredentialsStore() {
secretName := "topsecret"
secretValue := "securepassword"
err := SetSecretInCredentialsStore(secretName, secretValue)
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
returnedSecretValue, err := GetSecretFromCredentialsStore(secretName)
- require.NoError(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), secretValue, returnedSecretValue)
+ require.NoError(suite.T(), err)
+ require.Equal(suite.T(), secretValue, returnedSecretValue)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/internal/server/server.go b/internal/server/server.go
index 79d688bf8..8073e2004 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -87,7 +87,7 @@ func getArtifactDataForPath(path, artifactName string, excludePaths []string, lo
if utils.Contains(excludePaths, path) {
return data, fmt.Errorf("path [%s] is both included and excluded", path)
}
- fingerprint, err = digest.FileSha256(path)
+ fingerprint, err = digest.FileSha256(path, logger)
} else {
fingerprint, err = digest.DirSha256(path, excludePaths, logger)
}
diff --git a/internal/server/server_test.go b/internal/server/server_test.go
index 3e1a6b018..b02a73f8c 100644
--- a/internal/server/server_test.go
+++ b/internal/server/server_test.go
@@ -25,13 +25,13 @@ type ServerTestSuite struct {
func (suite *ServerTestSuite) SetupTest() {
var err error
suite.tmpDir, err = os.MkdirTemp("", "testDir")
- require.NoError(suite.Suite.T(), err, "error creating a temporary test directory")
+ require.NoError(suite.T(), err, "error creating a temporary test directory")
}
// clean up tmpDir after each test
func (suite *ServerTestSuite) AfterTest() {
err := os.RemoveAll(suite.tmpDir)
- require.NoErrorf(suite.Suite.T(), err, "error cleaning up the temporary test directory %s", suite.tmpDir)
+ require.NoErrorf(suite.T(), err, "error cleaning up the temporary test directory %s", suite.tmpDir)
}
type fileSystemEntry struct {
@@ -161,7 +161,7 @@ func (suite *ServerTestSuite) TestCreateServerArtifactsData() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
suite.setupTestFileSystem(suite.tmpDir, t.fileSystem)
if t.excludePaths == nil {
t.excludePaths = []string{}
@@ -172,13 +172,13 @@ func (suite *ServerTestSuite) TestCreateServerArtifactsData() {
}
serverData, err := CreateServerArtifactsData(t.paths, t.excludePaths, logger.NewStandardLogger())
- require.NoErrorf(suite.Suite.T(), err, "error creating server artifact data: %v", err)
+ require.NoErrorf(suite.T(), err, "error creating server artifact data: %v", err)
digestsList := []map[string]string{}
for i, data := range serverData {
digestsList = append(digestsList, data.Digests)
- assert.NotEqual(suite.Suite.T(), int64(0), data.CreationTimestamp, fmt.Sprintf("TestCreateServerArtifactsData: %s , got: %v, should not be 0, at index: %d", t.name, data.CreationTimestamp, i))
+ assert.NotEqual(suite.T(), int64(0), data.CreationTimestamp, fmt.Sprintf("TestCreateServerArtifactsData: %s , got: %v, should not be 0, at index: %d", t.name, data.CreationTimestamp, i))
}
expected := []map[string]string{}
@@ -189,7 +189,7 @@ func (suite *ServerTestSuite) TestCreateServerArtifactsData() {
}
expected = append(expected, tmpMap)
}
- assert.ElementsMatch(suite.Suite.T(), expected, digestsList, fmt.Sprintf("TestCreateServerArtifactsData: %s , got: %v -- want: %v", t.name, digestsList, expected))
+ assert.ElementsMatch(suite.T(), expected, digestsList, fmt.Sprintf("TestCreateServerArtifactsData: %s , got: %v -- want: %v", t.name, digestsList, expected))
})
}
@@ -199,7 +199,7 @@ func (suite *ServerTestSuite) setupTestFileSystem(tmpDir string, fs map[string]f
for entryName, fsEntry := range fs {
dirPath := filepath.Join(tmpDir, entryName)
err := os.Mkdir(dirPath, 0777)
- require.NoErrorf(suite.Suite.T(), err, "error creating test dir %s", entryName)
+ require.NoErrorf(suite.T(), err, "error creating test dir %s", entryName)
for fileName, fileContent := range fsEntry.files {
suite.createFileWithContent(filepath.Join(dirPath, fileName), fileContent)
@@ -244,7 +244,7 @@ func (suite *ServerTestSuite) TestCreateServerArtifactsDataWithFiles() {
want: []map[string]string{},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
paths := []string{}
path := filepath.Join(suite.tmpDir, t.args.name)
paths = append(paths, path)
@@ -254,15 +254,15 @@ func (suite *ServerTestSuite) TestCreateServerArtifactsDataWithFiles() {
serverData, err := CreateServerArtifactsData(paths, []string{}, logger.NewStandardLogger())
if t.expectError {
- require.Errorf(suite.Suite.T(), err, "was expecting error during creating server artifact data but got none")
+ require.Errorf(suite.T(), err, "was expecting error during creating server artifact data but got none")
} else {
- require.NoErrorf(suite.Suite.T(), err, "error creating server artifact data was NOT expected: %v", err)
+ require.NoErrorf(suite.T(), err, "error creating server artifact data was NOT expected: %v", err)
digestsList := []map[string]string{}
for i, data := range serverData {
digestsList = append(digestsList, data.Digests)
- assert.NotEqual(suite.Suite.T(), int64(0), data.CreationTimestamp, fmt.Sprintf("TestCreateServerArtifactsDataWithFiles: %s , got: %v, should not be 0, at index: %d", t.name, data.CreationTimestamp, i))
+ assert.NotEqual(suite.T(), int64(0), data.CreationTimestamp, fmt.Sprintf("TestCreateServerArtifactsDataWithFiles: %s , got: %v, should not be 0, at index: %d", t.name, data.CreationTimestamp, i))
}
expected := []map[string]string{}
@@ -273,7 +273,7 @@ func (suite *ServerTestSuite) TestCreateServerArtifactsDataWithFiles() {
}
expected = append(expected, tmpMap)
}
- assert.ElementsMatch(suite.Suite.T(), expected, digestsList, fmt.Sprintf("TestCreateServerArtifactsDataWithFiles: %s , got: %v -- want: %v", t.name, digestsList, expected))
+ assert.ElementsMatch(suite.T(), expected, digestsList, fmt.Sprintf("TestCreateServerArtifactsDataWithFiles: %s , got: %v -- want: %v", t.name, digestsList, expected))
}
})
@@ -285,22 +285,22 @@ func (suite *ServerTestSuite) TestCreateServerArtifactsDataInvalid() {
paths := []string{"a/b/c"}
_, err := CreateServerArtifactsData(paths, []string{}, logger.NewStandardLogger())
- require.Errorf(suite.Suite.T(), err, "error was expected")
+ require.Errorf(suite.T(), err, "error was expected")
}
func (suite *ServerTestSuite) TestGetPathLastModifiedTimestamp() {
ts, err := getPathLastModifiedTimestamp("server.go")
- require.NoError(suite.Suite.T(), err)
- require.Greater(suite.Suite.T(), ts, int64(0))
+ require.NoError(suite.T(), err)
+ require.Greater(suite.T(), ts, int64(0))
ts, err = getPathLastModifiedTimestamp("non-existing")
- require.Error(suite.Suite.T(), err)
- require.Equal(suite.Suite.T(), ts, int64(0))
+ require.Error(suite.T(), err)
+ require.Equal(suite.T(), ts, int64(0))
}
func (suite *ServerTestSuite) createFileWithContent(path, content string) {
err := utils.CreateFileWithContent(path, content)
- require.NoErrorf(suite.Suite.T(), err, "error creating file %s", path)
+ require.NoErrorf(suite.T(), err, "error creating file %s", path)
}
func (suite *ServerTestSuite) TestCreatePathsArtifactsData() {
@@ -342,19 +342,19 @@ func (suite *ServerTestSuite) TestCreatePathsArtifactsData() {
},
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
serverData, err := CreatePathsArtifactsData(t.pathsSpec, logger.NewStandardLogger())
- require.Equal(suite.Suite.T(), t.wantError, err != nil, err)
+ require.Equal(suite.T(), t.wantError, err != nil, err)
digestsList := []map[string]string{}
for i, data := range serverData {
digestsList = append(digestsList, data.Digests)
- assert.NotEqual(suite.Suite.T(), int64(0), data.CreationTimestamp, fmt.Sprintf("TestCreatePathsArtifactsData: %s , got: %v, should not be 0, at index: %d", t.name, data.CreationTimestamp, i))
+ assert.NotEqual(suite.T(), int64(0), data.CreationTimestamp, fmt.Sprintf("TestCreatePathsArtifactsData: %s , got: %v, should not be 0, at index: %d", t.name, data.CreationTimestamp, i))
}
for artifactName, digest := range t.want {
- require.Equal(suite.Suite.T(), digest, digestsList[artifactName])
+ require.Equal(suite.T(), digest, digestsList[artifactName])
}
})
}
diff --git a/internal/sonar/sonar.go b/internal/sonar/sonar.go
index 701852167..754bec9a9 100644
--- a/internal/sonar/sonar.go
+++ b/internal/sonar/sonar.go
@@ -142,7 +142,7 @@ func (sc *SonarConfig) GetSonarResults(logger *log.Logger) (*SonarResults, error
}
// Read the report-task.txt file (if it exists) to get the project key, server URL, dashboard URL and ceTaskURL
- err = sc.readFile(project, sonarResults)
+ err = sc.readFile(project, sonarResults, logger)
if err != nil {
if sc.projectKey == "" || sc.revision == "" {
return nil, fmt.Errorf("%s. Alternatively provide the project key and revision for the scan to attest", err)
@@ -152,11 +152,11 @@ func (sc *SonarConfig) GetSonarResults(logger *log.Logger) (*SonarResults, error
sonarResults.ServerUrl = sc.serverURL
sonarResults.Revision = sc.revision
project.Url = fmt.Sprintf("%s/dashboard?id=%s", sonarResults.ServerUrl, project.Key)
- analysisID, err = GetProjectAnalysisFromRevision(httpClient, sonarResults, project, sc.revision, tokenHeader)
+ analysisID, err = GetProjectAnalysisFromRevision(httpClient, sonarResults, project, sc.revision, tokenHeader, logger)
if err != nil {
return nil, err
}
- err = GetTaskID(httpClient, sonarResults, project, analysisID, tokenHeader)
+ err = GetTaskID(httpClient, sonarResults, project, analysisID, tokenHeader, logger)
if err != nil {
return nil, err
}
@@ -189,12 +189,17 @@ func (sc *SonarConfig) GetSonarResults(logger *log.Logger) (*SonarResults, error
return sonarResults, nil
}
-func (sc *SonarConfig) readFile(project *Project, results *SonarResults) error {
+func (sc *SonarConfig) readFile(project *Project, results *SonarResults, logger *log.Logger) error {
metadata, err := os.Open(filepath.Join(sc.WorkingDir, "report-task.txt"))
if err != nil {
return fmt.Errorf("%s. Check your working directory is set correctly", err)
}
- defer metadata.Close()
+ defer func() {
+ if err := metadata.Close(); err != nil {
+ // Log warning for cleanup error
+ logger.Warn("failed to close metadata file: %v", err)
+ }
+ }()
scanner := bufio.NewScanner(metadata)
for scanner.Scan() {
@@ -239,7 +244,7 @@ func GetCETaskData(httpClient *http.Client, project *Project, sonarResults *Sona
}
// If the CETaskURL from the report-task.txt file gives a 404, the CE task does not exist, or SonarQube is down.
if taskResponseData.Errors != nil {
- return "", fmt.Errorf("%s on %s. \nSonarQube may be experiencing problems, please check https://status.sonarqube.com/ and try again later. \nOtherwise if you are attesting an older scan, the snapshot may have been deleted by SonarQube.", taskResponseData.Errors[0].Msg, sonarResults.ServerUrl)
+ return "", fmt.Errorf("%s on %s. \nSonarQube may be experiencing problems, please check https://status.sonarqube.com/ and try again later. \nOtherwise if you are attesting an older scan, the snapshot may have been deleted by SonarQube", taskResponseData.Errors[0].Msg, sonarResults.ServerUrl)
}
if taskResponseData.Task.Status == "PENDING" || taskResponseData.Task.Status == "IN_PROGRESS" {
@@ -261,7 +266,9 @@ func GetCETaskData(httpClient *http.Client, project *Project, sonarResults *Sona
wait *= 2
}
} else {
- taskResponse.Body.Close()
+ if err := taskResponse.Body.Close(); err != nil {
+ logger.Warn("failed to close task response body: %v", err)
+ }
break
}
}
@@ -281,7 +288,7 @@ func GetCETaskData(httpClient *http.Client, project *Project, sonarResults *Sona
// This should only happen if the task is pending - either because the project is large and the scan takes a long time
// to process, or because SonarQube is experiencing delays for some reason.
if analysisId == "" {
- return "", fmt.Errorf("analysis ID not found on %s. The scan results are not yet available, likely due to: \n1. Your project being particularly large and the scan taking time to process, or \n2. SonarQube experiencing delays in processing scans. \nTry rerunning the command with the --max-wait flag.", sonarResults.ServerUrl)
+ return "", fmt.Errorf("analysis ID not found on %s. The scan results are not yet available, likely due to: \n1. Your project being particularly large and the scan taking time to process, or \n2. SonarQube experiencing delays in processing scans. \nTry rerunning the command with the --max-wait flag", sonarResults.ServerUrl)
}
if project.Url == "" {
@@ -299,7 +306,7 @@ func GetCETaskData(httpClient *http.Client, project *Project, sonarResults *Sona
return analysisId, nil
}
-func GetProjectAnalysisFromRevision(httpClient *http.Client, sonarResults *SonarResults, project *Project, revision, tokenHeader string) (string, error) {
+func GetProjectAnalysisFromRevision(httpClient *http.Client, sonarResults *SonarResults, project *Project, revision, tokenHeader string, logger *log.Logger) (string, error) {
var analysisID string
projectAnalysesURL := fmt.Sprintf("%s/api/project_analyses/search?project=%s", sonarResults.ServerUrl, project.Key)
@@ -335,7 +342,10 @@ func GetProjectAnalysisFromRevision(httpClient *http.Client, sonarResults *Sonar
if sonarResults.AnalaysedAt == "" {
return "", fmt.Errorf("analysis for revision %s of project %s not found. Check the revision is correct. \nThe scan may still be being processed by SonarQube, try again later.\n Otherwise if you are attesting an older scan, the snapshot may also have been deleted by SonarQube", revision, project.Key)
}
- projectAnalysesResponse.Body.Close()
+ if err := projectAnalysesResponse.Body.Close(); err != nil {
+ // Log warning for cleanup error
+ logger.Warn("failed to close project analyses response body: %v", err)
+ }
return analysisID, nil
}
@@ -418,7 +428,7 @@ func GetQualityGate(httpClient *http.Client, sonarResults *SonarResults, quality
return qualityGate, nil
}
-func GetTaskID(httpClient *http.Client, sonarResults *SonarResults, project *Project, analysisID, tokenHeader string) error {
+func GetTaskID(httpClient *http.Client, sonarResults *SonarResults, project *Project, analysisID, tokenHeader string, logger *log.Logger) error {
CEActivityURL := fmt.Sprintf("%s/api/ce/activity?component=%s", sonarResults.ServerUrl, project.Key)
CEActivityRequest, err := http.NewRequest("GET", CEActivityURL, nil)
CEActivityRequest.Header.Add("Authorization", tokenHeader)
@@ -452,7 +462,10 @@ func GetTaskID(httpClient *http.Client, sonarResults *SonarResults, project *Pro
break
}
}
- CEActivityResponse.Body.Close()
+ if err := CEActivityResponse.Body.Close(); err != nil {
+ // Log warning for cleanup error
+ logger.Warn("failed to close CE activity response body: %v", err)
+ }
return nil
}
diff --git a/internal/utils/utils.go b/internal/utils/utils.go
index e104f593e..8ebb327d9 100644
--- a/internal/utils/utils.go
+++ b/internal/utils/utils.go
@@ -85,10 +85,20 @@ func Tar(src, tarFileName string) (string, error) {
}
gzw := gzip.NewWriter(f)
- defer gzw.Close()
+ defer func() {
+ if err := gzw.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close gzip writer: %v\n", err)
+ }
+ }()
tw := tar.NewWriter(gzw)
- defer tw.Close()
+ defer func() {
+ if err := tw.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close tar writer: %v\n", err)
+ }
+ }()
// walk path
return tarFilePath, filepath.WalkDir(src, func(path string, di fs.DirEntry, err error) error {
@@ -115,7 +125,7 @@ func Tar(src, tarFileName string) (string, error) {
}
// update the name to correctly reflect the desired destination when untaring
- header.Name = strings.TrimPrefix(strings.Replace(path, src, "", -1), string(filepath.Separator))
+ header.Name = strings.TrimPrefix(strings.ReplaceAll(path, src, ""), string(filepath.Separator))
// write the header
if err := tw.WriteHeader(header); err != nil {
@@ -135,7 +145,10 @@ func Tar(src, tarFileName string) (string, error) {
// manually close here after each file operation; defering would cause each file close
// to wait until all operations have completed.
- f.Close()
+ if err := f.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close file %s: %v\n", path, err)
+ }
return nil
})
@@ -146,12 +159,17 @@ func CreateFileWithContent(path, content string) error {
if err != nil {
return err
}
- defer file.Close()
+ defer func() {
+ if err := file.Close(); err != nil {
+ // Log warning for cleanup error
+ fmt.Printf("warning: failed to close file %s: %v\n", path, err)
+ }
+ }()
_, err = file.Write([]byte(content))
return err
}
-func ConvertStringListToInterfaceList(approversList []string) []interface{} {
+func ConvertStringListToInterfaceList(approversList []string) []any {
approversIface := make([]interface{}, len(approversList))
for i, v := range approversList {
approversIface[i] = v
diff --git a/internal/utils/utils_test.go b/internal/utils/utils_test.go
index 33c48ae12..7aa57d51f 100644
--- a/internal/utils/utils_test.go
+++ b/internal/utils/utils_test.go
@@ -55,9 +55,9 @@ func (suite *UtilsTestSuite) TestContains() {
want: false,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
actual := Contains(t.args.list, t.args.item)
- assert.Equal(suite.Suite.T(), t.want, actual, fmt.Sprintf("TestContains: %s , got: %v -- want: %v", t.name, actual, t.want))
+ assert.Equal(suite.T(), t.want, actual, fmt.Sprintf("TestContains: %s , got: %v -- want: %v", t.name, actual, t.want))
})
}
}
@@ -84,9 +84,9 @@ func (suite *UtilsTestSuite) TestIsJSON() {
want: false,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
actual := IsJSON(t.input)
- assert.Equal(suite.Suite.T(), t.want, actual, fmt.Sprintf("TestIsJSON: %s , got: %v -- want: %v", t.name, actual, t.want))
+ assert.Equal(suite.T(), t.want, actual, fmt.Sprintf("TestIsJSON: %s , got: %v -- want: %v", t.name, actual, t.want))
})
}
}
@@ -130,74 +130,86 @@ func (suite *UtilsTestSuite) TestLoadFileContent() {
expectError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
tmpDir, err := os.MkdirTemp("", "testDir")
- require.NoError(suite.Suite.T(), err, "error creating a temporary test directory")
- defer os.RemoveAll(tmpDir)
+ require.NoError(suite.T(), err, "error creating a temporary test directory")
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ suite.T().Logf("warning: failed to remove temp dir: %v", err)
+ }
+ }()
if t.args.create {
testFile, err := os.Create(filepath.Join(tmpDir, t.args.filename))
- require.NoErrorf(suite.Suite.T(), err, "error creating test file %s", t.args.filename)
+ require.NoErrorf(suite.T(), err, "error creating test file %s", t.args.filename)
_, err = testFile.Write([]byte(t.args.content))
- require.NoErrorf(suite.Suite.T(), err, "error writing content to test file %s", t.args.filename)
+ require.NoErrorf(suite.T(), err, "error writing content to test file %s", t.args.filename)
}
actual, err := LoadFileContent(filepath.Join(tmpDir, t.args.filename))
if t.expectError {
- require.Errorf(suite.Suite.T(), err, "loading content for test file %s IS expected to return an error", t.args.filename)
+ require.Errorf(suite.T(), err, "loading content for test file %s IS expected to return an error", t.args.filename)
} else {
- require.NoErrorf(suite.Suite.T(), err, "loading content for test file %s is NOT expected to return an error", t.args.filename)
+ require.NoErrorf(suite.T(), err, "loading content for test file %s is NOT expected to return an error", t.args.filename)
}
- assert.Equal(suite.Suite.T(), t.args.content, actual, fmt.Sprintf("TestLoadFileContent: %s , got: %v -- want: %v", t.name, actual, t.args.content))
+ assert.Equal(suite.T(), t.args.content, actual, fmt.Sprintf("TestLoadFileContent: %s , got: %v -- want: %v", t.name, actual, t.args.content))
})
}
}
func (suite *UtilsTestSuite) TestCreateFile() {
tmpDir, err := os.MkdirTemp("", "")
- require.NoError(suite.Suite.T(), err)
- defer os.RemoveAll(tmpDir)
+ require.NoError(suite.T(), err)
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ suite.T().Logf("warning: failed to remove temp dir: %v", err)
+ }
+ }()
path := filepath.Join(tmpDir, "test.txt")
f, err := CreateFile(path)
- require.NoError(suite.Suite.T(), err)
- require.NotNil(suite.Suite.T(), f)
- require.FileExists(suite.Suite.T(), path)
+ require.NoError(suite.T(), err)
+ require.NotNil(suite.T(), f)
+ require.FileExists(suite.T(), path)
}
func (suite *UtilsTestSuite) TestIsFileIsDir() {
tmpDir, err := os.MkdirTemp("", "")
- require.NoError(suite.Suite.T(), err)
- defer os.RemoveAll(tmpDir)
+ require.NoError(suite.T(), err)
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ suite.T().Logf("warning: failed to remove temp dir: %v", err)
+ }
+ }()
ok, err := IsDir(tmpDir)
- require.NoError(suite.Suite.T(), err)
- require.True(suite.Suite.T(), ok)
+ require.NoError(suite.T(), err)
+ require.True(suite.T(), ok)
path := filepath.Join(tmpDir, "test.txt")
_, err = CreateFile(path)
- require.NoError(suite.Suite.T(), err)
- require.FileExists(suite.Suite.T(), path)
+ require.NoError(suite.T(), err)
+ require.FileExists(suite.T(), path)
ok, err = IsFile(path)
- require.NoError(suite.Suite.T(), err)
- require.True(suite.Suite.T(), ok)
+ require.NoError(suite.T(), err)
+ require.True(suite.T(), ok)
ok, err = IsDir(path)
- require.NoError(suite.Suite.T(), err)
- require.False(suite.Suite.T(), ok)
+ require.NoError(suite.T(), err)
+ require.False(suite.T(), ok)
nonExistingPath := filepath.Join(tmpDir, "non-existing.txt")
ok, err = IsFile(nonExistingPath)
- require.Error(suite.Suite.T(), err)
- require.False(suite.Suite.T(), ok)
+ require.Error(suite.T(), err)
+ require.False(suite.T(), ok)
nonExistingDir := "non-existing"
ok, err = IsDir(nonExistingDir)
- require.Error(suite.Suite.T(), err)
- require.False(suite.Suite.T(), ok)
+ require.Error(suite.T(), err)
+ require.False(suite.T(), ok)
}
func (suite *UtilsTestSuite) TestTar() {
@@ -226,13 +238,17 @@ func (suite *UtilsTestSuite) TestTar() {
wantError: true,
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
path := "non-existing"
if t.shouldCreateSrc {
tmpDir, err := os.MkdirTemp("", "")
- require.NoError(suite.Suite.T(), err)
+ require.NoError(suite.T(), err)
suite.createFileWithContent(filepath.Join(tmpDir, "newfile.txt"), "Hello World!")
- defer os.RemoveAll(tmpDir)
+ defer func() {
+ if err := os.RemoveAll(tmpDir); err != nil {
+ suite.T().Logf("warning: failed to remove temp dir: %v", err)
+ }
+ }()
path = tmpDir
if t.srcType == "file" {
path = filepath.Join(tmpDir, "some-file.txt")
@@ -241,10 +257,14 @@ func (suite *UtilsTestSuite) TestTar() {
}
tarPath, err := Tar(path, t.tarFileName)
- require.True(suite.Suite.T(), t.wantError == (err != nil))
+ require.True(suite.T(), t.wantError == (err != nil))
if !t.wantError {
- defer os.RemoveAll(tarPath)
- require.Equal(suite.Suite.T(), t.tarFileName, filepath.Base(tarPath))
+ defer func() {
+ if err := os.RemoveAll(tarPath); err != nil {
+ suite.T().Logf("warning: failed to remove tar path: %v", err)
+ }
+ }()
+ require.Equal(suite.T(), t.tarFileName, filepath.Base(tarPath))
}
})
}
@@ -252,7 +272,7 @@ func (suite *UtilsTestSuite) TestTar() {
func (suite *UtilsTestSuite) createFileWithContent(path, content string) {
err := CreateFileWithContent(path, content)
- require.NoErrorf(suite.Suite.T(), err, "error creating file %s", path)
+ require.NoErrorf(suite.T(), err, "error creating file %s", path)
}
// In order for 'go test' to run this suite, we need to create
diff --git a/internal/version/version_test.go b/internal/version/version_test.go
index d6b70cb74..44a25fc7c 100644
--- a/internal/version/version_test.go
+++ b/internal/version/version_test.go
@@ -66,14 +66,14 @@ func (suite *VersionTestSuite) TestGetVersion() {
want: "v1.2.3",
},
} {
- suite.Suite.Run(t.name, func() {
+ suite.Run(t.name, func() {
metadata = t.args.metadata
if t.args.version != "" {
version = t.args.version
}
actual := GetVersion()
- assert.Equal(suite.Suite.T(), t.want, actual, fmt.Sprintf("TestGetVersion: %s , got: %v -- want: %v", t.name, actual, t.want))
+ assert.Equal(suite.T(), t.want, actual, fmt.Sprintf("TestGetVersion: %s , got: %v -- want: %v", t.name, actual, t.want))
})
}
}
@@ -91,7 +91,7 @@ func (suite *VersionTestSuite) TestGet() {
GoVersion: runtime.Version(),
}
actual := Get()
- assert.Equal(suite.Suite.T(), expected, actual, fmt.Sprintf("build info should match, got: %v -- expected: %v", actual, expected))
+ assert.Equal(suite.T(), expected, actual, fmt.Sprintf("build info should match, got: %v -- expected: %v", actual, expected))
}
// In order for 'go test' to run this suite, we need to create