Add workspace creation feature

This commit is contained in:
starryskymeow
2025-07-04 18:03:00 +08:00
parent 3ed03208fb
commit fa18edc20f
8 changed files with 610 additions and 0 deletions

17
internal/k8s/client.go Normal file
View File

@@ -0,0 +1,17 @@
package k8s
import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
)
// NewClient creates a new Kubernetes clientset.
func NewClient() (*kubernetes.Clientset, error) {
// Try to load in-cluster config
config, err := rest.InClusterConfig()
if err != nil {
return nil, err
}
return kubernetes.NewForConfig(config)
}