-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update secrets interface to work for CEL export (#4383)
* Interface is now ExportKubernetesSecrets. * Now accepts additionalSecrets. * Now returns KubernetesSecretExportResult including RawSecrets map[string]string, which can be passed to CEL. * Also a new ExportConfigMaps interface for ConfigMaps.
- Loading branch information
Showing
99 changed files
with
2,246 additions
and
593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
v2/api/apimanagement/customizations/subscription_extensions_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT license. | ||
*/ | ||
|
||
package customizations | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
. "github.com/onsi/gomega" | ||
|
||
apimanagement "github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801/storage" | ||
"github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" | ||
testreflect "github.com/Azure/azure-service-operator/v2/internal/testcommon/reflect" | ||
) | ||
|
||
func Test_SecretsSpecified_AllSecretsSpecifiedAllSecretsReturned(t *testing.T) { | ||
t.Parallel() | ||
g := NewGomegaWithT(t) | ||
|
||
secrets := &apimanagement.SubscriptionOperatorSecrets{} | ||
testreflect.PopulateStruct(secrets) | ||
|
||
obj := &apimanagement.Subscription{ | ||
Spec: apimanagement.Subscription_Spec{ | ||
OperatorSpec: &apimanagement.SubscriptionOperatorSpec{ | ||
Secrets: secrets, | ||
}, | ||
}, | ||
} | ||
secretNames := secretsSpecified(obj) | ||
expectedTags := reflecthelpers.GetJSONTags(reflect.TypeOf(apimanagement.SubscriptionOperatorSecrets{})) | ||
expectedTags.Remove("$propertyBag") | ||
|
||
g.Expect(expectedTags).To(Equal(secretNames)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.