Path: blob/main/components/registry-facade/cmd/debug.go
2498 views
// Copyright (c) 2020 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 cmd56import (7"fmt"89"github.com/gitpod-io/gitpod/registry-facade/api"10"github.com/golang/protobuf/jsonpb"1112"github.com/spf13/cobra"13)1415// debugCmd represents the run command16var debugCmd = &cobra.Command{17Use: "debug",18Short: "Helps debug registry-facade",19Args: cobra.ExactArgs(1),20}2122var debugSpec api.ImageSpec2324var debugCreateSpecCmd = &cobra.Command{25Use: "create-spec",26Short: "creates a new spec",27RunE: func(cmd *cobra.Command, args []string) error {28var m jsonpb.Marshaler29m.Indent = " "30s, err := m.MarshalToString(&debugSpec)31if err != nil {32return err33}3435fmt.Println(s)3637return nil38},39}4041func init() {42rootCmd.AddCommand(debugCmd)43debugCmd.AddCommand(debugCreateSpecCmd)4445debugCmd.Flags().StringVar(&debugSpec.BaseRef, "base-ref", "docker.io/library/ubuntu:latest", "sets the base ref")46debugCmd.Flags().StringVar(&debugSpec.IdeRef, "ide-ref", "eu.gcr.io/gitpod-core-dev/build/ide/code:commit-8dd2ddd844f30a4ff66d2704f4714e9da875c7d5", "sets the IDE ref")47debugCmd.Flags().StringVar(&debugSpec.SupervisorRef, "supervisor-ref", "eu.gcr.io/gitpod-core-dev/build/supervisor:main.2733", "sets the supervisor ref")48}495051