Skip to content
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

Update pods.go #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions hatchery/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,27 @@ func getPayModelForUser(userName string) (result *PayModel, err error) {
func createLocalK8sPod(ctx context.Context, hash string, userName string, accessToken string) error {
hatchApp := Config.ContainersMap[hash]

apiKey, err := getAPIKeyWithContext(ctx, accessToken)
if err != nil {
Config.Logger.Printf("Failed to get API key for user %v, Error: %v", userName, err)
return err
}

var extraVars []k8sv1.EnvVar

extraVars = append(extraVars, k8sv1.EnvVar{
Name: "API_KEY",
Value: apiKey.APIKey,
})
extraVars = append(extraVars, k8sv1.EnvVar{
Name: "API_KEY_ID",
Value: apiKey.KeyID,
})
// TODO: still mounting access token for now, remove this when fully switched to use API key
extraVars = append(extraVars, k8sv1.EnvVar{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably can remove this now

Name: "ACCESS_TOKEN",
Value: accessToken,
})
pod, err := buildPod(Config, &hatchApp, userName, extraVars)
if err != nil {
Config.Logger.Printf("Failed to configure pod for launch for user %v, Error: %v", userName, err)
Expand Down