Merge pull request #7499 from Iceber/cleanup_shim_flag
runtime/v2/shim: clean up the use of containerdBinary
This commit is contained in:
commit
96a39ad53b
@ -70,7 +70,7 @@ type manager struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func newCommand(ctx context.Context, id, containerdBinary, containerdAddress, containerdTTRPCAddress string, debug bool) (*exec.Cmd, error) {
|
||||
func newCommand(ctx context.Context, id, containerdAddress, containerdTTRPCAddress string, debug bool) (*exec.Cmd, error) {
|
||||
ns, err := namespaces.NamespaceRequired(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -118,7 +118,7 @@ func (m manager) Name() string {
|
||||
}
|
||||
|
||||
func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (_ string, retErr error) {
|
||||
cmd, err := newCommand(ctx, id, opts.ContainerdBinary, opts.Address, opts.TTRPCAddress, opts.Debug)
|
||||
cmd, err := newCommand(ctx, id, opts.Address, opts.TTRPCAddress, opts.Debug)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ type service struct {
|
||||
cancel func()
|
||||
}
|
||||
|
||||
func newCommand(ctx context.Context, id, containerdBinary, containerdAddress, containerdTTRPCAddress string) (*exec.Cmd, error) {
|
||||
func newCommand(ctx context.Context, id, containerdAddress, containerdTTRPCAddress string) (*exec.Cmd, error) {
|
||||
ns, err := namespaces.NamespaceRequired(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -131,7 +131,7 @@ func newCommand(ctx context.Context, id, containerdBinary, containerdAddress, co
|
||||
}
|
||||
|
||||
func (s *service) StartShim(ctx context.Context, opts shim.StartOpts) (_ string, retErr error) {
|
||||
cmd, err := newCommand(ctx, opts.ID, opts.ContainerdBinary, opts.Address, opts.TTRPCAddress)
|
||||
cmd, err := newCommand(ctx, opts.ID, opts.Address, opts.TTRPCAddress)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ type Publisher interface {
|
||||
// StartOpts describes shim start configuration received from containerd
|
||||
type StartOpts struct {
|
||||
ID string // TODO(2.0): Remove ID, passed directly to start for call symmetry
|
||||
ContainerdBinary string
|
||||
ContainerdBinary string // TODO(2.0): Remove ContainerdBinary, use the TTRPC_ADDRESS env to forward events
|
||||
Address string
|
||||
TTRPCAddress string
|
||||
Debug bool
|
||||
@ -148,7 +148,9 @@ func parseFlags() {
|
||||
flag.StringVar(&bundlePath, "bundle", "", "path to the bundle if not workdir")
|
||||
|
||||
flag.StringVar(&addressFlag, "address", "", "grpc address back to main containerd")
|
||||
flag.StringVar(&containerdBinaryFlag, "publish-binary", "containerd", "path to publish binary (used for publishing events)")
|
||||
flag.StringVar(&containerdBinaryFlag, "publish-binary", "",
|
||||
fmt.Sprintf("path to publish binary (used for publishing events), but %s will ignore this flag, please use the %s env", os.Args[0], ttrpcAddressEnv),
|
||||
)
|
||||
|
||||
flag.Parse()
|
||||
action = flag.Arg(0)
|
||||
@ -333,7 +335,6 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi
|
||||
return nil
|
||||
case "start":
|
||||
opts := StartOpts{
|
||||
ContainerdBinary: containerdBinaryFlag,
|
||||
Address: addressFlag,
|
||||
TTRPCAddress: ttrpcAddress,
|
||||
Debug: debugFlag,
|
||||
|
Loading…
Reference in New Issue
Block a user