From 0e133b6efce990668a7c0668392d99a23d950a16 Mon Sep 17 00:00:00 2001 From: Gabor Retvari Date: Wed, 11 Dec 2024 13:22:43 +0100 Subject: [PATCH] chore: Implement GetLicenseConfigManager --- stunner.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/stunner.go b/stunner.go index a0237ca..1498132 100644 --- a/stunner.go +++ b/stunner.go @@ -16,6 +16,7 @@ import ( "github.com/l7mp/stunner/internal/resolver" "github.com/l7mp/stunner/internal/telemetry" stnrv1 "github.com/l7mp/stunner/pkg/apis/v1" + licensecfg "github.com/l7mp/stunner/pkg/config/license" "github.com/l7mp/stunner/pkg/logger" ) @@ -148,7 +149,7 @@ func (s *Stunner) Shutdown() { s.ready = false } -// GetAdmin returns the admin object underlying STUNner. +// GetAdmin returns the admin object. Panics if no admin object is available. func (s *Stunner) GetAdmin() *object.Admin { a, found := s.adminManager.Get(stnrv1.DefaultAdminName) if !found { @@ -157,7 +158,13 @@ func (s *Stunner) GetAdmin() *object.Admin { return a.(*object.Admin) } -// GetAuth returns the authenitation object underlying STUNner. +// GetLicenseConfigManager returns the manager handling license status. Panics if no manager is +// available. +func (s *Stunner) GetLicenseConfigManager() licensecfg.ConfigManager { + return s.GetAdmin().LicenseManager +} + +// GetAuth returns the authenitation object. Panics if no auth object is available. func (s *Stunner) GetAuth() *object.Auth { a, found := s.authManager.Get(stnrv1.DefaultAuthName) if !found {