Skip to content

Commit

Permalink
Code cleanup/lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kralicky committed May 1, 2024
1 parent f800d9d commit 62e17fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/iancoleman/strcase v0.3.0
github.com/martinlindhe/base36 v1.1.1
github.com/open-policy-agent/opa v0.63.0
github.com/pomerium/csrf v1.7.0
github.com/pomerium/pomerium v0.25.1-0.20240422190537-cc0a989cc067
github.com/rs/zerolog v1.32.0
github.com/sergi/go-diff v1.3.1
Expand Down Expand Up @@ -153,7 +154,6 @@ require (
github.com/philhofer/fwd v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pomerium/csrf v1.7.0 // indirect
github.com/pomerium/datasource v0.18.2-0.20221108160055-c6134b5ed524 // indirect
github.com/pomerium/webauthn v0.0.0-20221118023040-00a9c430578b // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
Expand Down
3 changes: 2 additions & 1 deletion pomerium/ingress_to_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ func ruleToRoute(rule networkingv1.IngressRule, tmpl *pb.Route, ic *model.Ingres
if ic.IsAnnotationSet(model.SubtleAllowEmptyHost) {
rule.Host = "*"
} else {
return nil, fmt.Errorf("ingress rule has empty host; if this is intentional, set the annotation '%s/%s=true'", ic.AnnotationPrefix, model.SubtleAllowEmptyHost)
return nil, fmt.Errorf("ingress rule has empty host; if this is intentional, set the annotation '%s/%s=true'",
ic.AnnotationPrefix, model.SubtleAllowEmptyHost)
}
}

Expand Down
3 changes: 2 additions & 1 deletion pomerium/routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1377,5 +1377,6 @@ func TestEmptyHostRoute(t *testing.T) {

clear(ic.Annotations)

require.Error(t, upsertRoutes(context.Background(), &config, ic))
require.ErrorContains(t, upsertRoutes(context.Background(), &config, ic),
"ingress rule has empty host")
}

0 comments on commit 62e17fd

Please sign in to comment.