Skip to content

Commit

Permalink
Merge pull request #2228 from loft-sh/thomaskosiewski/add-custom-reso…
Browse files Browse the repository at this point in the history
…urces-to-pro-check
  • Loading branch information
ThomasK33 authored Oct 15, 2024
2 parents bb11398 + 3057412 commit 16d2a59
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ func (c *Config) IsProFeatureEnabled() bool {
return true
}

if len(c.Sync.ToHost.CustomResources) > 0 {
return true
}

return false
}

Expand Down
15 changes: 14 additions & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ controlPlane:

func TestConfig_IsProFeatureEnabled(t *testing.T) {
tests := []struct {
name string
config *Config
name string
expected bool
}{
{
Expand Down Expand Up @@ -372,6 +372,19 @@ func TestConfig_IsProFeatureEnabled(t *testing.T) {
},
expected: true,
},
{
name: "Custom Resource Syncing is configured",
config: &Config{
Sync: Sync{
ToHost: SyncToHost{
CustomResources: map[string]SyncToHostCustomResource{
"demo": {},
},
},
},
},
expected: true,
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 16d2a59

Please sign in to comment.