diff --git a/components/licensor/ee/pkg/licensor/licensor.go b/components/licensor/ee/pkg/licensor/licensor.go index 18572f41c6cadb..343d0dbb511638 100644 --- a/components/licensor/ee/pkg/licensor/licensor.go +++ b/components/licensor/ee/pkg/licensor/licensor.go @@ -37,10 +37,12 @@ type licensePayload struct { type LicenseLevel int const ( - // LevelTeam is the default license level + // LevelTeam is the default license level, + // which is the free tier LevelTeam LicenseLevel = 0 - // LevelEnterprise enables enterprise features + // LevelEnterprise enables enterprise features, + // which applies after buying a license LevelEnterprise LicenseLevel = 1 ) @@ -109,7 +111,8 @@ func (lvl LicenseLevel) allowance() allowance { var defaultLicense = LicensePayload{ ID: "default-license", Level: LevelTeam, - // Seats, Domain, ValidUntil are free for all + Seats: 10, + // Domain, ValidUntil are free for all } // NewEvaluator produces a new license evaluator from a license key diff --git a/components/licensor/ee/pkg/licensor/licensor_test.go b/components/licensor/ee/pkg/licensor/licensor_test.go index 616f9d6d1d1c58..7528c80d1a784f 100644 --- a/components/licensor/ee/pkg/licensor/licensor_test.go +++ b/components/licensor/ee/pkg/licensor/licensor_test.go @@ -61,6 +61,9 @@ func TestSeats(t *testing.T) { {"beyond limited seats", 50, 150, false, false, false}, {"beyond limited seats (edge)", 50, 51, false, false, false}, {"invalid license", 50, 50, false, false, true}, + {"within default license seats", 0, 7, true, true, false}, + {"within default license seats (edge)", 0, 10, true, true, false}, + {"beyond default license seats", 0, 11, false, true, false}, } for _, test := range tests { @@ -85,6 +88,9 @@ func TestSeats(t *testing.T) { } }, } + if test.DefaultLicense { + lt.License = nil + } lt.Run(t) } }