Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherzli committed Jan 24, 2024
1 parent 8cb9803 commit 3c8115c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
15 changes: 7 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,9 @@ func (c *controller) sync(ctx context.Context) {

c.replicas[hashring] = *sts.Spec.Replicas
if _, ok := statefulsets[hashring]; !ok {
// If not, initialize a new slice
statefulsets[hashring] = []*appsv1.StatefulSet{}
}
// Append the new value to the slice associated with the key
// Append the new value to the slice associated with the hashring key
statefulsets[hashring] = append(statefulsets[hashring], sts.DeepCopy())
level.Info(c.logger).Log("Hashring ", hashring, " got a statefulset: ", sts.Name)

Expand Down Expand Up @@ -826,8 +825,8 @@ func newQueue() *queue {
}

func (q *queue) add() {
q.Mutex.Lock()
defer q.Mutex.Unlock()
q.Lock()

Check failure on line 828 in main.go

View workflow job for this annotation

GitHub Actions / Lint (ubuntu-latest)

q.Lock undefined (type *queue has no field or method Lock) (typecheck)
defer q.Unlock()

Check failure on line 829 in main.go

View workflow job for this annotation

GitHub Actions / Lint (ubuntu-latest)

q.Unlock undefined (type *queue has no field or method Unlock) (typecheck)

if !q.ok {
return
Expand All @@ -839,8 +838,8 @@ func (q *queue) add() {
}

func (q *queue) stop() {
q.Mutex.Lock()
defer q.Mutex.Unlock()
q.Lock()

Check failure on line 841 in main.go

View workflow job for this annotation

GitHub Actions / Lint (ubuntu-latest)

q.Lock undefined (type *queue has no field or method Lock) (typecheck)
defer q.Unlock()

Check failure on line 842 in main.go

View workflow job for this annotation

GitHub Actions / Lint (ubuntu-latest)

q.Unlock undefined (type *queue has no field or method Unlock) (typecheck)

if !q.ok {
return
Expand All @@ -852,8 +851,8 @@ func (q *queue) stop() {

func (q *queue) get() bool {
<-q.ch
q.Mutex.Lock()
defer q.Mutex.Unlock()
q.Lock()

Check failure on line 854 in main.go

View workflow job for this annotation

GitHub Actions / Lint (ubuntu-latest)

q.Lock undefined (type *queue has no field or method Lock) (typecheck)
defer q.Unlock()

Check failure on line 855 in main.go

View workflow job for this annotation

GitHub Actions / Lint (ubuntu-latest)

q.Unlock undefined (type *queue has no field or method Unlock) (typecheck)

return q.ok
}
1 change: 1 addition & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ func TestControllerConfigmapUpdate(t *testing.T) {
}
}

// nolint:funlen
func TestControllerWithAzAware(t *testing.T) {
ctx := context.Background()
port := 10901
Expand Down

0 comments on commit 3c8115c

Please sign in to comment.