-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Elasticsearch field from CRDs (#1687)
* Remove Elasticsearch field from CRDs Use an annotation to manage association configuration instead of the publicly visible Elasticsearch field in Kibana and APM objects. * Fix lint issue * Fix typo * Address CR comments
- Loading branch information
1 parent
3144a76
commit 2686c67
Showing
35 changed files
with
1,069 additions
and
754 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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,77 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestAssociationConfIsConfigured(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
assocConf *AssociationConf | ||
want bool | ||
}{ | ||
{ | ||
name: "nil object", | ||
want: false, | ||
}, | ||
{ | ||
name: "missing URL", | ||
assocConf: &AssociationConf{ | ||
AuthSecretName: "auth-secret", | ||
AuthSecretKey: "elastic", | ||
CASecretName: "ca-secret", | ||
}, | ||
want: false, | ||
}, | ||
{ | ||
name: "missing auth secret name", | ||
assocConf: &AssociationConf{ | ||
AuthSecretKey: "elastic", | ||
CASecretName: "ca-secret", | ||
URL: "https://my-es.svc", | ||
}, | ||
want: false, | ||
}, | ||
{ | ||
name: "missing auth secret key", | ||
assocConf: &AssociationConf{ | ||
AuthSecretName: "auth-secret", | ||
CASecretName: "ca-secret", | ||
URL: "https://my-es.svc", | ||
}, | ||
want: false, | ||
}, | ||
{ | ||
name: "missing CA secret name", | ||
assocConf: &AssociationConf{ | ||
AuthSecretName: "auth-secret", | ||
AuthSecretKey: "elastic", | ||
URL: "https://my-es.svc", | ||
}, | ||
want: false, | ||
}, | ||
{ | ||
name: "correctly configured", | ||
assocConf: &AssociationConf{ | ||
AuthSecretName: "auth-secret", | ||
AuthSecretKey: "elastic", | ||
CASecretName: "ca-secret", | ||
URL: "https://my-es.svc", | ||
}, | ||
want: true, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
got := tt.assocConf.IsConfigured() | ||
require.Equal(t, tt.want, got) | ||
}) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.