-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NET-8091] Use file-system-certificate in Consul instead of inline-certificate #3767
Changes from 22 commits
646368f
369cc73
56de8f7
0eac4cb
81c971a
6274032
8a7d1f3
b085855
eea56af
df40b49
6fd8c41
d4eacdd
4a6b335
83ac9c9
62d4e6f
414a89b
c2ff1bc
3a1550e
9535504
dfa2d5a
f5d90c5
ff75396
42f02b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:feature | ||
gateways: api-gateway now uses the Consul file-system-certificate by default for TLS | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,19 +55,19 @@ var ( | |
) | ||
|
||
type resourceMapResources struct { | ||
grants []gwv1beta1.ReferenceGrant | ||
secrets []corev1.Secret | ||
gateways []gwv1beta1.Gateway | ||
httpRoutes []gwv1beta1.HTTPRoute | ||
tcpRoutes []gwv1alpha2.TCPRoute | ||
meshServices []v1alpha1.MeshService | ||
services []types.NamespacedName | ||
jwtProviders []*v1alpha1.JWTProvider | ||
gatewayPolicies []*v1alpha1.GatewayPolicy | ||
externalAuthFilters []*v1alpha1.RouteAuthFilter | ||
consulInlineCertificates []api.InlineCertificateConfigEntry | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we have both here so that we don't miss any regressions on how we handle inline certs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So by default on upgrade the API Gateway will be replacing the inline cert with the file-system. So may not be an issue here? |
||
consulHTTPRoutes []api.HTTPRouteConfigEntry | ||
consulTCPRoutes []api.TCPRouteConfigEntry | ||
grants []gwv1beta1.ReferenceGrant | ||
secrets []corev1.Secret | ||
gateways []gwv1beta1.Gateway | ||
httpRoutes []gwv1beta1.HTTPRoute | ||
tcpRoutes []gwv1alpha2.TCPRoute | ||
meshServices []v1alpha1.MeshService | ||
services []types.NamespacedName | ||
jwtProviders []*v1alpha1.JWTProvider | ||
gatewayPolicies []*v1alpha1.GatewayPolicy | ||
externalAuthFilters []*v1alpha1.RouteAuthFilter | ||
consulFileSystemCertificates []api.FileSystemCertificateConfigEntry | ||
consulHTTPRoutes []api.HTTPRouteConfigEntry | ||
consulTCPRoutes []api.TCPRouteConfigEntry | ||
} | ||
|
||
func newTestResourceMap(t *testing.T, resources resourceMapResources) *common.ResourceMap { | ||
|
@@ -282,7 +282,7 @@ func TestBinder_Lifecycle(t *testing.T) { | |
Protocol: "http", | ||
TLS: api.APIGatewayTLSConfiguration{ | ||
Certificates: []api.ResourceReference{{ | ||
Kind: api.InlineCertificate, | ||
Kind: api.FileSystemCertificate, | ||
Name: "secret-one", | ||
}}, | ||
}, | ||
|
@@ -644,7 +644,7 @@ func TestBinder_Lifecycle(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
consulInlineCertificates: []api.InlineCertificateConfigEntry{ | ||
consulFileSystemCertificates: []api.FileSystemCertificateConfigEntry{ | ||
*certificateOne, | ||
*certificateTwo, | ||
}, | ||
|
@@ -771,7 +771,7 @@ func TestBinder_Lifecycle(t *testing.T) { | |
expectedConsulDeletions: []api.ResourceReference{ | ||
{Kind: api.HTTPRoute, Name: "http-route-one"}, | ||
{Kind: api.TCPRoute, Name: "tcp-route-one"}, | ||
{Kind: api.InlineCertificate, Name: "secret-two"}, | ||
{Kind: api.FileSystemCertificate, Name: "secret-two"}, | ||
{Kind: api.APIGateway, Name: "gateway-deleted"}, | ||
}, | ||
}, | ||
|
@@ -3133,7 +3133,7 @@ func controlledBinder(config BinderConfig) BinderConfig { | |
return config | ||
} | ||
|
||
func generateTestCertificate(t *testing.T, namespace, name string) (*api.InlineCertificateConfigEntry, corev1.Secret) { | ||
func generateTestCertificate(t *testing.T, namespace, name string) (*api.FileSystemCertificateConfigEntry, corev1.Secret) { | ||
privateKey, err := rsa.GenerateKey(rand.Reader, common.MinKeyLength) | ||
require.NoError(t, err) | ||
|
||
|
@@ -3180,8 +3180,7 @@ func generateTestCertificate(t *testing.T, namespace, name string) (*api.InlineC | |
}, | ||
} | ||
|
||
certificate, err := (common.ResourceTranslator{}).ToInlineCertificate(secret) | ||
require.NoError(t, err) | ||
certificate := (common.ResourceTranslator{}).ToFileSystemCertificate(secret) | ||
|
||
return certificate, secret | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine to update here? I imagine this gets reset whenever we do a release.