Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apis/logging/v1/index_management_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type IndexManagementDeletePhaseSpec struct {

// How often to run a new prune-namespaces job
// +optional
PruneNamespacesInterval TimeUnit `json:"pruneNamespacesInterval"`
PruneNamespacesInterval TimeUnit `json:"pruneNamespacesInterval,omitempty"`

// The per namespace specification to delete documents older than a given minimum age
// +optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ metadata:
"name": "infra-policy",
"phases": {
"delete": {
"minAge": "2d"
"minAge": "2d",
"namespaceSpec": [
{
"minAge": "5h",
"namespace": "openshift-monitoring"
}
],
"pruneNamespacesInterval": "24h"
},
"hot": {
"actions": {
Expand Down
8 changes: 5 additions & 3 deletions bundle/manifests/logging.openshift.io_elasticsearches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ spec:
pattern: ^([0-9]+)([yMwdhHms]{0,1})$
type: string
namespaceSpec:
description: The per namesapce specification to
description: The per namespace specification to
delete documents older than a given minimum age
items:
properties:
Expand All @@ -116,15 +116,17 @@ spec:
type: string
namespace:
description: Target Namespace to delete logs
older than MinAge (defaults to 7d)
older than MinAge (defaults to 7d) Can be
one namespace name or a prefix (e.g., "openshift-"
covers all namespaces with this prefix)
type: string
required:
- namespace
type: object
type: array
pruneNamespacesInterval:
description: How often to run a new prune-namespaces
cron job
job
pattern: ^([0-9]+)([yMwdhHms]{0,1})$
type: string
required:
Expand Down
16 changes: 8 additions & 8 deletions internal/elasticsearch/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
)

type certificate struct {
cert []byte
key []byte
x509Cert *x509.Certificate
privKey *rsa.PrivateKey
cert []byte
key []byte
x509Cert *x509.Certificate
privKey *rsa.PrivateKey
}

type certCA struct {
Expand Down Expand Up @@ -114,10 +114,10 @@ var (
// In ASN.1, "2 5 29 17" is the OID for subjectAltName (SAN)
// The FullBytes are ASN.1-encoded 1.2.3.4.5.5
sanIdentifier asn1.ObjectIdentifier = asn1.ObjectIdentifier{2, 5, 29, 17}
//Fixing a race condition between GenerateComponentsCerts and GenerateKibanaCerts functions
//Here make mutex global. Probably temporary solution, need more deep refactoring of code related to certificate
//generation. Problem was founded during working on issue: https://issues.redhat.com/browse/LOG-1923
certMutex = sync.Mutex{}
// Fixing a race condition between GenerateComponentsCerts and GenerateKibanaCerts functions
// Here make mutex global. Probably temporary solution, need more deep refactoring of code related to certificate
// generation. Problem was founded during working on issue: https://issues.redhat.com/browse/LOG-1923
certMutex = sync.Mutex{}
)

type CertificateRequest struct {
Expand Down
12 changes: 4 additions & 8 deletions internal/indexmanagement/validations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ var _ = Describe("Index Management", func() {
},
},
Delete: &esapi.IndexManagementDeletePhaseSpec{
MinAge: "7d",
PruneNamespacesInterval: "",
MinAge: "7d",
},
},
},
Expand Down Expand Up @@ -105,8 +104,7 @@ var _ = Describe("Index Management", func() {
"name": "my-policy",
"phases": {
"delete": {
"minAge": "7d",
"pruneNamespacesInterval": ""
"minAge": "7d"
},
"hot": {
"actions": {
Expand Down Expand Up @@ -152,8 +150,7 @@ var _ = Describe("Index Management", func() {
"name": "my-policy",
"phases": {
"delete": {
"minAge": "7d",
"pruneNamespacesInterval": ""
"minAge": "7d"
},
"hot": {
"actions": {
Expand Down Expand Up @@ -197,8 +194,7 @@ var _ = Describe("Index Management", func() {
"name": "my-policy",
"phases": {
"delete": {
"minAge": "7d",
"pruneNamespacesInterval": ""
"minAge": "7d"
},
"hot": {
"actions": {
Expand Down