Skip to content

Commit b1ce406

Browse files
committed
feat(aliyun): implement metadata token authentication
- Add token-based authentication for metadata requests - Implement token caching and automatic refresh - Update metadata retrieval functions to use token authentication - Handle token expiration and unauthorized access errors - Remove unnecessary error handling code Signed-off-by: l1b0k <[email protected]>
1 parent 85d2aab commit b1ce406

File tree

5 files changed

+654
-98
lines changed

5 files changed

+654
-98
lines changed

daemon/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"syscall"
1717
"time"
1818

19+
"github.com/AliyunContainerService/terway/pkg/aliyun/metadata"
1920
"github.com/alexflint/go-filemutex"
2021
"github.com/go-logr/logr"
2122
"k8s.io/apimachinery/pkg/util/wait"
@@ -227,7 +228,7 @@ func runDebugServer(ctx context.Context, wg *sync.WaitGroup, debugSocketListen s
227228
func registerPrometheus() {
228229
prometheus.MustRegister(metric.RPCLatency)
229230
prometheus.MustRegister(metric.OpenAPILatency)
230-
prometheus.MustRegister(metric.MetadataLatency)
231+
prometheus.MustRegister(metadata.MetadataLatency)
231232
// ResourcePool
232233
prometheus.MustRegister(metric.ResourcePoolTotal)
233234
prometheus.MustRegister(metric.ResourcePoolIdle)

0 commit comments

Comments
 (0)