Skip to content

Commit

Permalink
add lookup tag
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineJac committed Dec 23, 2023
1 parent 9c1310d commit fae6d82
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 0 deletions.
33 changes: 33 additions & 0 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,24 @@ func syncMain(ctx context.Context, filenames []string, dry bool, parallelism,
return err
}

dumpConfig.LookUpSelectorTagsConsumers, err = determineLookUpSelectorTagsConsumers(*targetContent)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.2.1.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.6.0.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.5.1.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.3.3.4)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.1.4.6)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.4.1.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.0.5)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.5.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.2.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.1.4)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.6.0)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.5.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.7)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.3.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.4.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.0)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.8)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong:master-alpine)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 241 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.4.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)
if err != nil {
return fmt.Errorf("error determining lookup selector tags: %w", err)
}

if dumpConfig.LookUpSelectorTagsConsumers != nil {

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.2.1.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.6.0.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.5.1.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.3.3.4)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.1.4.6)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.4.1.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.0.5)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.5.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.2.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.1.4)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.6.0)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.5.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.7)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.3.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.4.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.0)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.8)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong:master-alpine)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 246 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.4.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)
consumersGlobal, err := dump.GetAllConsumers(ctx, kongClient, dumpConfig.LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.2.1.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.6.0.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.5.1.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.3.3.4)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.1.4.6)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.4.1.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.0.5)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.5.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.2.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.1.4)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.6.0)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.5.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.7)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.3.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.4.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.0)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.8)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.1)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong:master-alpine)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.2)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)

Check failure on line 247 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.4.3)

dumpConfig.LookUpSelectorTagsConsumers undefined (type dump.Config has no field or method LookUpSelectorTagsConsumers)
if err != nil {
return fmt.Errorf("error retrieving global consumers via lookup selector tags: %w", err)
}
for _, c := range consumersGlobal {
targetContent.Consumers = append(targetContent.Consumers, file.FConsumer{Consumer: *c})
if err != nil {
return fmt.Errorf("error adding global consumer %v: %w", *c.Username, err)
}
}
}

if utils.Kong340Version.LTE(parsedKongVersion) {
dumpConfig.IsConsumerGroupScopedPluginSupported = true
}
Expand Down Expand Up @@ -321,6 +339,21 @@ func syncMain(ctx context.Context, filenames []string, dry bool, parallelism,
return nil
}

func determineLookUpSelectorTagsConsumers(targetContent file.Content) ([]string, error) {
if targetContent.Info != nil &&
targetContent.Info.LookUpSelectorTags != nil &&

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.2.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.6.0.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.5.1.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.3.3.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.1.4.6)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.4.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.0.5)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.2.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.1.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.6.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.7)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.4.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.8)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong:master-alpine)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 344 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.4.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)
targetContent.Info.LookUpSelectorTags.Consumers != nil {

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.2.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.6.0.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.5.1.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.3.3.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.1.4.6)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.4.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.0.5)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.2.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.1.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.6.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.7)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.4.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.8)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong:master-alpine)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 345 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.4.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)
if len(targetContent.Info.LookUpSelectorTags.Consumers) == 0 {

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.2.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.6.0.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.5.1.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.3.3.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.1.4.6)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.4.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.0.5)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.2.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.1.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.6.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.7)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.4.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.8)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong:master-alpine)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 346 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.4.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)
return nil, fmt.Errorf("global consumers specified but no global tags")
}
utils.RemoveDuplicates(&targetContent.Info.LookUpSelectorTags.Consumers)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.2.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.6.0.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.5.1.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.3.3.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.1.4.6)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.4.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.0.5)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.2.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.1.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.6.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.7)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.4.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.8)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong:master-alpine)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 349 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.4.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)
sort.Strings(targetContent.Info.LookUpSelectorTags.Consumers)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.2.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.6.0.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.5.1.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.3.3.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.1.4.6)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.4.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.0.5)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.2.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.1.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.6.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.7)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.4.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.8)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong:master-alpine)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 350 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.4.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)
return targetContent.Info.LookUpSelectorTags.Consumers, nil

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.2.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.6.0.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.5.1.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.3.3.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.1.4.6)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong-gateway:2.4.1.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.0.5)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.2.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.1.4)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.6.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.5.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.7)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.4.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.0)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:2.8)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.1)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong/kong:master-alpine)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.2)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:3.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

Check failure on line 351 in cmd/common.go

View workflow job for this annotation

GitHub Actions / integration (kong:1.4.3)

