Skip to content

Added flowLabel, includeLabelInRouter flow fields + relabel output #1294

New issue

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

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

Already on GitHub? Sign in to your account

Merged
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
8 changes: 8 additions & 0 deletions config/crd/bases/logging.banzaicloud.io_clusterflows.yaml
Original file line number Diff line number Diff line change
@@ -967,10 +967,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
loggingRef:
type: string
match:
@@ -1990,10 +1994,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
loggingRef:
type: string
match:
14 changes: 14 additions & 0 deletions config/crd/bases/logging.banzaicloud.io_clusteroutputs.yaml
Original file line number Diff line number Diff line change
@@ -4833,6 +4833,13 @@ spec:
ttl:
type: integer
type: object
relabel:
properties:
label:
type: string
required:
- label
type: object
s3:
properties:
acl:
@@ -10819,6 +10826,13 @@ spec:
ttl:
type: integer
type: object
relabel:
properties:
label:
type: string
required:
- label
type: object
s3:
properties:
acl:
8 changes: 8 additions & 0 deletions config/crd/bases/logging.banzaicloud.io_flows.yaml
Original file line number Diff line number Diff line change
@@ -967,10 +967,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
localOutputRefs:
items:
type: string
@@ -1986,10 +1990,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
localOutputRefs:
items:
type: string
4 changes: 4 additions & 0 deletions config/crd/bases/logging.banzaicloud.io_loggings.yaml
Original file line number Diff line number Diff line change
@@ -985,10 +985,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
outputRefs:
items:
type: string
14 changes: 14 additions & 0 deletions config/crd/bases/logging.banzaicloud.io_outputs.yaml
Original file line number Diff line number Diff line change
@@ -4748,6 +4748,13 @@ spec:
ttl:
type: integer
type: object
relabel:
properties:
label:
type: string
required:
- label
type: object
s3:
properties:
acl:
@@ -10728,6 +10735,13 @@ spec:
ttl:
type: integer
type: object
relabel:
properties:
label:
type: string
required:
- label
type: object
s3:
properties:
acl:
Original file line number Diff line number Diff line change
@@ -967,10 +967,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
loggingRef:
type: string
match:
@@ -1990,10 +1994,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
loggingRef:
type: string
match:
Original file line number Diff line number Diff line change
@@ -4833,6 +4833,13 @@ spec:
ttl:
type: integer
type: object
relabel:
properties:
label:
type: string
required:
- label
type: object
s3:
properties:
acl:
@@ -10819,6 +10826,13 @@ spec:
ttl:
type: integer
type: object
relabel:
properties:
label:
type: string
required:
- label
type: object
s3:
properties:
acl:
Original file line number Diff line number Diff line change
@@ -967,10 +967,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
localOutputRefs:
items:
type: string
@@ -1986,10 +1990,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
localOutputRefs:
items:
type: string
Original file line number Diff line number Diff line change
@@ -985,10 +985,14 @@ spec:
type: object
type: object
type: array
flowLabel:
type: string
globalOutputRefs:
items:
type: string
type: array
includeLabelInRouter:
type: boolean
outputRefs:
items:
type: string
Original file line number Diff line number Diff line change
@@ -4748,6 +4748,13 @@ spec:
ttl:
type: integer
type: object
relabel:
properties:
label:
type: string
required:
- label
type: object
s3:
properties:
acl:
@@ -10728,6 +10735,13 @@ spec:
ttl:
type: integer
type: object
relabel:
properties:
label:
type: string
required:
- label
type: object
s3:
properties:
acl:
6 changes: 3 additions & 3 deletions pkg/resources/model/system.go
Original file line number Diff line number Diff line change
@@ -258,7 +258,7 @@ func FlowForFlow(flow v1beta1.Flow, clusterOutputs ClusterOutputs, outputs Outpu

flowID := fmt.Sprintf("flow:%s:%s", flow.Namespace, flow.Name)

result, err := types.NewFlow(matches, flowID, flow.Name, flow.Namespace)
result, err := types.NewFlow(matches, flowID, flow.Name, flow.Namespace, flow.Spec.FlowLabel, flow.Spec.IncludeLabelInRouter)
if err != nil {
return nil, err
}
@@ -346,7 +346,7 @@ func FlowForClusterFlow(flow v1beta1.ClusterFlow, clusterOutputs ClusterOutputs,

flowID := fmt.Sprintf("clusterflow:%s:%s", flow.Namespace, flow.Name)

result, err := types.NewFlow(matches, flowID, flow.Name, flow.Namespace)
result, err := types.NewFlow(matches, flowID, flow.Name, flow.Namespace, flow.Spec.FlowLabel, flow.Spec.IncludeLabelInRouter)
if err != nil {
return nil, err
}
@@ -383,7 +383,7 @@ func FlowForDefaultFlow(logging v1beta1.Logging, clusterOutputs ClusterOutputs,

flowID := fmt.Sprintf("logging:%s:%s", logging.Namespace, logging.Name)

result, err := types.NewFlow([]types.FlowMatch{}, flowID, logging.Name, logging.Namespace)
result, err := types.NewFlow([]types.FlowMatch{}, flowID, logging.Name, logging.Namespace, logging.Spec.DefaultFlowSpec.FlowLabel, logging.Spec.DefaultFlowSpec.IncludeLabelInRouter)
if err != nil {
return nil, err
}
1 change: 1 addition & 0 deletions pkg/sdk/logging/api/v1alpha1/output_types.go
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ type OutputSpec struct {
SyslogOutputConfig *output.SyslogOutputConfig `json:"syslog,omitempty"`
GELFOutputConfig *output.GELFOutputConfig `json:"gelf,omitempty"`
SQSOutputConfig *output.SQSOutputConfig `json:"sqs,omitempty"`
RelabelOutputConfig *output.RelabelOutputConfig `json:"relabel,omitempty"`
}

// OutputStatus defines the observed state of Output
5 changes: 5 additions & 0 deletions pkg/sdk/logging/api/v1alpha1/zz_generated.deepcopy.go

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

6 changes: 4 additions & 2 deletions pkg/sdk/logging/api/v1beta1/clusterflow_types.go
Original file line number Diff line number Diff line change
@@ -71,8 +71,10 @@ type ClusterFlowSpec struct {
Filters []Filter `json:"filters,omitempty"`
LoggingRef string `json:"loggingRef,omitempty"`
// Deprecated
OutputRefs []string `json:"outputRefs,omitempty"`
GlobalOutputRefs []string `json:"globalOutputRefs,omitempty"`
OutputRefs []string `json:"outputRefs,omitempty"`
GlobalOutputRefs []string `json:"globalOutputRefs,omitempty"`
FlowLabel string `json:"flowLabel,omitempty"`
IncludeLabelInRouter *bool `json:"includeLabelInRouter,omitempty"`
}

// +kubebuilder:object:root=true
8 changes: 5 additions & 3 deletions pkg/sdk/logging/api/v1beta1/flow_types.go
Original file line number Diff line number Diff line change
@@ -36,9 +36,11 @@ type FlowSpec struct {
Filters []Filter `json:"filters,omitempty"`
LoggingRef string `json:"loggingRef,omitempty"`
// Deprecated
OutputRefs []string `json:"outputRefs,omitempty"`
GlobalOutputRefs []string `json:"globalOutputRefs,omitempty"`
LocalOutputRefs []string `json:"localOutputRefs,omitempty"`
OutputRefs []string `json:"outputRefs,omitempty"`
GlobalOutputRefs []string `json:"globalOutputRefs,omitempty"`
LocalOutputRefs []string `json:"localOutputRefs,omitempty"`
FlowLabel string `json:"flowLabel,omitempty"`
IncludeLabelInRouter *bool `json:"includeLabelInRouter,omitempty"`
}

type Match struct {
6 changes: 4 additions & 2 deletions pkg/sdk/logging/api/v1beta1/logging_types.go
Original file line number Diff line number Diff line change
@@ -118,8 +118,10 @@ type LoggingList struct {
type DefaultFlowSpec struct {
Filters []Filter `json:"filters,omitempty"`
// Deprecated
OutputRefs []string `json:"outputRefs,omitempty"`
GlobalOutputRefs []string `json:"globalOutputRefs,omitempty"`
OutputRefs []string `json:"outputRefs,omitempty"`
GlobalOutputRefs []string `json:"globalOutputRefs,omitempty"`
FlowLabel string `json:"flowLabel,omitempty"`
IncludeLabelInRouter *bool `json:"includeLabelInRouter,omitempty"`
}

const (
1 change: 1 addition & 0 deletions pkg/sdk/logging/api/v1beta1/output_types.go
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ type OutputSpec struct {
GELFOutputConfig *output.GELFOutputConfig `json:"gelf,omitempty"`
SQSOutputConfig *output.SQSOutputConfig `json:"sqs,omitempty"`
MattermostOutputConfig *output.MattermostOutputConfig `json:"mattermost,omitempty"`
RelabelOutputConfig *output.RelabelOutputConfig `json:"relabel,omitempty"`
}

// OutputStatus defines the observed state of Output
Loading