feat: Update golangci-lint version to 1.62.0 and go version to 1.23
Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
This commit is contained in:
parent
1051995ad6
commit
3a378c7b38
9 changed files with 22 additions and 27 deletions
|
|
@ -854,7 +854,7 @@ func TestUpdateNetworkRanges(t *testing.T) {
|
|||
networkRangesStates["pr-3"] = true
|
||||
|
||||
// Handler for getting all network ranges
|
||||
getAllNetworkRangesHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
getAllNetworkRangesHandler := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
if tt.getAllNetworkRangesFails {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ func TestReadCredentials(t *testing.T) {
|
|||
t.Fatalf("Failed to marshal mocked response: %v", err)
|
||||
}
|
||||
|
||||
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
handler := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
if tt.getCredentialsFails {
|
||||
w.WriteHeader(http.StatusBadGateway)
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ func TestUpdateACLs(t *testing.T) {
|
|||
aclsStates["acl-3"] = true
|
||||
|
||||
// Handler for getting all ACLs
|
||||
getAllACLsHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
getAllACLsHandler := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
if tt.getAllACLsFails {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ func (r *clusterResource) Schema(_ context.Context, _ resource.SchemaRequest, re
|
|||
Optional: true,
|
||||
DeprecationMessage: "Use `kubernetes_version_min instead`. Setting a specific kubernetes version would cause errors during minor version upgrades due to forced updates. In those cases, this field might not represent the actual kubernetes version used in the cluster.",
|
||||
PlanModifiers: []planmodifier.String{
|
||||
stringplanmodifier.RequiresReplaceIf(stringplanmodifier.RequiresReplaceIfFunc(func(ctx context.Context, sr planmodifier.StringRequest, rrifr *stringplanmodifier.RequiresReplaceIfFuncResponse) {
|
||||
stringplanmodifier.RequiresReplaceIf(stringplanmodifier.RequiresReplaceIfFunc(func(_ context.Context, sr planmodifier.StringRequest, rrifr *stringplanmodifier.RequiresReplaceIfFuncResponse) {
|
||||
if sr.StateValue.IsNull() || sr.PlanValue.IsNull() {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func UUID() *Validator {
|
|||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
if _, err := uuid.Parse(req.ConfigValue.ValueString()); err != nil {
|
||||
resp.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic(
|
||||
req.Path,
|
||||
|
|
@ -71,7 +71,7 @@ func IP() *Validator {
|
|||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
if net.ParseIP(req.ConfigValue.ValueString()) == nil {
|
||||
resp.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic(
|
||||
req.Path,
|
||||
|
|
@ -127,7 +127,7 @@ func NoSeparator() *Validator {
|
|||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
if strings.Contains(req.ConfigValue.ValueString(), core.Separator) {
|
||||
resp.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic(
|
||||
req.Path,
|
||||
|
|
@ -144,7 +144,7 @@ func NonLegacyProjectRole() *Validator {
|
|||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
if utils.IsLegacyProjectRole(req.ConfigValue.ValueString()) {
|
||||
resp.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic(
|
||||
req.Path,
|
||||
|
|
@ -161,7 +161,7 @@ func MinorVersionNumber() *Validator {
|
|||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
exp := MajorMinorVersionRegex
|
||||
r := regexp.MustCompile(exp)
|
||||
version := req.ConfigValue.ValueString()
|
||||
|
|
@ -181,7 +181,7 @@ func VersionNumber() *Validator {
|
|||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
minorVersionExp := MajorMinorVersionRegex
|
||||
minorVersionRegex := regexp.MustCompile(minorVersionExp)
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ func RFC3339SecondsOnly() *Validator {
|
|||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
t, err := time.Parse(time.RFC3339, req.ConfigValue.ValueString())
|
||||
if err != nil {
|
||||
resp.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic(
|
||||
|
|
@ -233,7 +233,7 @@ func CIDR() *Validator {
|
|||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
_, _, err := net.ParseCIDR(req.ConfigValue.ValueString())
|
||||
if err != nil {
|
||||
resp.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic(
|
||||
|
|
@ -251,7 +251,7 @@ func Rrule() *Validator {
|
|||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
// The go library rrule-go expects \n before RRULE (to be a newline and not a space)
|
||||
// for example: "DTSTART;TZID=America/New_York:19970902T090000\nRRULE:FREQ=DAILY;COUNT=10"
|
||||
// whereas a valid rrule according to the API docs is:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue