Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
#192 Address review dog comments
Browse files Browse the repository at this point in the history
  • Loading branch information
agrimmer committed Sep 23, 2020
1 parent 48e6b56 commit 9ed677f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/lib/auto_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// EnsureDTTaggingRulesAreSetUp ensures that the tagging rules are set up
func (dt *DynatraceHelper) EnsureDTTaggingRulesAreSetUp() {
if !GetTaggingRulesConfig() {
if !IsTaggingRulesGenerationEnabled() {
return
}

Expand Down
16 changes: 11 additions & 5 deletions pkg/lib/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,32 @@ import (
"strconv"
)

func GetTaggingRulesConfig() bool {
// IsTaggingRulesGenerationEnabled returns whether tagging rules should be generated when configuring the monitoring
func IsTaggingRulesGenerationEnabled() bool {
return readEnvAsBool("GENERATE_TAGGING_RULES", false)
}

func GetProblemNotificationsConfig() bool {
// IsProblemNotificationsGenerationEnabled returns whether problem notifications should be generated when configuring the monitoring
func IsProblemNotificationsGenerationEnabled() bool {
return readEnvAsBool("GENERATE_PROBLEM_NOTIFICATIONS", false)
}

func GetManagementZonesConfig() bool {
// IsManagementZonesGenerationEnabled returns whether management zones should be generated when configuring the monitoring
func IsManagementZonesGenerationEnabled() bool {
return readEnvAsBool("GENERATE_MANAGEMENT_ZONES", false)
}

func GetGenerateDashboardsConfig() bool {
// IsDashboardsGenerationEnabled returns whether dashboards should be generated when configuring the monitoring
func IsDashboardsGenerationEnabled() bool {
return readEnvAsBool("GENERATE_DASHBOARDS", false)
}

func GetMetricEventsConfig() bool {
// IsMetricEventsGenerationEnabled returns whether metric events should be generated when configuring the monitoring
func IsMetricEventsGenerationEnabled() bool {
return readEnvAsBool("GENERATE_METRIC_EVENTS", false)
}

// IsTaggingRulesGenerationEnabled returns whether the SSL verification is enabled or disabled
func IsHttpSSLVerificationEnabled() bool {
return readEnvAsBool("HTTP_SSL_VERIFY", true)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// CreateDashboard creates a new dashboard for the provided project
func (dt *DynatraceHelper) CreateDashboard(project string, shipyard keptn.Shipyard) {
if !GetGenerateDashboardsConfig() {
if !IsDashboardsGenerationEnabled() {
return
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/management_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// CreateManagementZones creates a new management zone for the project
func (dt *DynatraceHelper) CreateManagementZones(project string, shipyard keptn.Shipyard) {
if !GetManagementZonesConfig() {
if !IsManagementZonesGenerationEnabled() {
return
}
// get existing management zones
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/metric_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

// CreateMetricEvents creates new metric events if SLOs are specified
func (dt *DynatraceHelper) CreateMetricEvents(project string, stage string, service string) {
if !GetMetricEventsConfig() {
if !IsMetricEventsGenerationEnabled() {
return
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/problem_notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// EnsureProblemNotificationsAreSetUp sets up/updates the DT problem notification
func (dt *DynatraceHelper) EnsureProblemNotificationsAreSetUp() {
if !GetProblemNotificationsConfig() {
if !IsProblemNotificationsGenerationEnabled() {
return
}

Expand Down

0 comments on commit 9ed677f

Please sign in to comment.