-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parameterize # of GameServer Creation/Deletion (#432)
* Changed gameservers to add/delete into variables * Update suite_test to use new constructor with constants * Added new fields to main.go for configurable max * Add new vars into manager.yaml * Remove variables from manager.yaml * Moved config to separate class * Format config.go * Added values to suite_test.go struct * Added extra comment about config in tests * Refactored config struct to use consts * Added envDefault to config, Parsed config in suite_test.go
- Loading branch information
Showing
4 changed files
with
43 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package controllers | ||
|
||
// Config is a struct containing configuration from environment variables | ||
// source: https://github.com/caarlos0/env | ||
type Config struct { | ||
ApiServiceSecurity string `env:"API_SERVICE_SECURITY" envDefault:"none"` | ||
TlsSecretName string `env:"TLS_SECRET_NAME" envDefault:"tls-secret"` | ||
TlsSecretNamespace string `env:"TLS_SECRET_NAMESPACE" envDefault:"thundernetes-system"` | ||
TlsCertificateName string `env:"TLS_CERTIFICATE_FILENAME" envDefault:"tls.crt"` | ||
TlsPrivateKeyFilename string `env:"TLS_PRIVATE_KEY_FILENAME" envDefault:"tls.key"` | ||
PortRegistryExclusivelyGameServerNodes bool `env:"PORT_REGISTRY_EXCLUSIVELY_GAME_SERVER_NODES" envDefault:"false"` | ||
LogLevel string `env:"LOG_LEVEL" envDefault:"info"` | ||
MinPort int32 `env:"MIN_PORT" envDefault:"10000"` | ||
MaxPort int32 `env:"MAX_PORT" envDefault:"12000"` | ||
AllocationApiSvcPort int32 `env:"ALLOC_API_SVC_PORT" envDefault:"5000"` | ||
InitContainerImageLinux string `env:"THUNDERNETES_INIT_CONTAINER_IMAGE,notEmpty" envDefault:"ghcr.io/playfab/thundernetes-initcontainer:0.6.0"` | ||
InitContainerImageWin string `env:"THUNDERNETES_INIT_CONTAINER_IMAGE_WIN,notEmpty" envDefault:"ghcr.io/playfab/thundernetes-initcontainer-win:0.6.0"` | ||
MaxNumberOfGameServersToAdd int `env:"MAX_NUM_GS_TO_ADD" envDefault:"20"` | ||
MaxNumberOfGameServersToDelete int `env:"MAX_NUM_GS_TO_DEL" envDefault:"20"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters