Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay committed Mar 24, 2022
1 parent 66ed996 commit 66c9063
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion apis/v1/jaeger_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ type ElasticsearchSpec struct {
// This is a preferred setting for new Jaeger deployments on OCP versions newer than 4.6.
// The cert management feature was added to Red Hat Openshift logging 5.2 in OCP 4.7.
// +optional
UseESCertManagement *bool `json:"useESCertManagement,omitempty"`
UseCertManagement *bool `json:"useCertManagement,omitempty"`

// +optional
Image string `json:"image,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions apis/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundle/manifests/jaegertracing.io_jaegers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9540,7 +9540,7 @@ spec:
type: object
type: array
x-kubernetes-list-type: atomic
useESCertManagement:
useCertManagement:
type: boolean
type: object
esIndexCleaner:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/jaegertracing.io_jaegers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9539,7 +9539,7 @@ spec:
type: object
type: array
x-kubernetes-list-type: atomic
useESCertManagement:
useCertManagement:
type: boolean
type: object
esIndexCleaner:
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -37105,7 +37105,7 @@ Resource Types:
</td>
<td>false</td>
</tr><tr>
<td><b>useESCertManagement</b></td>
<td><b>useCertManagement</b></td>
<td>boolean</td>
<td>
<br/>
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/jaeger/jaeger_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ func (r *ReconcileJaeger) apply(ctx context.Context, jaeger v1.Jaeger, str strat
// therefore running this here and not in the strategy
if v1.ShouldInjectOpenShiftElasticsearchConfiguration(jaeger.Spec.Storage) &&
// generate the certs only if cert management is disabled
(jaeger.Spec.Storage.Elasticsearch.UseESCertManagement == nil ||
*jaeger.Spec.Storage.Elasticsearch.UseESCertManagement == false) {
(jaeger.Spec.Storage.Elasticsearch.UseCertManagement == nil ||
*jaeger.Spec.Storage.Elasticsearch.UseCertManagement == false) {

opts := client.MatchingLabels(map[string]string{
"app.kubernetes.io/instance": jaeger.Name,
Expand Down
10 changes: 5 additions & 5 deletions pkg/storage/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ const (
)

func (ed *ElasticsearchDeployment) getCertPath() string {
if ed.Jaeger.Spec.Storage.Elasticsearch.UseESCertManagement != nil && *ed.Jaeger.Spec.Storage.Elasticsearch.UseESCertManagement {
if ed.Jaeger.Spec.Storage.Elasticsearch.UseCertManagement != nil && *ed.Jaeger.Spec.Storage.Elasticsearch.UseCertManagement {
return certPathESCertManagement
}
return certPath
}

func (ed *ElasticsearchDeployment) getCertKeyPath() string {
if ed.Jaeger.Spec.Storage.Elasticsearch.UseESCertManagement != nil && *ed.Jaeger.Spec.Storage.Elasticsearch.UseESCertManagement {
if ed.Jaeger.Spec.Storage.Elasticsearch.UseCertManagement != nil && *ed.Jaeger.Spec.Storage.Elasticsearch.UseCertManagement {
return keyPathESCertManagement
}
return keyPath
}

func (ed *ElasticsearchDeployment) getCertCaPath() string {
if ed.Jaeger.Spec.Storage.Elasticsearch.UseESCertManagement != nil && *ed.Jaeger.Spec.Storage.Elasticsearch.UseESCertManagement {
if ed.Jaeger.Spec.Storage.Elasticsearch.UseCertManagement != nil && *ed.Jaeger.Spec.Storage.Elasticsearch.UseCertManagement {
return caPathESCerManagement
}
return caPath
Expand Down Expand Up @@ -168,7 +168,7 @@ func (ed *ElasticsearchDeployment) Elasticsearch() *esv1.Elasticsearch {
}

annotations := map[string]string{}
if ed.Jaeger.Spec.Storage.Elasticsearch.UseESCertManagement != nil && *ed.Jaeger.Spec.Storage.Elasticsearch.UseESCertManagement == true {
if ed.Jaeger.Spec.Storage.Elasticsearch.UseCertManagement != nil && *ed.Jaeger.Spec.Storage.Elasticsearch.UseCertManagement == true {
annotations["logging.openshift.io/elasticsearch-cert-management"] = "true"
// The value has to match searchguard configuration
// https://github.com/openshift/origin-aggregated-logging/blob/50126fb8e0c602e9c623d6a8599857aaf98f80f8/elasticsearch/sgconfig/roles_mapping.yml#L34
Expand Down Expand Up @@ -255,7 +255,7 @@ func jaegerESSecretName(jaeger v1.Jaeger) string {
prefix := ""
// ES cert management creates cert named jaeger-<elasticsearch-name>
// Cert management in Jaeger creates cert named <jaeger-name>-jaeger-elasticsearch
if jaeger.Spec.Storage.Elasticsearch.UseESCertManagement == nil || !*jaeger.Spec.Storage.Elasticsearch.UseESCertManagement {
if jaeger.Spec.Storage.Elasticsearch.UseCertManagement == nil || !*jaeger.Spec.Storage.Elasticsearch.UseCertManagement {
prefix = jaeger.Name + "-"
}
return fmt.Sprintf("%sjaeger-%s", prefix, jaeger.Spec.Storage.Elasticsearch.Name)
Expand Down
16 changes: 8 additions & 8 deletions pkg/storage/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func TestCreateElasticsearchCR(t *testing.T) {
name: "foo",
namespace: "myproject",
jEsSpec: v1.ElasticsearchSpec{
Name: "elasticsearch",
UseESCertManagement: &trueVar,
NodeCount: 1,
Name: "elasticsearch",
UseCertManagement: &trueVar,
NodeCount: 1,
},
es: esv1.Elasticsearch{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -270,8 +270,8 @@ func TestInject(t *testing.T) {
},
{
es: v1.ElasticsearchSpec{
Name: "elasticsearch",
UseESCertManagement: &trueVar,
Name: "elasticsearch",
UseCertManagement: &trueVar,
},
pod: &corev1.PodSpec{
Containers: []corev1.Container{{
Expand Down Expand Up @@ -475,9 +475,9 @@ func TestInjectJobs(t *testing.T) {
{
name: "es-cert-management",
es: v1.ElasticsearchSpec{
Name: "elasticsearch",
NodeCount: 3,
UseESCertManagement: &trueVar,
Name: "elasticsearch",
NodeCount: 3,
UseCertManagement: &trueVar,
},
pod: &corev1.PodSpec{
Containers: []corev1.Container{{
Expand Down

0 comments on commit 66c9063

Please sign in to comment.