Documentation ¶
Index ¶
- Constants
- Variables
- func FQDNNetworkPolicyDefinition(name string, kubeNamespace string) fqdnV1alpha3.FQDNNetworkPolicy
- func UnleashDefinition(c *config.Config, uc *UnleashConfig) unleashv1.Unleash
- type ISQLDatabasesService
- type ISQLUsersService
- type IUnleashService
- type UnleashConfig
- type UnleashError
- type UnleashInstance
- func (u UnleashInstance) Age() string
- func (u *UnleashInstance) ApiUrl() string
- func (u *UnleashInstance) GetDatabase(ctx context.Context, client *admin.DatabasesService) error
- func (u *UnleashInstance) GetDatabaseUser(ctx context.Context, client *admin.UsersService) error
- func (u *UnleashInstance) IsReady() bool
- func (u *UnleashInstance) Status() string
- func (u *UnleashInstance) StatusLabel() string
- func (u *UnleashInstance) Version() string
- func (u *UnleashInstance) WebUrl() string
- type UnleashService
- func (s *UnleashService) Create(ctx context.Context, uc *UnleashConfig) (*unleashv1.Unleash, error)
- func (s *UnleashService) Delete(ctx context.Context, name string) error
- func (s *UnleashService) Get(ctx context.Context, name string) (*UnleashInstance, error)
- func (s *UnleashService) List(ctx context.Context) ([]*UnleashInstance, error)
- func (s *UnleashService) Update(ctx context.Context, uc *UnleashConfig) (*unleashv1.Unleash, error)
Constants ¶
View Source
const ( UnleashCustomImageRepo = "europe-north1-docker.pkg.dev/nais-io/nais/images/" UnleashCustomImageName = "unleash-v4" UnleashRequestCPU = "100m" UnleashRequestMemory = "128Mi" UnleashLimitMemory = "256Mi" SqlProxyRequestCPU = "10m" SqlProxyRequestMemory = "100Mi" SqlProxyLimitMemory = "100Mi" DatabasePoolMax = "3" DatabasePoolIdleTimeoutMs = "1000" LogLevel = "warn" )
Variables ¶
View Source
var FederationAllowedClusters = []string{"dev-gcp", "prod-gcp"}
Functions ¶
func FQDNNetworkPolicyDefinition ¶
func FQDNNetworkPolicyDefinition(name string, kubeNamespace string) fqdnV1alpha3.FQDNNetworkPolicy
func UnleashDefinition ¶
func UnleashDefinition(c *config.Config, uc *UnleashConfig) unleashv1.Unleash
Types ¶
type ISQLDatabasesService ¶
type ISQLUsersService ¶
type ISQLUsersService interface { Get(project string, instance string, name string) *admin.UsersGetCall Insert(project string, instance string, user *admin.User) *admin.UsersInsertCall Delete(project string, instance string) *admin.UsersDeleteCall }
type IUnleashService ¶
type IUnleashService interface { List(ctx context.Context) ([]*UnleashInstance, error) Get(ctx context.Context, name string) (*UnleashInstance, error) Create(ctx context.Context, uc *UnleashConfig) (*unleashv1.Unleash, error) Update(ctx context.Context, uc *UnleashConfig) (*unleashv1.Unleash, error) Delete(ctx context.Context, name string) error }
type UnleashConfig ¶
type UnleashConfig struct { Name string `json:"name,omitempty" form:"name" validate:"required,hostname"` CustomVersion string `json:"custom-version,omitempty" form:"custom-version" validate:"omitempty"` EnableFederation bool `json:"enable-federation,omitempty" form:"enable-federation,default=true"` FederationNonce string `json:"-" form:"-" validate:"required"` AllowedTeams string `json:"allowed-teams,omitempty" form:"allowed-teams" validate:"omitempty"` AllowedNamespaces string `json:"allowed-namespaces,omitempty" form:"allowed-namespaces" validate:"omitempty"` AllowedClusters string `json:"allowed-clusters,omitempty" form:"allowed-clusters" validate:"omitempty"` LogLevel string `json:"log-level,omitempty" form:"loglevel,default=warn" validate:"required,oneof=debug info warn error fatal panic"` DatabasePoolMax int `json:"database-pool-max,omitempty" form:"database-pool-max,default=3" validate:"required,min=1,max=10"` DatabasePoolIdleTimeoutMs int `json:"database-pool-idle-timeout-ms,omitempty" form:"database-pool-idle-timeout-ms,default=1000" validate:"required"` }
func UnleashVariables ¶
func UnleashVariables(server *unleashv1.Unleash, returnDefaults bool) *UnleashConfig
func (*UnleashConfig) MergeTeamsAndNamespaces ¶
func (uc *UnleashConfig) MergeTeamsAndNamespaces()
func (*UnleashConfig) SetDefaultValues ¶
func (uc *UnleashConfig) SetDefaultValues(unleashVersions []github.UnleashVersion)
func (*UnleashConfig) Validate ¶
func (uc *UnleashConfig) Validate() error
type UnleashError ¶
func (*UnleashError) Error ¶
func (e *UnleashError) Error() string
type UnleashInstance ¶
type UnleashInstance struct { Name string KubernetesNamespace string CreatedAt metav1.Time ServerInstance *unleashv1.Unleash DatabaseInstanceName string DatabaseProjectName string Database *admin.Database DatabaseUser *admin.User DatabaseSecret *corev1.Secret }
func NewUnleashInstance ¶
func NewUnleashInstance(serverInstance *unleashv1.Unleash) *UnleashInstance
func (UnleashInstance) Age ¶
func (u UnleashInstance) Age() string
func (*UnleashInstance) ApiUrl ¶
func (u *UnleashInstance) ApiUrl() string
func (*UnleashInstance) GetDatabase ¶
func (u *UnleashInstance) GetDatabase(ctx context.Context, client *admin.DatabasesService) error
func (*UnleashInstance) GetDatabaseUser ¶
func (u *UnleashInstance) GetDatabaseUser(ctx context.Context, client *admin.UsersService) error
func (*UnleashInstance) IsReady ¶
func (u *UnleashInstance) IsReady() bool
func (*UnleashInstance) Status ¶
func (u *UnleashInstance) Status() string
func (*UnleashInstance) StatusLabel ¶
func (u *UnleashInstance) StatusLabel() string
func (*UnleashInstance) Version ¶
func (u *UnleashInstance) Version() string
func (*UnleashInstance) WebUrl ¶
func (u *UnleashInstance) WebUrl() string
type UnleashService ¶
type UnleashService struct {
// contains filtered or unexported fields
}
func NewUnleashService ¶
func NewUnleashService(sqlDatabasesClient ISQLDatabasesService, sqlUsersClient ISQLUsersService, kubeClient ctrl.Client, config *config.Config, logger *logrus.Logger) *UnleashService
func (*UnleashService) Create ¶
func (s *UnleashService) Create(ctx context.Context, uc *UnleashConfig) (*unleashv1.Unleash, error)
func (*UnleashService) Delete ¶
func (s *UnleashService) Delete(ctx context.Context, name string) error
func (*UnleashService) Get ¶
func (s *UnleashService) Get(ctx context.Context, name string) (*UnleashInstance, error)
func (*UnleashService) List ¶
func (s *UnleashService) List(ctx context.Context) ([]*UnleashInstance, error)
func (*UnleashService) Update ¶
func (s *UnleashService) Update(ctx context.Context, uc *UnleashConfig) (*unleashv1.Unleash, error)
Click to show internal directories.
Click to hide internal directories.