Skip to content

Commit a254e1c

Browse files
Update to Go 1.25 (#656)
* Initial plan * Update to Go 1.25 Co-authored-by: JaydipGabani <20255485+JaydipGabani@users.noreply.github.com> * fixing lint Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com> * fixing lint Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com> * fixing lint Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com> --------- Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JaydipGabani <20255485+JaydipGabani@users.noreply.github.com> Co-authored-by: Jaydip Gabani <gabanijaydip@gmail.com>
1 parent e3880ce commit a254e1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+431
-105
lines changed

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
3232
with:
33-
go-version: "1.22"
33+
go-version: "1.25"
3434
check-latest: true
3535
- uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4
3636
with:

constraint/.golangci.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
version: "2"
2+
13
run:
24
timeout: 5m
3-
go: "1.22"
5+
go: "1.25"
46

57
linters-settings:
68
gocritic:
@@ -24,24 +26,22 @@ linters:
2426
- gocritic
2527
- goconst
2628
- godot
27-
- gofmt
28-
- gofumpt
29-
- goimports
3029
- gosec
31-
- gosimple
3230
- govet
3331
- ineffassign
3432
- misspell
3533
- nilerr
3634
- revive # replacement for golint
3735
- staticcheck
38-
- typecheck
3936
- unused
4037
- whitespace
4138

39+
formatters:
40+
enable:
41+
- gofmt
42+
- gofumpt
43+
- goimports
44+
4245
issues:
43-
exclude-rules:
44-
- linters: [revive]
45-
text: 'redefines-builtin-id: redefinition of the built-in function new'
4646
exclude:
47-
- 'deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x'
47+
- 'deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x'

constraint/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# When updating this, make sure to update the corresponding action in
22
# workflow.yaml
3-
GOLANGCI_LINT_VERSION ?= 1.64.8
3+
GOLANGCI_LINT_VERSION ?= 2.7.2
44
KUSTOMIZE_VERSION ?= 3.8.9
55
KUBERNETES_VERSION ?= 1.29.0
66

constraint/cmd/rewrite-compatibility/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package main implements the rewrite-compatibility CLI tool for Rego rewriting.
12
package main
23

34
import (
@@ -6,7 +7,6 @@ import (
67
"os"
78

89
"github.com/golang/glog"
9-
_ "github.com/golang/glog"
1010
"github.com/spf13/cobra"
1111
"github.com/spf13/pflag"
1212

constraint/config/crds/externaldata.gatekeeper.sh_providers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ spec:
119119
- name: v1beta1
120120
schema:
121121
openAPIV3Schema:
122-
description: Provider is the Schema for the providers API
122+
description: Provider is the Schema for the providers API.
123123
properties:
124124
apiVersion:
125125
description: |-

constraint/config/crds/templates.gatekeeper.sh_constrainttemplates.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,15 @@ spec:
4141
description: ConstraintTemplateSpec defines the desired state of ConstraintTemplate.
4242
properties:
4343
crd:
44+
description: CRD defines the custom resource definition specification
45+
for the constraint.
4446
properties:
4547
spec:
48+
description: CRDSpec defines the spec for the CRD.
4649
properties:
4750
names:
51+
description: Names defines the naming conventions for the
52+
constraint kind.
4853
properties:
4954
kind:
5055
type: string
@@ -56,6 +61,8 @@ spec:
5661
validation:
5762
default:
5863
legacySchema: false
64+
description: Validation defines the schema for constraint
65+
parameters.
5966
properties:
6067
legacySchema:
6168
default: false
@@ -68,12 +75,16 @@ spec:
6875
type: object
6976
targets:
7077
items:
78+
description: Target defines the target handler and policy for the
79+
constraint template.
7180
properties:
7281
code:
7382
description: |-
7483
The source code options for the constraint template. "Rego" can only
7584
be specified in one place (either here or in the "rego" field)
7685
items:
86+
description: Code defines the policy source code for a specific
87+
engine.
7788
properties:
7889
engine:
7990
description: 'The engine used to evaluate the code. Example:
@@ -182,10 +193,15 @@ spec:
182193
description: ConstraintTemplateSpec defines the desired state of ConstraintTemplate.
183194
properties:
184195
crd:
196+
description: CRD defines the custom resource definition specification
197+
for the constraint.
185198
properties:
186199
spec:
200+
description: CRDSpec defines the spec for the CRD.
187201
properties:
188202
names:
203+
description: Names defines the naming conventions for the
204+
constraint kind.
189205
properties:
190206
kind:
191207
type: string
@@ -197,6 +213,8 @@ spec:
197213
validation:
198214
default:
199215
legacySchema: true
216+
description: Validation defines the schema for constraint
217+
parameters.
200218
properties:
201219
legacySchema:
202220
default: true
@@ -209,12 +227,16 @@ spec:
209227
type: object
210228
targets:
211229
items:
230+
description: Target defines the target handler and policy for the
231+
constraint template.
212232
properties:
213233
code:
214234
description: |-
215235
The source code options for the constraint template. "Rego" can only
216236
be specified in one place (either here or in the "rego" field)
217237
items:
238+
description: Code defines the policy source code for a specific
239+
engine.
218240
properties:
219241
engine:
220242
description: 'The engine used to evaluate the code. Example:
@@ -323,10 +345,15 @@ spec:
323345
description: ConstraintTemplateSpec defines the desired state of ConstraintTemplate.
324346
properties:
325347
crd:
348+
description: CRD defines the custom resource definition specification
349+
for the constraint.
326350
properties:
327351
spec:
352+
description: CRDSpec defines the spec for the CRD.
328353
properties:
329354
names:
355+
description: Names defines the naming conventions for the
356+
constraint kind.
330357
properties:
331358
kind:
332359
type: string
@@ -338,6 +365,8 @@ spec:
338365
validation:
339366
default:
340367
legacySchema: true
368+
description: Validation defines the schema for constraint
369+
parameters.
341370
properties:
342371
legacySchema:
343372
default: true
@@ -350,12 +379,16 @@ spec:
350379
type: object
351380
targets:
352381
items:
382+
description: Target defines the target handler and policy for the
383+
constraint template.
353384
properties:
354385
code:
355386
description: |-
356387
The source code options for the constraint template. "Rego" can only
357388
be specified in one place (either here or in the "rego" field)
358389
items:
390+
description: Code defines the policy source code for a specific
391+
engine.
359392
properties:
360393
engine:
361394
description: 'The engine used to evaluate the code. Example:

constraint/deploy/crds.yaml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,15 @@ spec:
4040
description: ConstraintTemplateSpec defines the desired state of ConstraintTemplate.
4141
properties:
4242
crd:
43+
description: CRD defines the custom resource definition specification
44+
for the constraint.
4345
properties:
4446
spec:
47+
description: CRDSpec defines the spec for the CRD.
4548
properties:
4649
names:
50+
description: Names defines the naming conventions for the
51+
constraint kind.
4752
properties:
4853
kind:
4954
type: string
@@ -55,6 +60,8 @@ spec:
5560
validation:
5661
default:
5762
legacySchema: false
63+
description: Validation defines the schema for constraint
64+
parameters.
5865
properties:
5966
legacySchema:
6067
default: false
@@ -67,12 +74,16 @@ spec:
6774
type: object
6875
targets:
6976
items:
77+
description: Target defines the target handler and policy for the
78+
constraint template.
7079
properties:
7180
code:
7281
description: |-
7382
The source code options for the constraint template. "Rego" can only
7483
be specified in one place (either here or in the "rego" field)
7584
items:
85+
description: Code defines the policy source code for a specific
86+
engine.
7687
properties:
7788
engine:
7889
description: 'The engine used to evaluate the code. Example:
@@ -181,10 +192,15 @@ spec:
181192
description: ConstraintTemplateSpec defines the desired state of ConstraintTemplate.
182193
properties:
183194
crd:
195+
description: CRD defines the custom resource definition specification
196+
for the constraint.
184197
properties:
185198
spec:
199+
description: CRDSpec defines the spec for the CRD.
186200
properties:
187201
names:
202+
description: Names defines the naming conventions for the
203+
constraint kind.
188204
properties:
189205
kind:
190206
type: string
@@ -196,6 +212,8 @@ spec:
196212
validation:
197213
default:
198214
legacySchema: true
215+
description: Validation defines the schema for constraint
216+
parameters.
199217
properties:
200218
legacySchema:
201219
default: true
@@ -208,12 +226,16 @@ spec:
208226
type: object
209227
targets:
210228
items:
229+
description: Target defines the target handler and policy for the
230+
constraint template.
211231
properties:
212232
code:
213233
description: |-
214234
The source code options for the constraint template. "Rego" can only
215235
be specified in one place (either here or in the "rego" field)
216236
items:
237+
description: Code defines the policy source code for a specific
238+
engine.
217239
properties:
218240
engine:
219241
description: 'The engine used to evaluate the code. Example:
@@ -322,10 +344,15 @@ spec:
322344
description: ConstraintTemplateSpec defines the desired state of ConstraintTemplate.
323345
properties:
324346
crd:
347+
description: CRD defines the custom resource definition specification
348+
for the constraint.
325349
properties:
326350
spec:
351+
description: CRDSpec defines the spec for the CRD.
327352
properties:
328353
names:
354+
description: Names defines the naming conventions for the
355+
constraint kind.
329356
properties:
330357
kind:
331358
type: string
@@ -337,6 +364,8 @@ spec:
337364
validation:
338365
default:
339366
legacySchema: true
367+
description: Validation defines the schema for constraint
368+
parameters.
340369
properties:
341370
legacySchema:
342371
default: true
@@ -349,12 +378,16 @@ spec:
349378
type: object
350379
targets:
351380
items:
381+
description: Target defines the target handler and policy for the
382+
constraint template.
352383
properties:
353384
code:
354385
description: |-
355386
The source code options for the constraint template. "Rego" can only
356387
be specified in one place (either here or in the "rego" field)
357388
items:
389+
description: Code defines the policy source code for a specific
390+
engine.
358391
properties:
359392
engine:
360393
description: 'The engine used to evaluate the code. Example:
@@ -557,7 +590,7 @@ spec:
557590
- name: v1beta1
558591
schema:
559592
openAPIV3Schema:
560-
description: Provider is the Schema for the providers API
593+
description: Provider is the Schema for the providers API.
561594
properties:
562595
apiVersion:
563596
description: |-

constraint/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/open-policy-agent/frameworks/constraint
22

3-
go 1.24.6
3+
go 1.25
44

55
require (
66
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc

0 commit comments

Comments
 (0)