Skip to content

Commit c263b55

Browse files
committed
update build pipeline
Update to go 1.22.x
1 parent 589df29 commit c263b55

File tree

12 files changed

+232
-93
lines changed

12 files changed

+232
-93
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@networkop
1+
@gcleroux

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88

99
jobs:
1010
# Linting is in a separate job because golangci-lint is quite slow when
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/setup-go@v4
1616
with:
17-
go-version: 1.21.x
17+
go-version: 1.22.x
1818
- name: Checkout code
1919
uses: actions/checkout@v3
2020
- name: golangci-lint
@@ -28,6 +28,6 @@ jobs:
2828
steps:
2929
- uses: actions/setup-go@v2
3030
with:
31-
go-version: 1.21.x
31+
go-version: 1.22.x
3232
- uses: actions/checkout@v2
3333
- run: make test

.github/workflows/docker.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,33 @@ name: docker
22

33
on:
44
push:
5-
branches: [ master ]
6-
5+
branches: [master]
6+
77
jobs:
88
docker:
99
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
1015
steps:
11-
-
12-
name: Checkout code
16+
- name: Checkout code
1317
uses: actions/checkout@v2
1418
- name: Setup Go
1519
uses: actions/setup-go@v2
1620
with:
17-
go-version: 1.21.x
18-
-
19-
name: Set up Docker Buildx
21+
go-version: 1.22.x
22+
- name: Set up Docker Buildx
2023
uses: docker/setup-buildx-action@v1
21-
-
22-
name: Login to Container Registry
23-
uses: docker/login-action@v1
24+
25+
- name: Log in to the Container registry
26+
uses: docker/login-action@v3
2427
with:
25-
registry: quay.io
26-
username: ${{ secrets.DOCKER_LOGIN }}
27-
password: ${{ secrets.DOCKER_PASSWORD }}
28-
-
29-
name: Build and Push container images
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and Push container images
3033
run: |
3134
make docker

.github/workflows/release.yml

Lines changed: 68 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,96 @@ name: release
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
jobs:
99
go-release:
1010
runs-on: ubuntu-latest
1111
steps:
12-
-
13-
name: Checkout
12+
- name: Checkout
1413
uses: actions/checkout@v2
1514
with:
1615
fetch-depth: 0
17-
-
18-
name: Set up Go
16+
- name: Set up Go
1917
uses: actions/setup-go@v2
2018
with:
21-
go-version: 1.21
22-
-
23-
name: Run GoReleaser
24-
uses: goreleaser/goreleaser-action@v2
19+
go-version: 1.22
20+
- name: Run GoReleaser
21+
uses: goreleaser/goreleaser-action@v6
2522
with:
2623
version: latest
27-
args: release --rm-dist
24+
args: release --clean
2825
env:
2926
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3027
docker-release:
3128
runs-on: ubuntu-latest
29+
30+
permissions:
31+
contents: read
32+
packages: write
33+
3234
steps:
33-
-
34-
name: Checkout
35+
- name: Checkout
3536
uses: actions/checkout@v2
3637
with:
3738
fetch-depth: 0
39+
3840
- name: Setup Go
3941
uses: actions/setup-go@v2
4042
with:
41-
go-version: 1.21.x
42-
-
43-
name: Set up Docker Buildx
43+
go-version: 1.22.x
44+
45+
- name: Set up Docker Buildx
4446
uses: docker/setup-buildx-action@v1
45-
-
46-
name: Login to Container Registry
47-
uses: docker/login-action@v1
48-
with:
49-
registry: quay.io
50-
username: ${{ secrets.DOCKER_LOGIN }}
51-
password: ${{ secrets.DOCKER_PASSWORD }}
52-
-
53-
name: Build and Push container images
47+
48+
- name: Log in to the Container registry
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Build and Push container images
5456
run: |
55-
make release
57+
make release
58+
59+
helm-oci-release:
60+
runs-on: ubuntu-latest
61+
permissions:
62+
contents: write
63+
id-token: write
64+
packages: write
65+
outputs:
66+
chart-digest: ${{ steps.helm_publish.outputs.digest }}
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v4
70+
with:
71+
fetch-depth: 0
72+
73+
# Extract the version from Chart.yaml
74+
- name: Extract chart version
75+
uses: mikefarah/yq@v4
76+
id: chart_version
77+
with:
78+
cmd: |
79+
VERSION=$(yq '.version' charts/k8s-gateway/Chart.yaml)
80+
echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT
81+
82+
- name: Extract appVersion
83+
id: app_version
84+
run: echo "appVersion=$(echo ${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
85+
86+
- name: Helm | Publish
87+
id: helm_publish
88+
uses: peak-scale/github-actions/helm-oci-chart@38322faabccd75abfa581c435e367d446b6d2c3b # v0.1.0
89+
with:
90+
registry: ghcr.io
91+
repository: ${{ github.repository_owner }}/charts
92+
name: "k8s-gateway"
93+
version: ${{ steps.chart_version.outputs.version }}
94+
app-version: ${{ steps.app_version.outputs.appVersion }}
95+
registry-username: ${{ github.actor }}
96+
registry-password: ${{ secrets.GITHUB_TOKEN }}
97+
update-dependencies: "true" # Defaults to false
98+

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=${BUILDPLATFORM} docker.io/library/golang:1.21.5 as builder
1+
FROM --platform=${BUILDPLATFORM} docker.io/library/golang:1.22.7 AS builder
22

