Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 2df26cf

Browse files
committed
Use non zero enum
1 parent 1e80675 commit 2df26cf

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,8 +1887,6 @@ github.com/kralicky/ragu v1.0.0-rc3 h1:auI0G5WcLcBC18gQABjpykvEbzEt2xStQsC6dxuva
18871887
github.com/kralicky/ragu v1.0.0-rc3/go.mod h1:upcZm+aSNq1ngZDshp85T4tDG8rhfO9Ak66sY/4bI2g=
18881888
github.com/kralicky/spellbook v0.0.0-20220829172922-3d415e02ee8a h1:RfpqOGzhMSF0OWvI8AqYxlvhuVZ72EQiYu9ClM89bKg=
18891889
github.com/kralicky/spellbook v0.0.0-20220829172922-3d415e02ee8a/go.mod h1:qp6R4XKeuJk2j8nHke4Y9rBEpc2HkCjXR/gssL3OpOU=
1890-
github.com/kralicky/totem v1.1.0-rc6.0.20221015041849-acb5d4c633f2 h1:eEMfmOPb9Y37ZSar9KR7nzMhSC4mqbUdFSQVB4F308c=
1891-
github.com/kralicky/totem v1.1.0-rc6.0.20221015041849-acb5d4c633f2/go.mod h1:l6wZ22m0hEIBML+HE0qJTwqAZMg9m9qpbRC2tCZNtqg=
18921890
github.com/kralicky/totem v1.1.0-rc7 h1:/ubi2n0mcM/+1zbok8Td8GXh2W6mlEQb9lbdsHvwjJ4=
18931891
github.com/kralicky/totem v1.1.0-rc7/go.mod h1:l6wZ22m0hEIBML+HE0qJTwqAZMg9m9qpbRC2tCZNtqg=
18941892
github.com/kralicky/yaml/v3 v3.0.0-20220520012407-b0e7050bd81d h1:kLfaaFdmCHKZCvL4DzQ7T9YsAVSBqZez34zaegldkls=

plugins/logging/pkg/gateway/admin.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import (
1010
"strings"
1111
"time"
1212

13-
"github.com/gogo/status"
1413
"github.com/lestrrat-go/backoff/v2"
15-
"github.com/opensearch-project/opensearch-go"
1614
osclient "github.com/opensearch-project/opensearch-go"
1715
opnicorev1beta1 "github.com/rancher/opni/apis/core/v1beta1"
1816
loggingv1beta1 "github.com/rancher/opni/apis/logging/v1beta1"
@@ -22,6 +20,7 @@ import (
2220
"github.com/rancher/opni/plugins/logging/pkg/opensearchdata"
2321
"github.com/samber/lo"
2422
"google.golang.org/grpc/codes"
23+
"google.golang.org/grpc/status"
2524
"google.golang.org/protobuf/types/known/emptypb"
2625
corev1 "k8s.io/api/core/v1"
2726
storagev1 "k8s.io/api/storage/v1"
@@ -47,7 +46,7 @@ const (
4746
type ClusterStatus int
4847

4948
const (
50-
ClusterStatusPending ClusterStatus = iota
49+
ClusterStatusPending ClusterStatus = iota + 1
5150
ClusterStatusGreen
5251
ClusterStatusYellow
5352
ClusterStatusRed
@@ -597,7 +596,7 @@ FETCH:
597596
InsecureSkipVerify: true,
598597
}
599598

600-
osCfg := opensearch.Config{
599+
osCfg := osclient.Config{
601600
Addresses: []string{
602601
fmt.Sprintf("https://%s.%s:9200", cluster.Spec.General.ServiceName, cluster.Namespace),
603602
},
@@ -607,7 +606,7 @@ FETCH:
607606
Transport: transport,
608607
}
609608

610-
osClient, err := opensearch.NewClient(osCfg)
609+
osClient, err := osclient.NewClient(osCfg)
611610
if err != nil {
612611
p.logger.Errorf("failed to create opensearch client: %v", err)
613612
panic(err)

plugins/logging/pkg/gateway/uninstall.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,6 @@ import (
2323
"sigs.k8s.io/controller-runtime/pkg/client"
2424
)
2525

26-
const (
27-
pendingValue = "job pending"
28-
)
29-
30-
type deleteStatus int
31-
32-
const (
33-
deletePending deleteStatus = iota
34-
deleteRunning
35-
deleteFinished
36-
deleteFinishedWithErrors
37-
deleteError
38-
)
39-
4026
type UninstallTaskRunner struct {
4127
uninstall.DefaultPendingHandler
4228
storageNamespace string

0 commit comments

Comments
 (0)