Skip to content

Commit f44d90b

Browse files
committed
Rename variables and snapshotter option to resolve lint warnings
Signed-off-by: Austin Vazquez <[email protected]>
1 parent b87d78f commit f44d90b

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

client/snapshotter_opts_unix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727

2828
const (
2929
capaRemapIDs = "remap-ids"
30-
capaOnlyRemapIds = "only-remap-ids"
30+
capaOnlyRemapIDs = "only-remap-ids"
3131
)
3232

3333
// WithRemapperLabels creates the labels used by any supporting snapshotter
@@ -75,7 +75,7 @@ func resolveSnapshotOptions(ctx context.Context, client *Client, snapshotterName
7575

7676
capaOnlyRemap := false
7777
for _, capa := range capabs {
78-
if capa == capaOnlyRemapIds {
78+
if capa == capaOnlyRemapIDs {
7979
capaOnlyRemap = true
8080
}
8181
}

plugins/snapshots/overlay/overlay.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type SnapshotterConfig struct {
4545
upperdirLabel bool
4646
ms MetaStore
4747
mountOptions []string
48-
remapIds bool
48+
remapIDs bool
4949
slowChown bool
5050
}
5151

@@ -94,8 +94,8 @@ func WithMetaStore(ms MetaStore) Opt {
9494
}
9595
}
9696

97-
func WithRemapIds(config *SnapshotterConfig) error {
98-
config.remapIds = true
97+
func WithRemapIDs(config *SnapshotterConfig) error {
98+
config.remapIDs = true
9999
return nil
100100
}
101101

@@ -110,7 +110,7 @@ type snapshotter struct {
110110
asyncRemove bool
111111
upperdirLabel bool
112112
options []string
113-
remapIds bool
113+
remapIDs bool
114114
slowChown bool
115115
}
116116

@@ -167,7 +167,7 @@ func NewSnapshotter(root string, opts ...Opt) (snapshots.Snapshotter, error) {
167167
asyncRemove: config.asyncRemove,
168168
upperdirLabel: config.upperdirLabel,
169169
options: config.mountOptions,
170-
remapIds: config.remapIds,
170+
remapIDs: config.remapIDs,
171171
slowChown: config.slowChown,
172172
}, nil
173173
}
@@ -573,7 +573,7 @@ func (o *snapshotter) prepareDirectory(ctx context.Context, snapshotDir string,
573573
func (o *snapshotter) mounts(s storage.Snapshot, info snapshots.Info) []mount.Mount {
574574
var options []string
575575

576-
if o.remapIds {
576+
if o.remapIDs {
577577
if v, ok := info.Labels[snapshots.LabelSnapshotUIDMapping]; ok {
578578
options = append(options, fmt.Sprintf("uidmap=%s", v))
579579
}

plugins/snapshots/overlay/overlay_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestOverlay(t *testing.T) {
5454
// default in init()
5555
"AsynchronousRemove": {AsynchronousRemove},
5656
// idmapped mounts enabled
57-
"WithRemapIds": {WithRemapIds},
57+
"WithRemapIDs": {WithRemapIDs},
5858
}
5959

6060
for optsName, opts := range optTestCases {
@@ -211,7 +211,7 @@ func testOverlayRemappedBind(t *testing.T, newSnapshotter testsuite.SnapshotterF
211211
t.Fatal(err)
212212
}
213213

214-
if sn, ok := o.(*snapshotter); !ok || !sn.remapIds {
214+
if sn, ok := o.(*snapshotter); !ok || !sn.remapIDs {
215215
t.Skip("overlayfs doesn't support idmapped mounts")
216216
}
217217

@@ -316,7 +316,7 @@ func testOverlayRemappedActive(t *testing.T, newSnapshotter testsuite.Snapshotte
316316
t.Fatal(err)
317317
}
318318

319-
if sn, ok := o.(*snapshotter); !ok || !sn.remapIds {
319+
if sn, ok := o.(*snapshotter); !ok || !sn.remapIDs {
320320
t.Skip("overlayfs doesn't support idmapped mounts")
321321
}
322322

@@ -390,7 +390,7 @@ func testOverlayRemappedInvalidMapping(t *testing.T, newSnapshotter testsuite.Sn
390390
t.Fatal(err)
391391
}
392392

393-
if sn, ok := o.(*snapshotter); !ok || !sn.remapIds {
393+
if sn, ok := o.(*snapshotter); !ok || !sn.remapIDs {
394394
t.Skip("overlayfs doesn't support idmapped mounts")
395395
}
396396

plugins/snapshots/overlay/plugin/plugin.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import (
3030
)
3131

3232
const (
33-
capaRemapIds = "remap-ids"
34-
capaOnlyRemapIds = "only-remap-ids"
33+
capaRemapIDs = "remap-ids"
34+
capaOnlyRemapIDs = "only-remap-ids"
3535
)
3636

3737
// Config represents configuration for the overlay plugin.
@@ -80,16 +80,16 @@ func init() {
8080
oOpts = append(oOpts, overlay.WithMountOptions(config.MountOptions))
8181
}
8282
if ok, err := overlayutils.SupportsIDMappedMounts(); err == nil && ok {
83-
oOpts = append(oOpts, overlay.WithRemapIds)
84-
ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaRemapIds)
83+
oOpts = append(oOpts, overlay.WithRemapIDs)
84+
ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaRemapIDs)
8585
}
8686

8787
if config.SlowChown {
8888
oOpts = append(oOpts, overlay.WithSlowChown)
8989
} else {
90-
// If slowChown is false, we use capaOnlyRemapIds to signal we only
90+
// If slowChown is false, we use capaOnlyRemapIDs to signal we only
9191
// allow idmap mounts.
92-
ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaOnlyRemapIds)
92+
ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaOnlyRemapIDs)
9393
}
9494

9595
ic.Meta.Exports["root"] = root

0 commit comments

Comments
 (0)