Commit Graph

23 Commits (fe541e976c0e5f38a64c6f56d058ae43f718caf7)

Author SHA1 Message Date
x7upLime e34548f9ae Adds description to lock.AppendToFile 2023-04-22 00:47:06 +03:00
x7upLime 9d4f296c1f Adjusts mount processes cleaning logic
The delete mechanism called by the --kill flag logic
inside the minikube mount command, relies on a .mount-process file
inside the .minikube dotfolder in home directory.

For this to work, the mount should've been instantiated
by some mechanism that also creates the file; like
k8s.io/minikube/pkg/minikube/node.configureMounts()

To just add the local.WriteFile() logic from configureMounts()
is not enough for the usecase in #15778:
user's consequent "minikube mount" calls would break the cleaning
logic, since the file's content gets overwritten at each new call.
So on subsequent minikube mounts, a call to "minikube mount
--kill=true" would remove just the last pid, leaving the other
mounts unaltered, and no trace of them in any place...(leak?)

For the same mechanism to work here,
we should rely on some local.AppendFile() function, to add
separated pids consequently.
This way only "minikube mount" would use this new append logic,
leaving unaltered the other functions.

We now have a new behaviour for the .mount-process file,
in order to address this, we should modify the delete logic from
cmd/minikube/cmd/delete.go -- killProcess(),
so that we can both kill a single pid, as well as multiple
space-separated pids in the same way.

...

Ah yes..
we're slightly modifying the "minikube mount" RunE anon function,
in order to write the pid into the .mount-process file;
as well as modifying cluster.Mount()'s signature to accept the pid.
That should be more than safe, since cluster.Mount() is used only here
2023-04-22 00:47:06 +03:00
Predrag Rogic 11a8dbf830
fix TestNetworkPlugins tests for Linux with Docker driver 2022-12-07 12:34:14 +00:00
KallyDev 70022d9b2e
Move from deprecated ioutil to os and io packages 2021-10-08 08:57:19 +08:00
Priya Modali 97d96bf925 Switching from glob library to klog library. 2020-09-29 15:49:41 -07:00
Thomas Stromberg 7f5a06b606 Unwrap unnecessary level of error annotation for improved messages 2020-08-30 20:48:55 -07:00
Thomas Stromberg d811f6e428 Remove unused forceID var 2019-12-11 12:10:28 -08:00
Thomas Stromberg 3171493e51 Rename to PathMutexSpec 2019-12-11 12:01:32 -08:00
Thomas Stromberg c5f65baf61 Remove uid from hash name, as it is not necessary now that we lock on filenames rather than descriptive names 2019-12-11 11:52:36 -08:00
Thomas Stromberg 129b6a870b Update log messages 2019-12-11 09:54:44 -08:00
Thomas Stromberg af4e690837 Use sha1 for a larger hash, truncated to 40 chars 2019-12-11 09:14:20 -08:00
Thomas Stromberg cfe0f5a5b7 Use md5 to generate unique lock names 2019-12-11 08:13:12 -08:00
Thomas Stromberg bb28d5c346 Make lock names more specific to avoid conflicts 2019-11-14 10:57:11 -08:00
Sharif Elgamal 4733ebd1c3 formatting 2019-08-22 13:19:56 -07:00
Sharif Elgamal 534b2e9ec4 add test for getMutexName 2019-08-22 12:45:04 -07:00
Sharif Elgamal 8b4365e51d change confusing variable name 2019-08-21 18:55:35 -07:00
Sharif Elgamal 0cd49b8a32 more massaging around mutex name 2019-08-21 15:42:57 -07:00
Sharif Elgamal 020167617a add comments for clarity 2019-08-21 15:21:10 -07:00
Sharif Elgamal 43e39618a2 Replace file lock with mutex 2019-08-21 15:17:32 -07:00
Guangming Wang 8fb12d3a61
cleanup: lock.go error message typo fix
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-17 23:29:21 +08:00
Medya Gh 9fad24aa37 defer release the lock 2019-08-14 11:05:03 -07:00
Medya Gh c8e6f61bc1 convert all util.Retry to retry.Expo 2019-08-14 00:24:51 -07:00
Medya Gh 998d305af3 Adding lock to most ioutil.WriteFile 2019-08-13 21:12:34 -07:00