Skip to content
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

Bug 1877960: [release-4.5] router-secrets: set named certificates to empty array instead of nil when none found #342

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -43,6 +43,7 @@ GO_TEST_PACKAGES :=./pkg/... ./cmd/...
# make test-e2e
test-e2e: GO_TEST_PACKAGES :=./test/e2e/...
test-e2e: GO_TEST_FLAGS += -v
test-e2e: GO_TEST_FLAGS += -count 1
test-e2e: test-unit
.PHONY: test-e2e

Expand Down
Expand Up @@ -32,7 +32,7 @@ func ObserveRouterSecret(genericlisters configobserver.Listers, recorder events.
}

observedConfig := map[string]interface{}{}
if err := unstructured.SetNestedField(
if err := unstructured.SetNestedSlice(
observedConfig,
observedNamedCertificates,
namedCertificatesPath...,
Expand All @@ -54,7 +54,7 @@ func ObserveRouterSecret(genericlisters configobserver.Listers, recorder events.
}

func routerSecretToSNI(routerSecret *corev1.Secret) ([]interface{}, error) {
var certs []interface{}
certs := []interface{}{}
// make sure the output slice of named certs is sorted by domain so that the generated config is deterministic
for _, domain := range sets.StringKeySet(routerSecret.Data).List() {
certs = append(certs, map[string]interface{}{
Expand Down