Skip to content
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

chore: feature logs landscape #334

Merged
merged 5 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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 change: 1 addition & 0 deletions pkg/feature/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var loggerKeys = []types.Key{
types.KeyObjKindGroup,
types.KeyCrdKindGroup,
types.KeyBusolaKindGroup,
types.KeyLandscape,
}

func attributesToLogger(attributes map[string]interface{}, logger logr.Logger) logr.Logger {
Expand Down
3 changes: 3 additions & 0 deletions pkg/feature/testdata/apiDisabled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ apiDisabled:
- name: All APIs are disabled for trial SKR
query: brokerPlan == "trial"
variation: disabled
- name: Enabled on stage for global account 6034adc9-3441-494c-b438-a0eba4c5045a
query: landscape == "stage" and globalAccount == "6034adc9-3441-494c-b438-a0eba4c5045a"
variation: enabled
- name: Disabled APIs on stage and prod
query: feature in ["nfsBackup", "peering", "redis"] and landscape != "dev"
variation: disabled
Expand Down
13 changes: 13 additions & 0 deletions pkg/skr/runtime/looper/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ func (r *skrRunner) Run(ctx context.Context, skrManager skrmanager.SkrManager, o
err = fmt.Errorf("index filed error for %T: %w", indexer.Obj(), err)
return
}
logger.
WithValues(
"object", fmt.Sprintf("%T", indexer.Obj()),
"field", indexer.Field(),
"provider", string(*options.provider),
).
Info("Starting indexer")
} else {
logger.
WithValues(
Expand All @@ -155,6 +162,12 @@ func (r *skrRunner) Run(ctx context.Context, skrManager skrmanager.SkrManager, o
err = fmt.Errorf("setup with manager error for %T: %w", b.GetForObj(), err)
return
}
logger.
WithValues(
"object", fmt.Sprintf("%T", b.GetForObj()),
"provider", string(*options.provider),
).
Info("Starting controller")
} else {
logger.
WithValues(
Expand Down
Loading