targetContent.Info.LookUpSelectorTags undefined (type *"github.com/kong/go-database-reconciler/pkg/file".Info has no field or method LookUpSelectorTags)

}
return nil, nil
}

func determineSelectorTag(targetContent file.Content, config dump.Config) ([]string, error) {
if targetContent.Info != nil {
if len(targetContent.Info.SelectorTags) > 0 {
Expand Down
19 changes: 19 additions & 0 deletions cmd/gateway_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ func executeValidate(cmd *cobra.Command, _ []string) error {
if err != nil {
return err
}

// if this is an online validation, we need to look up upstream consumers if required.
lookUpSelectorTagsConsumers, err := determineLookUpSelectorTagsConsumers(*targetContent)
if err != nil {
return fmt.Errorf("error determining lookup selector tags: %w", err)
}

if lookUpSelectorTagsConsumers != nil {
consumersGlobal, err := dump.GetAllConsumers(ctx, kongClient, lookUpSelectorTagsConsumers)
if err != nil {
return fmt.Errorf("error retrieving global consumers via lookup selector tags: %w", err)
}
for _, c := range consumersGlobal {
targetContent.Consumers = append(targetContent.Consumers, file.FConsumer{Consumer: *c})
if err != nil {
return fmt.Errorf("error adding global consumer %v: %w", *c.Username, err)
}
}
}
}

rawState, err := file.Get(ctx, targetContent, file.RenderConfig{
Expand Down
38 changes: 38 additions & 0 deletions tests/integration/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4715,6 +4715,44 @@ func Test_Sync_DoNotUpdateCreatedAt(t *testing.T) {
// consumers do not have an updated_at field
}

// Test_Sync_LookupConsumerTags tests that existing behavior when referencing
// consumers from plugins is preserved:
// - if a referenced consumer is not present in the state file, the sync fails
// - if a referenced consumer is present in the state file, the sync succeeds
//
// This test also tests that the new behavior is implemented correctly:
// - if a referenced consumer is not present in the state file, but is present
// in Kong when using the new lookup selector tags, the sync succeeds
// - if a referenced consumer is not present in the state file and neither in
// Kong when using the new lookup selector tags, the sync fails
func Test_Sync_LookupConsumerTags(t *testing.T) {
runWhen(t, "enterprise", ">=3.0.0")
setup(t)

// test that reference to non-existing consumer fails.
pluginsNoLookupStateFile := "testdata/sync/028-lookup-tags/plugins_no_lookup.yaml"
err := sync(pluginsNoLookupStateFile)
require.Error(t, err)
require.EqualError(t, err, "building state: consumer foo for plugin rate-limiting-advanced: entity not found")

// test that reference to existing local consumer succeeds.
pluginsAndConsumersStateFile := "testdata/sync/028-lookup-tags/plugins_and_consumers.yaml"
require.NoError(t, sync(pluginsAndConsumersStateFile))
reset(t)

// test that reference to existing global consumer succeeds via lookup tags.
globalConsumersStateFile := "testdata/sync/028-lookup-tags/global_consumers.yaml"
require.NoError(t, sync(globalConsumersStateFile))
// sync plugins with lookup reference to global consumers.
pluginsLookupStateFile := "testdata/sync/028-lookup-tags/plugins_lookup.yaml"
require.NoError(t, sync(pluginsLookupStateFile))
reset(t)

// test that reference to non-existing global consumer fails via lookup tags.
require.Error(t, sync(pluginsLookupStateFile))
require.EqualError(t, err, "building state: consumer foo for plugin rate-limiting-advanced: entity not found")
}

// test scope:
// - 3.0.0+
// - konnect
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_format_version: "3.0"
_info:
select_tags:
- global-consumers
consumers:
- username: foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
_format_version: "3.0"
plugins:
- name: rate-limiting-advanced
config:
limit:
- 10
window_size:
- 60
namespace: foo
sync_rate: -1
consumer: foo
consumers:
- username: foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
_format_version: "3.0"
_info:
select_tags:
- managed-by-deck
default_lookup_tags:
consumers:
- global-consumers
plugins:
- name: rate-limiting-advanced
config:
limit:
- 10
window_size:
- 60
namespace: foo
sync_rate: -1
consumer: foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
_format_version: "3.0"
_info:
select_tags:
- managed-by-deck
plugins:
- name: rate-limiting-advanced
config:
limit:
- 10
window_size:
- 60
namespace: foo
sync_rate: -1
consumer: foo

0 comments on commit fae6d82

Please sign in to comment.