Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/registry-facade/cmd/debug.go
2498 views
1
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package cmd
6
7
import (
8
"fmt"
9
10
"github.com/gitpod-io/gitpod/registry-facade/api"
11
"github.com/golang/protobuf/jsonpb"
12
13
"github.com/spf13/cobra"
14
)
15
16
// debugCmd represents the run command
17
var debugCmd = &cobra.Command{
18
Use: "debug",
19
Short: "Helps debug registry-facade",
20
Args: cobra.ExactArgs(1),
21
}
22
23
var debugSpec api.ImageSpec
24
25
var debugCreateSpecCmd = &cobra.Command{
26
Use: "create-spec",
27
Short: "creates a new spec",
28
RunE: func(cmd *cobra.Command, args []string) error {
29
var m jsonpb.Marshaler
30
m.Indent = " "
31
s, err := m.MarshalToString(&debugSpec)
32
if err != nil {
33
return err
34
}
35
36
fmt.Println(s)
37
38
return nil
39
},
40
}
41
42
func init() {
43
rootCmd.AddCommand(debugCmd)
44
debugCmd.AddCommand(debugCreateSpecCmd)
45
46
debugCmd.Flags().StringVar(&debugSpec.BaseRef, "base-ref", "docker.io/library/ubuntu:latest", "sets the base ref")
47
debugCmd.Flags().StringVar(&debugSpec.IdeRef, "ide-ref", "eu.gcr.io/gitpod-core-dev/build/ide/code:commit-8dd2ddd844f30a4ff66d2704f4714e9da875c7d5", "sets the IDE ref")
48
debugCmd.Flags().StringVar(&debugSpec.SupervisorRef, "supervisor-ref", "eu.gcr.io/gitpod-core-dev/build/supervisor:main.2733", "sets the supervisor ref")
49
}
50
51