Path: blob/main/components/ws-manager-mk2/cmd/sample-workspace/main.go
2499 views
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License-AGPL.txt in the project root for license information.34package main56import (7"encoding/base64"8"fmt"9"log"10"time"1112metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"13"k8s.io/utils/pointer"14"sigs.k8s.io/yaml"1516workspacev1 "github.com/gitpod-io/gitpod/ws-manager/api/crd/v1"17)1819func main() {20initializer, _ := base64.StdEncoding.DecodeString("IoUCCn8KfXdvcmtzcGFjZXMvZ2l0cG9kaW8tZ2l0cG9kLTZjbDB6b2o0N2Z4L3NuYXBzaG90LTE2NTA2NDE3NzQ0MzUxMDExODMudGFyQGdpdHBvZC1wcm9kLXVzZXItMmRmNTNjMGItODgwZi00NmYxLWI3MmUtOWIwNDM3ZDYyOGEzEoEBCidodHRwczovL2dpdGh1Yi5jb20vZ2l0cG9kLWlvL2dpdHBvZC5naXQYAiIEbWFpbioGZ2l0cG9kMkYQAipCaHR0cHM6Ly9naXRwb2QuaW8vYXBpL290cy9nZXQvOGUyODI3YmYtZGI5Zi00ZmNiLWE5YzItZTc3N2Y2YTE3NWI2")21ws := workspacev1.Workspace{22TypeMeta: metav1.TypeMeta{23APIVersion: "workspace.gitpod.io/v1",24Kind: "Workspace",25},26ObjectMeta: metav1.ObjectMeta{27Name: "d735b3d9-e24b-492c-926f-eb5cd7cb1c3a",28},29Spec: workspacev1.WorkspaceSpec{30Ownership: workspacev1.Ownership{31Owner: "f2e2a512-9056-4de7-8a07-0210162055fc",32WorkspaceID: "gitpodio-gitpod-qy1xib2g0a0",33},34Type: workspacev1.WorkspaceTypeRegular,35Image: workspacev1.WorkspaceImages{36Workspace: workspacev1.WorkspaceImage{Ref: pointer.String("eu.gcr.io/gitpod-dev/workspace-images:c80f600433dad18e4dc852b26367da732536f5dcf69dc813af8fe58f5eb73b16")},37IDE: workspacev1.IDEImages{38Web: "eu.gcr.io/gitpod-core-dev/build/ide/code:nightly@sha256:5ad86443d01645a1c7011938ccac4b5ebbaffb0cf4b55ee51ee45296bfd5804b",39Supervisor: "eu.gcr.io/gitpod-core-dev/build/supervisor:commit-5d5781983089056e37d34c762f1f291b9a796357",40},41},42Initializer: initializer,43WorkspaceLocation: "/workspace/gitpod",44Timeout: workspacev1.TimeoutSpec{45Time: &metav1.Duration{Duration: 60 * time.Minute},46},47Admission: workspacev1.AdmissionSpec{48Level: workspacev1.AdmissionLevelOwner,49},50},51}52out, err := yaml.Marshal(ws)53if err != nil {54log.Fatal(err)55}56fmt.Println(string(out))57}585960