Skip to content

Commit e412658

Browse files
authored
fix: schemaFetcher scoped to local to avoid potential race conditions (#356)
1 parent 46f8efe commit e412658

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/dump/dump.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ const (
2121
DefaultLookupTag
2222
)
2323

24-
var schemaFetcher *SchemaFetcher
25-
2624
// Config can be used to skip exporting certain entities
2725
type Config struct {
2826
// If true, only RBAC resources are exported.
@@ -720,7 +718,7 @@ func Get(ctx context.Context, client *kong.Client, config Config) (*utils.KongRa
720718

721719
if config.SkipDefaults {
722720
isKonnect := config.KonnectControlPlane != ""
723-
schemaFetcher = NewSchemaFetcher(ctx, client, isKonnect)
721+
schemaFetcher := NewSchemaFetcher(ctx, client, isKonnect)
724722

725723
if schemaFetcher == nil {
726724
return nil, fmt.Errorf("schemaFetcher is nil")

0 commit comments

Comments
 (0)