-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[installer] Add serviceAnnotations
config to proxy
#9773
Changes from all commits
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ import ( | |
|
||
func TestServiceLoadBalancerIP(t *testing.T) { | ||
const loadBalancerIP = "123.456.789.0" | ||
ctx := renderContextWithLoadBalancerIP(t, loadBalancerIP) | ||
ctx := renderContextWithProxyConfig(t, &experimental.ProxyConfig{StaticIP: loadBalancerIP}) | ||
|
||
objects, err := service(ctx) | ||
require.NoError(t, err) | ||
|
@@ -27,13 +27,28 @@ func TestServiceLoadBalancerIP(t *testing.T) { | |
require.Equal(t, loadBalancerIP, svc.Spec.LoadBalancerIP) | ||
} | ||
|
||
func renderContextWithLoadBalancerIP(t *testing.T, loadBalancerIp string) *common.RenderContext { | ||
func TestServiceAnnotations(t *testing.T) { | ||
annotations := map[string]string{"hello": "world"} | ||
|
||
ctx := renderContextWithProxyConfig(t, &experimental.ProxyConfig{ServiceAnnotations: annotations}) | ||
|
||
objects, err := service(ctx) | ||
require.NoError(t, err) | ||
|
||
require.Len(t, objects, 1, "must render only one object") | ||
|
||
svc := objects[0].(*corev1.Service) | ||
for k, v := range annotations { | ||
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 be possible to use 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. What we are checking here is slightly different; we need to check that the extra annotations are a subset of those on the rendered service. The installer hard-codes a couple of annotations too. |
||
require.Equalf(t, annotations[k], svc.Annotations[k], | ||
"expected to find annotation %q:%q on proxy service, but found %q:%q", k, v, k, svc.Annotations[k]) | ||
} | ||
} | ||
|
||
func renderContextWithProxyConfig(t *testing.T, proxyConfig *experimental.ProxyConfig) *common.RenderContext { | ||
ctx, err := common.NewRenderContext(config.Config{ | ||
Experimental: &experimental.Config{ | ||
WebApp: &experimental.WebAppConfig{ | ||
ProxyConfig: &experimental.ProxyConfig{ | ||
StaticIP: loadBalancerIp, | ||
}, | ||
ProxyConfig: proxyConfig, | ||
}, | ||
}, | ||
}, versions.Manifest{ | ||
|
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.
💯