mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-22 15:38:06 +00:00
Fix tests
This commit is contained in:
@@ -232,7 +232,7 @@ var tests = []testReconcileItem{
|
|||||||
expectedError: nil,
|
expectedError: nil,
|
||||||
expectedResultSecret: &corev1.Secret{
|
expectedResultSecret: &corev1.Secret{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "my-secret-it3m",
|
Name: "my-sECReT-it3m",
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
op.VersionAnnotation: fmt.Sprint(version),
|
op.VersionAnnotation: fmt.Sprint(version),
|
||||||
@@ -264,7 +264,7 @@ var tests = []testReconcileItem{
|
|||||||
expectedError: nil,
|
expectedError: nil,
|
||||||
expectedResultSecret: &corev1.Secret{
|
expectedResultSecret: &corev1.Secret{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "my-secret-it3m",
|
Name: "my-sECReT-it3m",
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
op.VersionAnnotation: fmt.Sprint(version),
|
op.VersionAnnotation: fmt.Sprint(version),
|
||||||
@@ -274,7 +274,7 @@ var tests = []testReconcileItem{
|
|||||||
"password": []byte(password),
|
"password": []byte(password),
|
||||||
"username": []byte(username),
|
"username": []byte(username),
|
||||||
"first-host": []byte(firstHost),
|
"first-host": []byte(firstHost),
|
||||||
"aws-access-key": []byte(awsKey),
|
"AWS-Access-Key": []byte(awsKey),
|
||||||
"ice-cream-type": []byte(iceCream),
|
"ice-cream-type": []byte(iceCream),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -102,7 +102,7 @@ func TestBuildKubernetesSecretFromOnePasswordItem(t *testing.T) {
|
|||||||
item.Fields = generateFields(5)
|
item.Fields = generateFields(5)
|
||||||
|
|
||||||
kubeSecret := BuildKubernetesSecretFromOnePasswordItem(name, namespace, annotations, item)
|
kubeSecret := BuildKubernetesSecretFromOnePasswordItem(name, namespace, annotations, item)
|
||||||
if kubeSecret.Name != strings.ToLower(name) {
|
if kubeSecret.Name != name {
|
||||||
t.Errorf("Expected name value: %v but got: %v", name, kubeSecret.Name)
|
t.Errorf("Expected name value: %v but got: %v", name, kubeSecret.Name)
|
||||||
}
|
}
|
||||||
if kubeSecret.Namespace != namespace {
|
if kubeSecret.Namespace != namespace {
|
||||||
@@ -116,7 +116,7 @@ func TestBuildKubernetesSecretFromOnePasswordItem(t *testing.T) {
|
|||||||
|
|
||||||
func TestBuildKubernetesSecretFixesInvalidLabels(t *testing.T) {
|
func TestBuildKubernetesSecretFixesInvalidLabels(t *testing.T) {
|
||||||
name := "inV@l1d k8s secret%name"
|
name := "inV@l1d k8s secret%name"
|
||||||
expectedName := "inv-l1d-k8s-secret-name"
|
expectedName := "inV-l1d-k8s-secret-name"
|
||||||
namespace := "someNamespace"
|
namespace := "someNamespace"
|
||||||
annotations := map[string]string{
|
annotations := map[string]string{
|
||||||
"annotationKey": "annotationValue",
|
"annotationKey": "annotationValue",
|
||||||
|
Reference in New Issue
Block a user