mirror of
https://github.com/harivansh-afk/agentikube.git
synced 2026-04-15 07:04:44 +00:00
update config and initgo CRD
This commit is contained in:
parent
51691d55da
commit
ea1e837dce
2 changed files with 14 additions and 4 deletions
|
|
@ -11,7 +11,14 @@ import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
const crdInstallURL = "https://raw.githubusercontent.com/agent-sandbox/agent-sandbox/main/deploy/install.yaml"
|
const crdBaseURL = "https://raw.githubusercontent.com/kubernetes-sigs/agent-sandbox/main/k8s/crds/"
|
||||||
|
|
||||||
|
var crdFiles = []string{
|
||||||
|
"agents.x-k8s.io_sandboxes.yaml",
|
||||||
|
"extensions.agents.x-k8s.io_sandboxclaims.yaml",
|
||||||
|
"extensions.agents.x-k8s.io_sandboxtemplates.yaml",
|
||||||
|
"extensions.agents.x-k8s.io_sandboxwarmpools.yaml",
|
||||||
|
}
|
||||||
|
|
||||||
func NewInitCmd() *cobra.Command {
|
func NewInitCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
|
|
@ -35,9 +42,12 @@ func NewInitCmd() *cobra.Command {
|
||||||
|
|
||||||
// Apply agent-sandbox CRDs
|
// Apply agent-sandbox CRDs
|
||||||
fmt.Println("applying agent-sandbox CRDs...")
|
fmt.Println("applying agent-sandbox CRDs...")
|
||||||
out, err := exec.CommandContext(ctx, "kubectl", "apply", "-f", crdInstallURL).CombinedOutput()
|
for _, f := range crdFiles {
|
||||||
|
url := crdBaseURL + f
|
||||||
|
out, err := exec.CommandContext(ctx, "kubectl", "apply", "-f", url).CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("applying CRDs: %s: %w", strings.TrimSpace(string(out)), err)
|
return fmt.Errorf("applying CRD %s: %s: %w", f, strings.TrimSpace(string(out)), err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fmt.Println("[ok] agent-sandbox CRDs applied")
|
fmt.Println("[ok] agent-sandbox CRDs applied")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue