-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameterize # of GameServer Creation/Deletion #432
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
efdbf6d
Changed gameservers to add/delete into variables
nottagg 64675db
Update suite_test to use new constructor with constants
nottagg 19c1597
Added new fields to main.go for configurable max
nottagg b401540
Add new vars into manager.yaml
nottagg b7214a4
Remove variables from manager.yaml
nottagg 72bbd95
Moved config to separate class
nottagg f9484b6
Format config.go
nottagg 799a3af
Added values to suite_test.go struct
nottagg d2f1f8e
Added extra comment about config in tests
nottagg 8701d34
Refactored config struct to use consts
nottagg 63c3354
Added envDefault to config, Parsed config in suite_test.go
nottagg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"` | ||
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"` | ||
InitContainerImageWin string `env:"THUNDERNETES_INIT_CONTAINER_IMAGE_WIN,notEmpty"` | ||
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while this works, the Config struct defines some default values and it would be great to test them as well. Any chance we can use the same code we have in main.go? Like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need to provide some dummy values for the ones that should not be empty, like THUNDERNETES_INIT_CONTAINER_IMAGE and THUNDERNETES_INIT_CONTAINER_IMAGE_WIN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest commit uses the parse from main.go and filled in some defaults.