Skip to content

Commit

Permalink
Grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Barry committed Dec 10, 2021
1 parent 278a1fc commit 592de53
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/cm/container_manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ type containerManager struct {
}

func (m *containerManager) Start() error {
// TODO: check if the required cgroups are mounted.
if len(m.cgroupsName) != 0 {
manager, err := createCgroupManager(m.cgroupsName)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions src/core/docker_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ const (

// Internal docker labels used to identify whether a container is a sandbox
// or a regular container.
// TODO: This is not backward compatible with older containers. We will
// need to add filtering based on names.
containerTypeLabelKey = "io.kubernetes.docker.type"
containerTypeLabelSandbox = "podsandbox"
containerTypeLabelContainer = "container"
Expand Down Expand Up @@ -321,8 +319,6 @@ type dockerService struct {
cleanupInfosLock sync.RWMutex
}

// TODO: handle context.

// Version returns the runtime name, runtime version and runtime API version
func (ds *dockerService) Version(_ context.Context, r *runtimeapi.VersionRequest) (*runtimeapi.VersionResponse, error) {
v, err := ds.getDockerVersion()
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/app/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type ContainerRuntimeOptions struct {
// the image pulling will be cancelled. Defaults to 1m0s.
// +optional
ImagePullProgressDeadline metav1.Duration
// runtimeRequestTimeout is the timeout for all runtime requests except long running
// runtimeRequestTimeout is the timeout for all runtime requests except long-running
// requests - pull, logs, exec and attach.
RuntimeRequestTimeout metav1.Duration
// streamingConnectionIdleTimeout is the maximum time a streaming connection
Expand Down
1 change: 0 additions & 1 deletion src/pkg/app/options/container_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
)

const (
// When these values are updated, also update test/e2e/framework/util.go
defaultPodSandboxImageName = "k8s.gcr.io/pause"
defaultPodSandboxImageVersion = "3.1"
)
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/app/options/globalflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

// AddGlobalFlags explicitly registers flags that libraries (glog, etc.) register
// against the global flagsets from "flag" and "github.com/spf13/pflag".
// We do this in order to prevent unwanted flags from leaking into the cri-dockerd's flagset.
// We do this in order to prevent unwanted flags from leaking into cri-dockerd's flagset.
func AddGlobalFlags(fs *pflag.FlagSet) {
addGlogFlags(fs)
logs.AddFlags(fs)
Expand Down
6 changes: 3 additions & 3 deletions src/pkg/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/spf13/pflag"
)

// DockerCRIFlags contains configuration flags for the cri-dockerd.
// DockerCRIFlags contains configuration flags for cri-dockerd
type DockerCRIFlags struct {
// Container-runtime-specific options.
config.ContainerRuntimeOptions
Expand Down Expand Up @@ -66,8 +66,8 @@ func (s *DockerCRIServer) AddFlags(fs *pflag.FlagSet) {
func (f *DockerCRIFlags) AddFlags(mainfs *pflag.FlagSet) {
fs := pflag.NewFlagSet("", pflag.ExitOnError)
defer func() {
// Unhide deprecated flags. We want deprecated flags to show in cri-dockerd's help.
// We have some hidden flags, but we might as well unhide these when they are deprecated,
// Un-hide deprecated flags. We want deprecated flags to show in cri-dockerd's help.
// We have some hidden flags, but we may as well un-hide these when they are deprecated,
// as silently deprecating and removing (even hidden) things is unkind to people who use them.
fs.VisitAll(func(f *pflag.Flag) {
if len(f.Deprecated) > 0 {
Expand Down
16 changes: 8 additions & 8 deletions src/pkg/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ func NewDockerCRICommand(stopCh <-chan struct{}) *cobra.Command {

cmd := &cobra.Command{
Use: componentDockerCRI,
Long: `CRI that connects to Docker Daemon`,
// The cri-dockerd has special flag parsing requirements to enforce flag precedence rules,
Long: `CRI that connects to the Docker Daemon`,
// cri-dockerd has special flag parsing requirements to enforce flag precedence rules,
// so we do all our parsing manually in Run, below.
// DisableFlagParsing=true provides the full set of flags passed to the cri-dockerd in the
// DisableFlagParsing=true provides the full set of flags passed to cri-dockerd in the
// `args` arg to Run, without Cobra's interference.
DisableFlagParsing: true,
Run: func(cmd *cobra.Command, args []string) {
Expand All @@ -62,13 +62,13 @@ func NewDockerCRICommand(stopCh <-chan struct{}) *cobra.Command {
cmds := cleanFlagSet.Args()
if len(cmds) > 0 {
cmd.Usage()
klog.Fatalf("unknown command: %s", cmds[0])
klog.Fatalf("Unknown command: %s", cmds[0])
}

// short-circuit on help
help, err := cleanFlagSet.GetBool("help")
if err != nil {
klog.Fatal(`"help" flag is non-bool, programmer error, please correct`)
klog.Fatal(`"help" flag is non-bool`)
}
if help {
cmd.Help()
Expand All @@ -93,8 +93,8 @@ func NewDockerCRICommand(stopCh <-chan struct{}) *cobra.Command {
// keep cleanFlagSet separate, so Cobra doesn't pollute it with the global flags
kubeletFlags.AddFlags(cleanFlagSet)
options.AddGlobalFlags(cleanFlagSet)
cleanFlagSet.BoolP("help", "h", false, fmt.Sprintf("help for %s", cmd.Name()))
cleanFlagSet.Bool("version", false, "prints the version of cri-dockerd")
cleanFlagSet.BoolP("help", "h", false, fmt.Sprintf("Help for %s", cmd.Name()))
cleanFlagSet.Bool("version", false, "Prints the version of cri-dockerd")

// ugly, but necessary, because Cobra's default UsageFunc and HelpFunc pollute the flagset with global flags
const usageFmt = "Usage:\n %s\n\nFlags:\n%s"
Expand Down Expand Up @@ -157,7 +157,7 @@ func RunCriDockerd(f *options.DockerCRIFlags, stopCh <-chan struct{}) error {
return err
}

klog.V(2).Infof("Starting the GRPC server for the docker CRI shim.")
klog.V(2).Infof("Starting the GRPC server for the Docker CRI interface.")
server := dockerremote.NewDockerServer(f.RemoteRuntimeEndpoint, ds)
if err := server.Start(); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion src/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package version

var (
// Version of the product
Version = "0.1.0"
Version = "0.2.0"
// PreRelease is set during the build
PreRelease = ""
// GitCommit is set during the build
Expand Down

0 comments on commit 592de53

Please sign in to comment.