Skip to content

Commit

Permalink
fix: k3s tf deploy functional
Browse files Browse the repository at this point in the history
Signed-off-by: DrummyFloyd <[email protected]>
  • Loading branch information
DrummyFloyd committed Jan 13, 2024
1 parent f9cef0e commit 5894a4f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions internal/utilities/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func CreateClusterRecordFromRaw(useTelemetry bool, gitOwner string, gitUser stri
case "civo":
cl.CivoAuth.Token = os.Getenv("CIVO_TOKEN")
case "aws":
//ToDo: where to get credentials?
// ToDo: where to get credentials?
cl.AWSAuth.AccessKeyID = viper.GetString("kubefirst.state-store-creds.access-key-id")
cl.AWSAuth.SecretAccessKey = viper.GetString("kubefirst.state-store-creds.secret-access-key-id")
cl.AWSAuth.SessionToken = viper.GetString("kubefirst.state-store-creds.token")
Expand All @@ -107,6 +107,9 @@ func CreateClusterRecordFromRaw(useTelemetry bool, gitOwner string, gitUser stri
cl.DigitaloceanAuth.SpacesSecret = os.Getenv("DO_SPACES_SECRET")
case "vultr":
cl.VultrAuth.Token = os.Getenv("VULTR_API_KEY")
case "k3s":
// TODO: waht is the purpose of this?
log.Info().Msgf("do i passed in here 2?")
}

cl.StateStoreCredentials.AccessKeyID = viper.GetString("kubefirst.state-store-creds.access-key-id")
Expand Down Expand Up @@ -177,7 +180,7 @@ func CreateClusterDefinitionRecordFromRaw(gitAuth apiTypes.GitAuth, cliFlags typ
case "civo":
cl.CivoAuth.Token = os.Getenv("CIVO_TOKEN")
case "aws":
//ToDo: where to get credentials?
// ToDo: where to get credentials?
cl.AWSAuth.AccessKeyID = viper.GetString("kubefirst.state-store-creds.access-key-id")
cl.AWSAuth.SecretAccessKey = viper.GetString("kubefirst.state-store-creds.secret-access-key-id")
cl.AWSAuth.SessionToken = viper.GetString("kubefirst.state-store-creds.token")
Expand All @@ -188,6 +191,15 @@ func CreateClusterDefinitionRecordFromRaw(gitAuth apiTypes.GitAuth, cliFlags typ
cl.DigitaloceanAuth.SpacesSecret = os.Getenv("DO_SPACES_SECRET")
case "vultr":
cl.VultrAuth.Token = os.Getenv("VULTR_API_KEY")
case "k3s":
agentsIpsArray := viper.GetStringSlice("flags.k3s-agents-ips")
if len(agentsIpsArray) == 0 {
agentsIpsArray = []string{}
}
cl.K3sAuth.K3sServersIps = viper.GetStringSlice("flags.k3s-servers-ips")
cl.K3sAuth.K3sAgentsIps = agentsIpsArray
cl.K3sAuth.K3sSshUser = viper.GetString("flags.k3s-ssh-user")
cl.K3sAuth.K3sSshPrivateKey = viper.GetString("flags.k3s-ssh-private-key")
case "google":
jsonFilePath := os.Getenv("GOOGLE_APPLICATION_CREDENTIALS")

Expand Down

0 comments on commit 5894a4f

Please sign in to comment.