Skip to content

Commit

Permalink
Use non zero enum
Browse files Browse the repository at this point in the history
  • Loading branch information
dbason committed Oct 18, 2022
1 parent f64b02c commit d00fa6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1887,8 +1887,6 @@ github.com/kralicky/ragu v1.0.0-rc3 h1:auI0G5WcLcBC18gQABjpykvEbzEt2xStQsC6dxuva
github.com/kralicky/ragu v1.0.0-rc3/go.mod h1:upcZm+aSNq1ngZDshp85T4tDG8rhfO9Ak66sY/4bI2g=
github.com/kralicky/spellbook v0.0.0-20220829172922-3d415e02ee8a h1:RfpqOGzhMSF0OWvI8AqYxlvhuVZ72EQiYu9ClM89bKg=
github.com/kralicky/spellbook v0.0.0-20220829172922-3d415e02ee8a/go.mod h1:qp6R4XKeuJk2j8nHke4Y9rBEpc2HkCjXR/gssL3OpOU=
github.com/kralicky/totem v1.1.0-rc6.0.20221015041849-acb5d4c633f2 h1:eEMfmOPb9Y37ZSar9KR7nzMhSC4mqbUdFSQVB4F308c=
github.com/kralicky/totem v1.1.0-rc6.0.20221015041849-acb5d4c633f2/go.mod h1:l6wZ22m0hEIBML+HE0qJTwqAZMg9m9qpbRC2tCZNtqg=
github.com/kralicky/totem v1.1.0-rc7 h1:/ubi2n0mcM/+1zbok8Td8GXh2W6mlEQb9lbdsHvwjJ4=
github.com/kralicky/totem v1.1.0-rc7/go.mod h1:l6wZ22m0hEIBML+HE0qJTwqAZMg9m9qpbRC2tCZNtqg=
github.com/kralicky/yaml/v3 v3.0.0-20220520012407-b0e7050bd81d h1:kLfaaFdmCHKZCvL4DzQ7T9YsAVSBqZez34zaegldkls=
Expand Down
9 changes: 4 additions & 5 deletions plugins/logging/pkg/gateway/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import (
"strings"
"time"

"github.com/gogo/status"
"github.com/lestrrat-go/backoff/v2"
"github.com/opensearch-project/opensearch-go"
osclient "github.com/opensearch-project/opensearch-go"
opnicorev1beta1 "github.com/rancher/opni/apis/core/v1beta1"
loggingv1beta1 "github.com/rancher/opni/apis/logging/v1beta1"
Expand All @@ -22,6 +20,7 @@ import (
"github.com/rancher/opni/plugins/logging/pkg/opensearchdata"
"github.com/samber/lo"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
corev1 "k8s.io/api/core/v1"
storagev1 "k8s.io/api/storage/v1"
Expand All @@ -47,7 +46,7 @@ const (
type ClusterStatus int

const (
ClusterStatusPending ClusterStatus = iota
ClusterStatusPending ClusterStatus = iota + 1
ClusterStatusGreen
ClusterStatusYellow
ClusterStatusRed
Expand Down Expand Up @@ -597,7 +596,7 @@ FETCH:
InsecureSkipVerify: true,
}

osCfg := opensearch.Config{
osCfg := osclient.Config{
Addresses: []string{
fmt.Sprintf("https://%s.%s:9200", cluster.Spec.General.ServiceName, cluster.Namespace),
},
Expand All @@ -607,7 +606,7 @@ FETCH:
Transport: transport,
}

osClient, err := opensearch.NewClient(osCfg)
osClient, err := osclient.NewClient(osCfg)
if err != nil {
p.logger.Errorf("failed to create opensearch client: %v", err)
panic(err)
Expand Down
14 changes: 0 additions & 14 deletions plugins/logging/pkg/gateway/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

const (
pendingValue = "job pending"
)

type deleteStatus int

const (
deletePending deleteStatus = iota
deleteRunning
deleteFinished
deleteFinishedWithErrors
deleteError
)

type UninstallTaskRunner struct {
uninstall.DefaultPendingHandler
storageNamespace string
Expand Down

0 comments on commit d00fa6f

Please sign in to comment.