Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit36f6489

Browse files
committed
Fix loading certificates
1 parent71be7e6 commit36f6489

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

‎README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ resource "kubernetes_deployment" "hello_world" {
3838
```
3939

4040
This ensures all pod events will be sent during initialization and startup.
41+
42+
##Custom Certificates
43+
44+
-[`SSL_CERT_FILE`](https://go.dev/src/crypto/x509/root_unix.go#L19): Specifies the path to an SSL certificate.
45+
-[`SSL_CERT_DIR`](https://go.dev/src/crypto/x509/root_unix.go#L25): Identifies which directory to check for SSL certificate files.

‎go.mod‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ require (
3232
github.com/armon/go-radixv1.0.0// indirect
3333
github.com/aymanbagabas/go-osc52/v2v2.0.1// indirect
3434
github.com/beorn7/perksv1.0.1// indirect
35+
github.com/breml/rootcertsv0.2.11// indirect
3536
github.com/cenkalti/backoff/v4v4.2.0// indirect
3637
github.com/cespare/xxhash/v2v2.2.0// indirect
3738
github.com/charmbracelet/lipglossv0.7.1// indirect

‎go.sum‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY=
114114
github.com/bep/godartsassv0.16.0 h1:nTpenrZBQjVSjLkCw3AgnYmBB2czauTJa4BLLv448qg=
115115
github.com/bep/golibsassv1.1.0 h1:pjtXr00IJZZaOdfryNa9wARTB3Q0BmxC3/V1KNcgyTw=
116116
github.com/bool64/sharedv0.1.5 h1:fp3eUhBsrSjNCQPcSdQqZxxh9bBwrYiZ+zOKFkM0/2E=
117+
github.com/breml/rootcertsv0.2.11 h1:njUAtoyZ6HUXPAPk63tGz0BEZk1/6gyfqK5fTzksHkM=
118+
github.com/breml/rootcertsv0.2.11/go.mod h1:S/PKh+4d1HUn4HQovEB8hPJZO6pUZYrIhmXBhsegfXw=
117119
github.com/bytecodealliance/wasmtime-go/v3v3.0.2 h1:3uZCA/BLTIu+DqCfguByNMJa2HVHpXvjfy0Dy7g6fuA=
118120
github.com/cenkalti/backoff/v4v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4=
119121
github.com/cenkalti/backoff/v4v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=

‎logger.go‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ import (
1818
"k8s.io/client-go/informers"
1919
"k8s.io/client-go/kubernetes"
2020
"k8s.io/client-go/tools/cache"
21+
22+
// *Never* remove this. Certificates are not bundled as part
23+
// of the container, so this is necessary for all connections
24+
// to not be insecure.
25+
_"github.com/breml/rootcerts"
2126
)
2227

2328
typepodEventLoggerOptionsstruct {
@@ -137,18 +142,17 @@ func (p *podEventLogger) init() error {
137142
p.mutex.Lock()
138143
deferp.mutex.Unlock()
139144
tokens,ok:=p.podToAgentTokens[pod.Name]
145+
if!ok {
146+
return
147+
}
140148
delete(p.podToAgentTokens,pod.Name)
141-
ifok {
142-
for_,token:=rangetokens {
143-
p.sendLog(pod.Name,token, agentsdk.StartupLog{
144-
CreatedAt:time.Now(),
145-
Output:fmt.Sprintf("🗑️ %s: %s",newColor(color.Bold).Sprint("Deleted pod"),pod.Name),
146-
Level:codersdk.LogLevelError,
147-
})
148-
}
149-
149+
for_,token:=rangetokens {
150+
p.sendLog(pod.Name,token, agentsdk.StartupLog{
151+
CreatedAt:time.Now(),
152+
Output:fmt.Sprintf("🗑️ %s: %s",newColor(color.Bold).Sprint("Deleted pod"),pod.Name),
153+
Level:codersdk.LogLevelError,
154+
})
150155
}
151-
152156
p.logger.Info(p.ctx,"unregistered agent pod",slog.F("pod",pod.Name))
153157
},
154158
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp