Skip to content

Commit b557033

Browse files
committed
go fix
1 parent ab2a3cb commit b557033

6 files changed

Lines changed: 44 additions & 46 deletions

File tree

.github/workflows/ghcr.yaml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,33 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
- name: Log in to the container registry
25-
uses: docker/login-action@v3
26-
with:
27-
registry: ${{ env.REGISTRY }}
28-
username: ${{ github.actor }}
29-
password: ${{ secrets.GITHUB_TOKEN }}
30-
31-
- name: Checkout
32-
uses: actions/checkout@v5
33-
34-
- name: Set up Go
35-
uses: actions/setup-go@v5
36-
with:
37-
go-version-file: 'go.mod'
38-
39-
- name: Lint
40-
uses: golangci/golangci-lint-action@v8
41-
42-
- name: Make tag
43-
run: |
44-
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
45-
[ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "tag=${GITHUB_REF##*/}" >> $GITHUB_ENV || true
46-
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true
47-
48-
- name: Build and push image
49-
uses: docker/build-push-action@v6
50-
with:
51-
context: .
52-
push: true
53-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.tag }}
24+
- name: Log in to the container registry
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ${{ env.REGISTRY }}
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Checkout
32+
uses: actions/checkout@v6
33+
34+
- name: Set up Go
35+
uses: actions/setup-go@v6
36+
with:
37+
go-version-file: 'go.mod'
38+
39+
- name: Lint
40+
uses: golangci/golangci-lint-action@v9
41+
42+
- name: Make tag
43+
run: |
44+
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
45+
[ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "tag=${GITHUB_REF##*/}" >> $GITHUB_ENV || true
46+
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true
47+
48+
- name: Build and push image
49+
uses: docker/build-push-action@v6
50+
with:
51+
context: .
52+
push: true
53+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.tag }}

.github/workflows/latest.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v5
13+
uses: actions/checkout@v6
1414

1515
- name: Docker Login
1616
uses: docker/login-action@v3
@@ -19,12 +19,12 @@ jobs:
1919
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
2020

2121
- name: Setup go
22-
uses: actions/setup-go@v5
22+
uses: actions/setup-go@v6
2323
with:
2424
go-version-file: 'go.mod'
2525

2626
- name: Lint
27-
uses: golangci/golangci-lint-action@v8
27+
uses: golangci/golangci-lint-action@v9
2828

2929
- name: Build the Docker images
3030
run: |

.github/workflows/pull_request.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v5
13+
uses: actions/checkout@v6
1414

1515
- name: Figure out if running fork PR
1616
id: fork
@@ -24,12 +24,12 @@ jobs:
2424
if: steps.fork.outputs.is_fork_pr == 'false'
2525

2626
- name: Setup go
27-
uses: actions/setup-go@v5
27+
uses: actions/setup-go@v6
2828
with:
2929
go-version-file: 'go.mod'
3030

3131
- name: Lint
32-
uses: golangci/golangci-lint-action@v8
32+
uses: golangci/golangci-lint-action@v9
3333

3434
- name: Build
3535
run: |

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v5
13+
uses: actions/checkout@v6
1414

1515
- name: Docker Login
1616
uses: docker/login-action@v3
@@ -19,12 +19,12 @@ jobs:
1919
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
2020

2121
- name: Setup go
22-
uses: actions/setup-go@v5
22+
uses: actions/setup-go@v6
2323
with:
2424
go-version-file: 'go.mod'
2525

2626
- name: Lint
27-
uses: golangci/golangci-lint-action@v8
27+
uses: golangci/golangci-lint-action@v9
2828

2929
- name: Build the Docker images
3030
run: |

eventrouter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ func (er *EventRouter) Run(stopCh <-chan struct{}) {
138138
}
139139

140140
// addEvent is called when an event is created, or during the initial list
141-
func (er *EventRouter) addEvent(obj interface{}) {
141+
func (er *EventRouter) addEvent(obj any) {
142142
e := obj.(*v1.Event)
143143
prometheusEvent(e)
144144
er.eSink.UpdateEvents(e, nil)
145145
}
146146

147147
// updateEvent is called any time there is an update to an existing event
148-
func (er *EventRouter) updateEvent(objOld interface{}, objNew interface{}) {
148+
func (er *EventRouter) updateEvent(objOld any, objNew any) {
149149
eOld := objOld.(*v1.Event)
150150
eNew := objNew.(*v1.Event)
151151
prometheusEvent(eNew)
@@ -206,7 +206,7 @@ func prometheusEvent(event *v1.Event) {
206206
}
207207

208208
// deleteEvent should only occur when the system garbage collects events via TTL expiration
209-
func (er *EventRouter) deleteEvent(obj interface{}) {
209+
func (er *EventRouter) deleteEvent(obj any) {
210210
e := obj.(*v1.Event)
211211
// NOTE: This should *only* happen on TTL expiration there
212212
// is no reason to push this to a sink

main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,9 @@ func main() {
138138
}
139139

140140
// Startup the EventRouter
141-
wg.Add(1)
142-
go func() {
143-
defer wg.Done()
141+
wg.Go(func() {
144142
eventRouter.Run(stop)
145-
}()
143+
})
146144

147145
// Startup the Informer(s)
148146
glog.Infof("Starting shared Informer(s)")

0 commit comments

Comments
 (0)