Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit 349ff00

Browse files
committed
Run auto-formatter tool
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
1 parent 1141e76 commit 349ff00

13 files changed

Lines changed: 87 additions & 90 deletions

File tree

cmd/asset-syncer/server/postgresql_utils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func Test_PGinsertFiles(t *testing.T) {
172172
namespace = "my-namespace"
173173
repoName = "my-repo"
174174
chartID string = repoName + "/wordpress"
175-
filesID string = chartID + "-2.1.3"
175+
filesID = chartID + "-2.1.3"
176176
)
177177
files := models.ChartFiles{ID: filesID, Readme: "foo", DefaultValues: "bar", Repo: &models.AppRepository{Namespace: namespace, Name: repoName}}
178178
mock.ExpectQuery(`INSERT INTO files \(chart_id, repo_name, repo_namespace, chart_files_ID, info\)*`).

cmd/asset-syncer/server/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"sync"
2222
"time"
2323

24-
semver "github.com/Masterminds/semver/v3"
24+
"github.com/Masterminds/semver/v3"
2525
"github.com/containerd/containerd/remotes/docker"
2626
"github.com/disintegration/imaging"
2727
"github.com/itchyny/gojq"

cmd/asset-syncer/server/utils_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ func Test_parseFilters(t *testing.T) {
222222

223223
func Test_fetchRepoIndex(t *testing.T) {
224224
fakeServer := newFakeServer(t, map[string]*http.Response{
225-
"/index.yaml": &http.Response{StatusCode: 200},
226-
"/subpath/index.yaml": &http.Response{StatusCode: 200},
225+
"/index.yaml": {StatusCode: 200},
226+
"/subpath/index.yaml": {StatusCode: 200},
227227
})
228228
defer fakeServer.Close()
229229
addr := fakeServer.URL
@@ -397,19 +397,19 @@ func Test_fetchAndImportIcon(t *testing.T) {
397397
svgHeader.Set("Content-Type", "image/svg")
398398

399399
server := newFakeServer(t, map[string]*http.Response{
400-
"/valid_icon.png": &http.Response{
400+
"/valid_icon.png": {
401401
StatusCode: 200,
402402
Body: io.NopCloser(bytes.NewReader(iconBytes())),
403403
},
404-
"/valid_svg_icon.svg": &http.Response{
404+
"/valid_svg_icon.svg": {
405405
StatusCode: 200,
406406
Body: io.NopCloser(bytes.NewReader([]byte("<svg width='100' height='100'></svg>"))),
407407
Header: svgHeader,
408408
},
409-
"/download_fail.png": &http.Response{
409+
"/download_fail.png": {
410410
StatusCode: 500,
411411
},
412-
"/invalid_icon.png": &http.Response{
412+
"/invalid_icon.png": {
413413
StatusCode: 200,
414414
Body: io.NopCloser(bytes.NewReader([]byte("not a valid png"))),
415415
},
@@ -707,7 +707,7 @@ func Test_fetchAndImportFiles(t *testing.T) {
707707
func Test_ociAPICli(t *testing.T) {
708708
t.Run("TagList - failed request", func(t *testing.T) {
709709
server := newFakeServer(t, map[string]*http.Response{
710-
"/v2/apache/tags/list": &http.Response{
710+
"/v2/apache/tags/list": {
711711
StatusCode: 500,
712712
},
713713
})
@@ -736,7 +736,7 @@ func Test_ociAPICli(t *testing.T) {
736736

737737
t.Run("TagList - successful request", func(t *testing.T) {
738738
server := newFakeServer(t, map[string]*http.Response{
739-
"/v2/apache/tags/list": &http.Response{
739+
"/v2/apache/tags/list": {
740740
StatusCode: 200,
741741
Body: io.NopCloser(strings.NewReader(`{"name":"apache","tags":["7.5.1","8.1.1"]}`)),
742742
},
@@ -760,7 +760,7 @@ func Test_ociAPICli(t *testing.T) {
760760

761761
t.Run("IsHelmChart - failed request", func(t *testing.T) {
762762
server := newFakeServer(t, map[string]*http.Response{
763-
"/v2/apache-bad/manifests/7.5.1": &http.Response{
763+
"/v2/apache-bad/manifests/7.5.1": {
764764
StatusCode: 500,
765765
},
766766
})
@@ -854,7 +854,7 @@ func Test_ociAPICli(t *testing.T) {
854854

855855
t.Run("CatalogAvailable - successful request", func(t *testing.T) {
856856
server := newFakeServer(t, map[string]*http.Response{
857-
"/v2/test/project/charts-index/manifests/latest": &http.Response{
857+
"/v2/test/project/charts-index/manifests/latest": {
858858
StatusCode: 200,
859859
Body: io.NopCloser(strings.NewReader(chartsIndexManifestJSON)),
860860
},
@@ -882,7 +882,7 @@ func Test_ociAPICli(t *testing.T) {
882882

883883
t.Run("CatalogAvailable - returns false for incorrect media type", func(t *testing.T) {
884884
server := newFakeServer(t, map[string]*http.Response{
885-
"/v2/test/project/charts-index/manifests/latest": &http.Response{
885+
"/v2/test/project/charts-index/manifests/latest": {
886886
StatusCode: 200,
887887
Body: io.NopCloser(strings.NewReader(`{"config": {"mediaType": "something-else"}}`)),
888888
},
@@ -909,7 +909,7 @@ func Test_ociAPICli(t *testing.T) {
909909

910910
t.Run("CatalogAvailable - returns false for a 404", func(t *testing.T) {
911911
server := newFakeServer(t, map[string]*http.Response{
912-
"/v2/test/project/charts-index/manifests/latest": &http.Response{
912+
"/v2/test/project/charts-index/manifests/latest": {
913913
StatusCode: 200,
914914
Body: io.NopCloser(strings.NewReader(`{"config": {"mediaType": "something-else"}}`)),
915915
},
@@ -1029,11 +1029,11 @@ func Test_ociAPICli(t *testing.T) {
10291029

10301030
t.Run("Catalog - successful request", func(t *testing.T) {
10311031
server := newFakeServer(t, map[string]*http.Response{
1032-
"/v2/test/project/charts-index/manifests/latest": &http.Response{
1032+
"/v2/test/project/charts-index/manifests/latest": {
10331033
StatusCode: 200,
10341034
Body: io.NopCloser(strings.NewReader(chartsIndexManifestJSON)),
10351035
},
1036-
"/v2/test/project/charts-index/blobs/sha256:f9f7df0ae3f50aaf9ff390034cec4286d2aa43f061ce4bc7aa3c9ac862800aba": &http.Response{
1036+
"/v2/test/project/charts-index/blobs/sha256:f9f7df0ae3f50aaf9ff390034cec4286d2aa43f061ce4bc7aa3c9ac862800aba": {
10371037
StatusCode: 200,
10381038
Body: io.NopCloser(strings.NewReader(chartsIndexMultipleJSON)),
10391039
},

cmd/kubeapps-apis/core/plugins/v1alpha1/plugins.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func (s *PluginsServer) registerGRPC(p *plugin.Plugin, pluginDetail *plugins.Plu
172172

173173
grpcFn, ok := grpcRegFn.(grpcRegisterFunctionType)
174174
if !ok {
175-
var stubFn grpcRegisterFunctionType = func(GRPCPluginRegistrationOptions) (interface{}, error) {
175+
var stubFn = func(GRPCPluginRegistrationOptions) (interface{}, error) {
176176
return nil, nil
177177
}
178178
return nil, fmt.Errorf("unable to use %q in plugin %v due to mismatched signature.\nwant: %T\ngot: %T", grpcRegisterFunction, pluginDetail, stubFn, grpcRegFn)
@@ -225,7 +225,7 @@ func getPluginDetail(p *plugin.Plugin, pluginPath string) (*plugins.Plugin, erro
225225

226226
fn, ok := pluginDetailFn.(pluginDetailFunctionType)
227227
if !ok {
228-
var stubFn pluginDetailFunctionType = func() *plugins.Plugin { return &plugins.Plugin{} }
228+
var stubFn = func() *plugins.Plugin { return &plugins.Plugin{} }
229229
return nil, fmt.Errorf("unable to use %q in plugin %q due to a mismatched signature. \nwant: %T\ngot: %T", pluginDetailFunction, pluginPath, stubFn, pluginDetailFn)
230230
}
231231

@@ -243,7 +243,7 @@ func registerHTTP(p *plugin.Plugin, pluginDetail *plugins.Plugin, gwArgs core.Ga
243243
if !ok {
244244
// Create a stubFn only so we can ensure the correct type is shown in case
245245
// of an error.
246-
var stubFn gatewayRegisterFunctionType = func(context.Context, *runtime.ServeMux, string, []grpc.DialOption) error { return nil }
246+
var stubFn = func(context.Context, *runtime.ServeMux, string, []grpc.DialOption) error { return nil }
247247
return fmt.Errorf("unable to use %q in plugin %v due to mismatched signature.\nwant: %T\ngot: %T", gatewayRegisterFunction, pluginDetail, stubFn, gwRegFn)
248248
}
249249
return gwfn(gwArgs.Ctx, gwArgs.Mux, gwArgs.Addr, gwArgs.DialOptions)

cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
fluxplugin "github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1"
1919
"github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/common"
2020
"golang.org/x/sync/semaphore"
21-
grpc "google.golang.org/grpc"
21+
"google.golang.org/grpc"
2222
"google.golang.org/grpc/codes"
2323
"google.golang.org/grpc/status"
2424
apiv1 "k8s.io/api/core/v1"

cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
fluxmeta "github.com/fluxcd/pkg/apis/meta"
1818
sourcev1 "github.com/fluxcd/source-controller/api/v1"
1919
sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2"
20-
redismock "github.com/go-redis/redismock/v8"
20+
"github.com/go-redis/redismock/v8"
2121
corev1 "github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1"
2222
"github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/cache"
2323
"github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/common"

cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/repo_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
fluxmeta "github.com/fluxcd/pkg/apis/meta"
2121
sourcev1 "github.com/fluxcd/source-controller/api/v1"
2222
sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2"
23-
redismock "github.com/go-redis/redismock/v8"
23+
"github.com/go-redis/redismock/v8"
2424
"github.com/google/go-cmp/cmp"
2525
"github.com/google/go-cmp/cmp/cmpopts"
2626
corev1 "github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1"

cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
fluxmeta "github.com/fluxcd/pkg/apis/meta"
1818
sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2"
1919
"github.com/go-redis/redis/v8"
20-
redismock "github.com/go-redis/redismock/v8"
20+
"github.com/go-redis/redismock/v8"
2121
corev1 "github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1"
2222
"github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/cache"
2323
"github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/common"

cmd/kubeapps-apis/plugins/kapp_controller/packages/v1alpha1/server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ import (
2828
type kappClientsGetter func(headers http.Header, cluster, namespace string) (ctlapp.Apps, ctlres.IdentifiedResources, *kappcmdapp.FailingAPIServicesPolicy, ctlres.ResourceFilter, error)
2929

3030
const (
31-
fallbackGlobalPackagingNamespace = "kapp-controller-packaging-global"
32-
fallbackDefaultUpgradePolicy pkgutils.UpgradePolicy = pkgutils.UpgradePolicyNone
33-
fallbackDefaultAllowDowngrades = false
34-
fallbackTimeoutSeconds = 300
31+
fallbackGlobalPackagingNamespace = "kapp-controller-packaging-global"
32+
fallbackDefaultUpgradePolicy = pkgutils.UpgradePolicyNone
33+
fallbackDefaultAllowDowngrades = false
34+
fallbackTimeoutSeconds = 300
3535
)
3636

3737
func fallbackDefaultPrereleasesVersionSelection() []string {

0 commit comments

Comments
 (0)