Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: cipd/client/cli/main.go

Issue 2877643002: [cipd] stop doing weird ownership transfer (Closed)
Patch Set: fix nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cipd/client/cipd/local/reader_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/client/cli/main.go
diff --git a/cipd/client/cli/main.go b/cipd/client/cli/main.go
index 0258a09c7b3aad5c18eb7fe0a3b4510461705b9c..be1c65f897c1986e92652109aeb492c224669639 100644
--- a/cipd/client/cli/main.go
+++ b/cipd/client/cli/main.go
@@ -1545,11 +1545,11 @@ func (c *deployRun) Run(a subcommands.Application, args []string, env subcommand
}
func deployInstanceFile(ctx context.Context, root string, instanceFile string) (common.Pin, error) {
- inst, err := local.OpenInstanceFile(ctx, instanceFile, "", local.VerifyHash)
+ inst, closer, err := local.OpenInstanceFile(ctx, instanceFile, "", local.VerifyHash)
if err != nil {
return common.Pin{}, err
}
- defer inst.Close()
+ defer closer()
inspectInstance(ctx, inst, false)
d := local.NewDeployer(root)
@@ -1627,12 +1627,12 @@ func fetchInstanceFile(ctx context.Context, packageName, version, instanceFile s
// the hash.
out.Close()
ok = true
- inst, err := local.OpenInstanceFile(ctx, instanceFile, pin.InstanceID, local.SkipHashVerification)
+ inst, closer, err := local.OpenInstanceFile(ctx, instanceFile, pin.InstanceID, local.SkipHashVerification)
if err != nil {
os.Remove(instanceFile)
return common.Pin{}, err
}
- defer inst.Close()
+ defer closer()
inspectInstance(ctx, inst, false)
return inst.Pin(), nil
}
@@ -1667,11 +1667,11 @@ func (c *inspectRun) Run(a subcommands.Application, args []string, env subcomman
}
func inspectInstanceFile(ctx context.Context, instanceFile string, listFiles bool) (common.Pin, error) {
- inst, err := local.OpenInstanceFile(ctx, instanceFile, "", local.VerifyHash)
+ inst, closer, err := local.OpenInstanceFile(ctx, instanceFile, "", local.VerifyHash)
if err != nil {
return common.Pin{}, err
}
- defer inst.Close()
+ defer closer()
inspectInstance(ctx, inst, listFiles)
return inst.Pin(), nil
}
@@ -1752,11 +1752,11 @@ func (c *registerRun) Run(a subcommands.Application, args []string, env subcomma
}
func registerInstanceFile(ctx context.Context, instanceFile string, opts *registerOpts) (common.Pin, error) {
- inst, err := local.OpenInstanceFile(ctx, instanceFile, "", local.VerifyHash)
+ inst, closer, err := local.OpenInstanceFile(ctx, instanceFile, "", local.VerifyHash)
if err != nil {
return common.Pin{}, err
}
- defer inst.Close()
+ defer closer()
client, err := opts.clientOptions.makeCipdClient(ctx, "")
if err != nil {
return common.Pin{}, err
« no previous file with comments | « cipd/client/cipd/local/reader_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698