Skip to content

Commit a61dc2b

Browse files
committed
Fix lint issues
Signed-off-by: Ishan Gupta <gishan@vmware.com>
1 parent c8b3462 commit a61dc2b

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

internal/resources/tanzupackageinstall/package_install_datasource.go

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1414
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1515
"github.com/pkg/errors"
16+
1617
"github.com/vmware/terraform-provider-tanzu-mission-control/internal/authctx"
1718
clienterrors "github.com/vmware/terraform-provider-tanzu-mission-control/internal/client/errors"
1819
"github.com/vmware/terraform-provider-tanzu-mission-control/internal/resources/common"

internal/resources/tanzupackageinstall/package_install_resource.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func resourcePackageInstallInPlaceUpdate(ctx context.Context, d *schema.Resource
210210

211211
if !updateAvailable {
212212
log.Printf("[INFO] package install update is not required")
213-
return
213+
return diags
214214
}
215215

216216
pkgInstallReq := &pkginstallclustermodel.VmwareTanzuManageV1alpha1ClusterNamespaceTanzupackageInstallInstallRequest{

internal/resources/tanzupackageinstall/package_install_resource_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ func TestAcceptanceForPackageInstallResource(t *testing.T) {
140140
t.Log("package install resource acceptance test complete")
141141
}
142142

143+
// nolint: unparam
143144
func (testConfig *testAcceptanceConfig) getTestPackageInstallResourceBasicConfigValue(scope commonscope.Scope, constraints string, inlineValuesFromFile bool) string {
144145
helperBlock, _ := testConfig.ScopeHelperResources.GetTestResourceHelperAndScope(scope, packageinstallscope.ScopesAllowed[:])
145146

@@ -238,6 +239,7 @@ func (testConfig *testAcceptanceConfig) getTestPackageInstallResourceBasicConfig
238239
testConfig.Namespace, constraints, inlineValuesForPackageInstall)
239240
}
240241

242+
// nolint: unparam
241243
// checkPackageInstallResourceAttributes checks for package install creation along with meta attributes.
242244
func (testConfig *testAcceptanceConfig) checkPackageInstallResourceAttributes(scopeType commonscope.Scope) resource.TestCheckFunc {
243245
var check = []resource.TestCheckFunc{

internal/resources/tanzupackageinstall/spec/cluster_scope.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ func FlattenSpecForClusterScope(spec *packageinstallmodel.VmwareTanzuManageV1alp
151151
flattenSpecData[InlineValuesKey] = spec.InlineValues
152152
}
153153

154-
if v1, ok := spec.InlineValues.(interface{}); ok && pathToInlineValues != "" {
155-
err = helper.WriteYamlFile(pathToInlineValues, v1)
154+
if spec.InlineValues != nil && pathToInlineValues != "" {
155+
err = helper.WriteYamlFile(pathToInlineValues, spec.InlineValues)
156156
if err != nil {
157157
return data, err
158158
}

internal/resources/tanzupackageinstall/spec/spec.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"strings"
1212

1313
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
14+
1415
"github.com/vmware/terraform-provider-tanzu-mission-control/internal/helper"
1516
)
1617

internal/resources/tanzupackageinstall/test_helper.go

+7-13
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,21 @@ import (
1919

2020
// nolint: gosec
2121
const (
22-
pkgRepoResource = packagerepository.ResourceName
23-
pkgRepoResourceVar = "test_pkg_repository"
24-
pkgRepoDataSourceVar = "test_data_source_pkg_repository"
25-
pkgRepoNamePrefix = "tf-pkg-repository-test"
22+
pkgRepoResource = packagerepository.ResourceName
23+
pkgRepoResourceVar = "test_pkg_repository"
24+
pkgRepoNamePrefix = "tf-pkg-repository-test"
2625

27-
pkgInstallResource = ResourceName
28-
pkgInstallResourceVar = "test_pkg_install"
29-
pkgInstallDataSourceVar = "test_data_source_pkg_install"
30-
pkgInstallNamePrefix = "tf-pkg-install-test"
31-
namespaceNamePrefix = "test-pkg-install-ns"
26+
pkgInstallResource = ResourceName
27+
pkgInstallResourceVar = "test_pkg_install"
28+
pkgInstallNamePrefix = "tf-pkg-install-test"
29+
namespaceNamePrefix = "test-pkg-install-ns"
3230

3331
constraints = "3.0.0-rc.1"
3432

35-
PkgResource = ResourceName
36-
pkgDataSourceVar = "test_data_source_pkg"
3733
pkgName1 = "2.0.0"
3834
pkgName2 = "3.0.0-rc.1"
3935
pkgMetadataName = "pkg.test.carvel.dev"
4036
globalRepoNamespace = "tanzu-package-repo-global"
41-
42-
imageURL = "projects.registry.vmware.com/tmc/build-integrations/package/repository/e2e-test-unauth-repo@sha256:87a5f7e0c44523fbc35a9432c657bebce246138bbd0f16d57f5615933ceef632"
4337
)
4438

4539
type testAcceptanceConfig struct {

0 commit comments

Comments
 (0)