Add containerdVersion flag
Add version flag that only prints the static version for the binary. This commit does not include build details for containers since Makefile does not build them. Closes #8 Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
This commit is contained in:
@@ -17,11 +17,14 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"github.com/kubernetes-incubator/cri-containerd/cmd/cri-containerd/options"
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/server"
|
||||
"github.com/kubernetes-incubator/cri-containerd/pkg/version"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -29,6 +32,11 @@ func main() {
|
||||
o.AddFlags(pflag.CommandLine)
|
||||
options.InitFlags()
|
||||
|
||||
if o.CRIContainerdVersion {
|
||||
version.PrintVersion()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
glog.V(2).Infof("Connect to containerd socket %q with timeout %v", o.ContainerdSocketPath, o.ContainerdConnectionTimeout)
|
||||
conn, err := server.ConnectToContainerd(o.ContainerdSocketPath, o.ContainerdConnectionTimeout)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user