Skip to content

Commit 3c1ecb0

Browse files
committed
go 1.19 'go fmt ./...'
Signed-off-by: Tim Ramlot <[email protected]>
1 parent 05794f1 commit 3c1ecb0

File tree

2 files changed

+43
-33
lines changed

2 files changed

+43
-33
lines changed

manager/util/tokenrequest.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ import (
4343
// defined on the CSIDriver manifest definition, along with setting
4444
// requiresRepublish to true:
4545
//
46-
// tokenRequests:
47-
// - audience: ""
48-
// expirationSeconds: 3600
49-
// requiresRepublish: true
46+
// tokenRequests:
47+
// - audience: ""
48+
// expirationSeconds: 3600
49+
// requiresRepublish: true
5050
//
5151
// restConfig must contain the Kubernetes API server Host, and a valid
5252
// TLSClientConfig.

third_party/util/atomic_writer.go

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ const (
3939
//
4040
// Note:
4141
//
42-
// 1. AtomicWriter reserves the set of pathnames starting with `..`.
43-
// 2. AtomicWriter offers no concurrency guarantees and must be synchronized
44-
// by the caller.
42+
// 1. AtomicWriter reserves the set of pathnames starting with `..`.
43+
// 2. AtomicWriter offers no concurrency guarantees and must be synchronized
44+
// by the caller.
4545
//
4646
// The visible files in this volume are symlinks to files in the writer's data
4747
// directory. Actual files are stored in a hidden timestamped directory which
@@ -86,35 +86,45 @@ const (
8686
//
8787
// The Write algorithm is:
8888
//
89-
// 1. The payload is validated; if the payload is invalid, the function returns
90-
// 2. The current timestamped directory is detected by reading the data directory
91-
// symlink
92-
// 3. The old version of the volume is walked to determine whether any
93-
// portion of the payload was deleted and is still present on disk.
94-
// 4. The data in the current timestamped directory is compared to the projected
95-
// data to determine if an update is required.
96-
// 5. A new timestamped dir is created
97-
// 6. The payload is written to the new timestamped directory
98-
// 7. Symlinks and directory for new user-visible files are created (if needed).
89+
// 1. The payload is validated; if the payload is invalid, the function returns
9990
//
100-
// For example, consider the files:
101-
// <target-dir>/podName
102-
// <target-dir>/user/labels
103-
// <target-dir>/k8s/annotations
91+
// 2. The current timestamped directory is detected by reading the data directory
92+
// symlink
10493
//
105-
// The user visible files are symbolic links into the internal data directory:
106-
// <target-dir>/podName -> ..data/podName
107-
// <target-dir>/usr -> ..data/usr
108-
// <target-dir>/k8s -> ..data/k8s
94+
// 3. The old version of the volume is walked to determine whether any
95+
// portion of the payload was deleted and is still present on disk.
10996
//
110-
// The data directory itself is a link to a timestamped directory with
111-
// the real data:
112-
// <target-dir>/..data -> ..2016_02_01_15_04_05.12345678/
113-
// 8. A symlink to the new timestamped directory ..data_tmp is created that will
114-
// become the new data directory
115-
// 9. The new data directory symlink is renamed to the data directory; rename is atomic
116-
// 10. Old paths are removed from the user-visible portion of the target directory
117-
// 11. The previous timestamped directory is removed, if it exists
97+
// 4. The data in the current timestamped directory is compared to the projected
98+
// data to determine if an update is required.
99+
//
100+
// 5. A new timestamped dir is created
101+
//
102+
// 6. The payload is written to the new timestamped directory
103+
//
104+
// 7. Symlinks and directory for new user-visible files are created (if needed).
105+
//
106+
// For example, consider the files:
107+
// <target-dir>/podName
108+
// <target-dir>/user/labels
109+
// <target-dir>/k8s/annotations
110+
//
111+
// The user visible files are symbolic links into the internal data directory:
112+
// <target-dir>/podName -> ..data/podName
113+
// <target-dir>/usr -> ..data/usr
114+
// <target-dir>/k8s -> ..data/k8s
115+
//
116+
// The data directory itself is a link to a timestamped directory with
117+
// the real data:
118+
// <target-dir>/..data -> ..2016_02_01_15_04_05.12345678/
119+
//
120+
// 8. A symlink to the new timestamped directory ..data_tmp is created that will
121+
// become the new data directory
122+
//
123+
// 9. The new data directory symlink is renamed to the data directory; rename is atomic
124+
//
125+
// 10. Old paths are removed from the user-visible portion of the target directory
126+
//
127+
// 11. The previous timestamped directory is removed, if it exists
118128
func (w *AtomicWriter) Write(payload map[string]FileProjection) error {
119129
// (1)
120130
cleanPayload, err := validatePayload(payload)

0 commit comments

Comments
 (0)