GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Override with environment variables · stackbuilders/func@9125bcd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • pkg/k8s
    • keychains.go
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎pkg/k8s/keychains.go‎

Copy file name to clipboardExpand all lines: pkg/k8s/keychains.go
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package k8s
33
import (
44
"context"
55
"fmt"
6+
"os"
67
"strings"
78

89
"github.com/google/go-containerregistry/pkg/name"
@@ -56,6 +57,23 @@ func GetACRCredentialLoader() []creds.CredentialsCallback {
5657
return oci.Credentials{}, nil
5758
}
5859

60+
// HACK: Override credentials if they were given in environment
61+
if acrToken := os.Getenv("ACR_TOKEN"); acrToken != "" {
62+
return oci.Credentials{
63+
Username: "00000000-0000-0000-0000-000000000000",
64+
Password: acrToken,
65+
}, nil
66+
} else {
67+
acrUser := os.Getenv("ACR_USERNAME")
68+
acrPassword := os.Getenv("ACR_PASSWORD")
69+
if acrUser != "" && acrPassword != "" {
70+
return oci.Credentials{
71+
Username: acrUser,
72+
Password: acrPassword,
73+
}, nil
74+
}
75+
}
76+
5977
// TODO: Save token somewhere and check expiration before asking for a new one
6078

6179
azCredential, err := azidentity.NewDefaultAzureCredential(nil)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.