Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

LOG-6758: fix invalid forwarder for lokiStack #2973

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1,989 changes: 0 additions & 1,989 deletions internal/api/initialize/init_lokiStack_test.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/api/initialize/initializations.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const (
// clfInitializers are the set of rules for initializing the ClusterLogForwarder spec
var clfInitializers = []func(spec obs.ClusterLogForwarder, migrateContext utils.Options) obs.ClusterLogForwarder{
Resources,
MigrateLokiStack,
MigrateInputs,
}

Expand Down
134 changes: 0 additions & 134 deletions internal/api/initialize/process_pipelines.go

This file was deleted.

118 changes: 0 additions & 118 deletions internal/api/initialize/process_pipelines_test.go

This file was deleted.

4 changes: 4 additions & 0 deletions internal/api/observability/forwarder.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package observability

import (
log "github.com/ViaQ/logerr/v2/log/static"
"strings"

obs "github.com/openshift/cluster-logging-operator/api/observability/v1"
Expand All @@ -26,6 +27,7 @@ func DeployAsDeployment(forwarder obs.ClusterLogForwarder) bool {

// IsValidSpec evaluates the status conditions to determine if the spec is valid
func IsValidSpec(forwarder obs.ClusterLogForwarder) bool {
log.V(3).Info("IsValidSpec", "outputs", forwarder.Spec.Outputs)
status := forwarder.Status
return isAuthorized(status.Conditions) &&
isValid(obs.ConditionTypeValidInputPrefix, status.InputConditions, len(forwarder.Spec.Inputs)) &&
Expand All @@ -35,6 +37,7 @@ func IsValidSpec(forwarder obs.ClusterLogForwarder) bool {
}

func isValid(prefix string, conditions []metav1.Condition, expConditions int) bool {
log.V(3).Info("isValid Args", "prefix", prefix, "conditions", conditions, "exp", expConditions)
if len(conditions) != expConditions {
return false
}
Expand All @@ -44,6 +47,7 @@ func isValid(prefix string, conditions []metav1.Condition, expConditions int) bo
conditionTrue++
}
}
log.V(3).Info("isValid", "prefix", prefix, "act", conditionTrue, "exp", expConditions)
return conditionTrue == expConditions
}

Expand Down
23 changes: 19 additions & 4 deletions internal/api/observability/input_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@ import (
"github.com/openshift/cluster-logging-operator/internal/utils/sets"
)

var ReservedInputTypes = sets.NewString(
string(obs.InputTypeApplication),
string(obs.InputTypeAudit),
string(obs.InputTypeInfrastructure),
var (
ReservedInputTypes = sets.NewString(
string(obs.InputTypeApplication),
string(obs.InputTypeAudit),
string(obs.InputTypeInfrastructure),
)

ReservedApplicationSources = sets.NewString(string(obs.ApplicationSourceContainer))
ReservedInfrastructureSources = sets.NewString()
ReservedAuditSources = sets.NewString()
)

func init() {
for _, i := range obs.InfrastructureSources {
ReservedInfrastructureSources.Insert(string(i))
}
for _, i := range obs.AuditSources {
ReservedAuditSources.Insert(string(i))
}
}

func MaxRecordsPerSecond(input obs.InputSpec) (int64, bool) {
if input.Application != nil &&
input.Application.Tuning != nil &&
Expand Down
Loading