Path: blob/main/install/installer/cmd/config_files_containerd.go
2498 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 cmd56import (7"github.com/gitpod-io/gitpod/common-go/log"8"github.com/gitpod-io/gitpod/installer/pkg/containerd"9"github.com/spf13/cobra"10)1112// configNodeContainerdCmd represents the validate command13var configNodeContainerdCmd = &cobra.Command{14Use: "containerd",15Short: "Detects the containerd settings for a cluster",16RunE: func(cmd *cobra.Command, args []string) error {17if _, err := configFileExistsAndInit(); err != nil {18return err19}2021_, _, cfg, err := loadConfig(configOpts.ConfigFile)22if err != nil {23return err24}2526containerd, socket, err := containerd.Detect(configFilesOpts.MountPath)27if err != nil {28return err29}30log.Infof("containerd location detected as %s", *containerd)31log.Infof("containerd socket location detected as %s", *socket)3233cfg.Workspace.Runtime.ContainerDRuntimeDir = containerd.String()34cfg.Workspace.Runtime.ContainerDSocketDir = socket.String()3536return saveConfigFile(cfg)37},38}3940func init() {41configFilesCmd.AddCommand(configNodeContainerdCmd)42}434445