Skip to content

Commit 65bd80f

Browse files
committed
refactor(plugins): remove PLAYGROUND environment variable checks and update mode conditions
1 parent c34ecd4 commit 65bd80f

File tree

11 files changed

+5
-43
lines changed

11 files changed

+5
-43
lines changed

plugins/aws/main.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"fmt"
77
"net/http"
8-
"os"
98
"runtime"
109
"strings"
1110
"time"
@@ -39,10 +38,6 @@ var (
3938
)
4039

4140
func main() {
42-
if os.Getenv("PLAYGROUND") == "true" {
43-
return
44-
}
45-
4641
mode := plugins.GetCfg("plugin_com.utmstack.aws").Env.Mode
4742
if mode != "manager" {
4843
return

plugins/azure/main.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"errors"
77
"fmt"
88
"net/http"
9-
"os"
109
"runtime"
1110
"strings"
1211
"sync"
@@ -66,10 +65,6 @@ var SupportedClouds = []CloudEndpoints{
6665
}
6766

6867
func main() {
69-
if os.Getenv("PLAYGROUND") == "true" {
70-
return
71-
}
72-
7368
mode := plugins.GetCfg("plugin_com.utmstack.azure").Env.Mode
7469
if mode != "worker" {
7570
return

plugins/bitdefender/main.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package main
22

33
import (
4-
"os"
54
"runtime"
65

76
"github.com/threatwinds/go-sdk/plugins"
@@ -11,10 +10,6 @@ import (
1110
)
1211

1312
func main() {
14-
if os.Getenv("PLAYGROUND") == "true" {
15-
return
16-
}
17-
1813
mode := plugins.GetCfg("plugin_com.utmstack.bitdefender").Env.Mode
1914
if mode != "manager" {
2015
return

plugins/config/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (f *Filter) FromVar(id int, name any, filter any) {
234234
}
235235

236236
func main() {
237-
if os.Getenv("PLAYGROUND") == "true" {
237+
if plugins.GetCfg("plugin_com.utmstack.config").Env.Mode == "playground" {
238238
return
239239
}
240240

plugins/crowdStrike/main.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"encoding/json"
66
"errors"
77
"fmt"
8-
"os"
98
"runtime"
109
"strings"
1110
"sync"
@@ -28,10 +27,6 @@ const (
2827
)
2928

3029
func main() {
31-
if os.Getenv("PLAYGROUND") == "true" {
32-
return
33-
}
34-
3530
mode := plugins.GetCfg("plugin_com.utmstack.crowdstrike").Env.Mode
3631
if mode != "manager" {
3732
return

plugins/gcp/main.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ type GroupModule struct {
2929
}
3030

3131
func main() {
32-
if os.Getenv("PLAYGROUND") == "true" {
33-
return
34-
}
35-
3632
mode := plugins.GetCfg("plugin_com.utmstack.gcp").Env.Mode
3733
if mode != "worker" {
3834
return

plugins/inputs/main.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ const defaultTenant string = "ce66672c-e36d-4761-a8c8-90058fee1a24"
1616
var localLogsChannel chan *plugins.Log
1717

1818
func main() {
19-
if os.Getenv("PLAYGROUND") == "true" {
20-
return
21-
}
22-
2319
mode := plugins.GetCfg("plugin_com.utmstack.inputs").Env.Mode
2420
if mode != "worker" {
2521
return

plugins/o365/main.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"net/http"
77
"net/url"
8-
"os"
98
"runtime"
109
"strings"
1110
"sync"
@@ -71,10 +70,6 @@ func GetCloudConfig(env CloudEnvironment) CloudConfig {
7170
}
7271

7372
func main() {
74-
if os.Getenv("PLAYGROUND") == "true" {
75-
return
76-
}
77-
7873
mode := plugins.GetCfg("plugin_com.utmstack.o365").Env.Mode
7974
if mode != "manager" {
8075
return

plugins/soc-ai/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import (
1212
)
1313

1414
func main() {
15+
if plugins.GetCfg("plugin_com.utmstack.soc-ai").GetEnv().Mode == "playground" {
16+
return
17+
}
18+
1519
go config.StartConfigurationSystem()
1620

1721
time.Sleep(2 * time.Second)

plugins/sophos/main.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"net/http"
77
"net/url"
8-
"os"
98
"runtime"
109
"strings"
1110
"sync"
@@ -33,10 +32,6 @@ var (
3332
)
3433

3534
func main() {
36-
if os.Getenv("PLAYGROUND") == "true" {
37-
return
38-
}
39-
4035
mode := plugins.GetCfg("plugin_com.utmstack.sophos").Env.Mode
4136
if mode != "manager" {
4237
return

0 commit comments

Comments
 (0)