33
ARG LDFLAGS
44

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LDFLAGS := "-s -w -X github.com/coredns/coredns/coremain.GitCommit=$(COMMIT)"
66
ARCHS := "linux/amd64,linux/arm64,linux/mips64"
77

88
# Where to push the docker image.
9-
REGISTRY ?= quay.io/oriedge
9+
REGISTRY ?= ghcr.io/pinax-network
1010

1111

1212
# Image URL to use all building/pushing image targets

apex_dual_test.go

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,54 @@ import (
1414

1515
func setupEmptyLookupFuncs() {
1616
if resource := lookupResource("HTTPRoute"); resource != nil {
17-
resource.lookup = func(_ []string) []netip.Addr { return []netip.Addr{} }
17+
resource.lookup = func(_ []string) []interface{} {
18+
addrs := []netip.Addr{}
19+
result := make([]interface{}, len(addrs))
20+
for i, addr := range addrs {
21+
result[i] = addr
22+
}
23+
return result
24+
}
1825
}
1926
if resource := lookupResource("TLSRoute"); resource != nil {
20-
resource.lookup = func(_ []string) []netip.Addr { return []netip.Addr{} }
27+
resource.lookup = func(_ []string) []interface{} {
28+
addrs := []netip.Addr{}
29+
result := make([]interface{}, len(addrs))
30+
for i, addr := range addrs {
31+
result[i] = addr
32+
}
33+
return result
34+
}
2135
}
2236
if resource := lookupResource("GRPCRoute"); resource != nil {
23-
resource.lookup = func(_ []string) []netip.Addr { return []netip.Addr{} }
37+
resource.lookup = func(_ []string) []interface{} {
38+
addrs := []netip.Addr{}
39+
result := make([]interface{}, len(addrs))
40+
for i, addr := range addrs {
41+
result[i] = addr
42+
}
43+
return result
44+
}
2445
}
2546
if resource := lookupResource("Ingress"); resource != nil {
26-
resource.lookup = func(_ []string) []netip.Addr { return []netip.Addr{} }
47+
resource.lookup = func(_ []string) []interface{} {
48+
addrs := []netip.Addr{}
49+
result := make([]interface{}, len(addrs))
50+
for i, addr := range addrs {
51+
result[i] = addr
52+
}
53+
return result
54+
}
2755
}
2856
if resource := lookupResource("Service"); resource != nil {
29-
resource.lookup = func(_ []string) []netip.Addr { return []netip.Addr{} }
57+
resource.lookup = func(_ []string) []interface{} {
58+
addrs := []netip.Addr{}
59+
result := make([]interface{}, len(addrs))
60+
for i, addr := range addrs {
61+
result[i] = addr
62+
}
63+
return result
64+
}
3065
}
3166
}
3267

@@ -69,7 +104,9 @@ var testsDualNS = []test.Case{
69104
Qname: "example.com.", Qtype: dns.TypeSOA,
70105
Rcode: dns.RcodeSuccess,
71106
Answer: []dns.RR{
72-
test.SOA("example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5"),
107+
test.SOA(
108+
"example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5",
109+
),
73110
},
74111
},
75112
{
@@ -88,42 +125,54 @@ var testsDualNS = []test.Case{
88125
Qname: "example.com.", Qtype: dns.TypeSRV,
89126
Rcode: dns.RcodeSuccess,
90127
Ns: []dns.RR{
91-
test.SOA("example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5"),
128+
test.SOA(
129+
"example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5",
130+
),
92131
},
93132
},
94133
{
95134
Qname: "example.com.", Qtype: dns.TypeA,
96135
Rcode: dns.RcodeSuccess,
97136
Ns: []dns.RR{
98-
test.SOA("example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5"),
137+
test.SOA(
138+
"example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5",
139+
),
99140
},
100141
},
101142
{
102143
Qname: "dns1.kube-system.example.com.", Qtype: dns.TypeSRV,
103144
Rcode: dns.RcodeSuccess,
104145
Ns: []dns.RR{
105-
test.SOA("example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5"),
146+
test.SOA(
147+
"example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5",
148+
),
106149
},
107150
},
108151
{
109152
Qname: "dns1.kube-system.example.com.", Qtype: dns.TypeNS,
110153
Rcode: dns.RcodeSuccess,
111154
Ns: []dns.RR{
112-
test.SOA("example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5"),
155+
test.SOA(
156+
"example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5",
157+
),
113158
},
114159
},
115160
{
116161
Qname: "dns1.kube-system.example.com.", Qtype: dns.TypeSOA,
117162
Rcode: dns.RcodeSuccess,
118163
Ns: []dns.RR{
119-
test.SOA("example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5"),
164+
test.SOA(
165+
"example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5",
166+
),
120167
},
121168
},
122169
{
123170
Qname: "dns1.kube-system.example.com.", Qtype: dns.TypeAAAA,
124171
Rcode: dns.RcodeSuccess,
125172
Ns: []dns.RR{
126-
test.SOA("example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5"),
173+
test.SOA(
174+
"example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5",
175+
),
127176
},
128177
},
129178
{
@@ -137,7 +186,9 @@ var testsDualNS = []test.Case{
137186
Qname: "foo.dns1.kube-system.example.com.", Qtype: dns.TypeA,
138187
Rcode: dns.RcodeNameError,
139188
Ns: []dns.RR{
140-
test.SOA("example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5"),
189+
test.SOA(
190+
"example.com. 60 IN SOA dns1.kube-system.example.com. hostmaster.example.com. 1499347823 7200 1800 86400 5",
191+
),
141192
},
142193
},
143194
}

cmd/coredns.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55

66
_ "github.com/coredns/coredns/core/plugin"
7-
_ "github.com/ori-edge/k8s_gateway"
7+
_ "github.com/pinax-network/k8s_gateway"
88

99
"github.com/coredns/caddy"
1010
"github.com/coredns/coredns/core/dnsserver"
@@ -16,7 +16,7 @@ var dropPlugins = map[string]bool{
1616
"k8s_external": true,
1717
}
1818

19-
const pluginVersion = "0.4.0"
19+
const pluginVersion = "0.5.0"
2020

2121
func init() {
2222
var directives []string
@@ -35,7 +35,6 @@ func init() {
3535
}
3636

3737
dnsserver.Directives = directives
38-
3938
}
4039

4140
func main() {

0 commit comments

Comments
 (0)