Skip to content

Commit

Permalink
chore: Refactor logpipeline and logparser validators and the resulted…
Browse files Browse the repository at this point in the history
… interdependencies (#1594)
  • Loading branch information
TeodorSAP authored Nov 8, 2024
1 parent 418610b commit df9667b
Show file tree
Hide file tree
Showing 21 changed files with 453 additions and 1,008 deletions.
2 changes: 2 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ linters-settings:
alias: commonStatusStubs
- pkg: k8s.io/client-go/testing
alias: clienttesting
- pkg: github.com/kyma-project/telemetry-manager/internal/utils/pipelines
alias: pipelineutils
errcheck:
check-type-assertions: true # Reports type assertions: `a := b.(SomeStruct)`.
check-blank: true # Report assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`.
Expand Down
4 changes: 3 additions & 1 deletion .testcoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ override:
- threshold: 85
path: ^internal/webhookcert$
- threshold: 73
path: ^webhook/logpipeline
path: ^webhook/logpipeline$
- threshold: 83
path: ^internal/utils/pipelines$

# Holds regexp rules which will exclude matched files or packages from coverage statistics
exclude:
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ manifests-dev: $(CONTROLLER_GEN) ## Generate WebhookConfiguration, ClusterRole a
generate: $(CONTROLLER_GEN) $(MOCKERY) $(STRINGER) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
$(MOCKERY)
$(STRINGER) --type Mode apis/telemetry/v1alpha1/logpipeline_types.go
$(STRINGER) --type Mode apis/telemetry/v1beta1/logpipeline_types.go
$(STRINGER) --type LogPipelineMode internal/utils/pipelines/logpipeline_mode.go
$(STRINGER) --type FeatureFlag internal/featureflags/featureflags.go

.PHONY: fmt
Expand Down
7 changes: 0 additions & 7 deletions apis/telemetry/v1alpha1/logpipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ import (
"github.com/kyma-project/telemetry-manager/internal/featureflags"
)

type Mode int

const (
OTel Mode = iota
FluentBit
)

//nolint:gochecknoinits // SchemeBuilder's registration is required.
func init() {
SchemeBuilder.Register(&LogPipeline{}, &LogPipelineList{})
Expand Down
345 changes: 0 additions & 345 deletions apis/telemetry/v1alpha1/logpipeline_validation_test.go

This file was deleted.

Loading

0 comments on commit df9667b

Please sign in to comment.