Rename variables and snapshotter option to resolve lint warnings
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
This commit is contained in:
		| @@ -45,7 +45,7 @@ type SnapshotterConfig struct { | ||||
| 	upperdirLabel bool | ||||
| 	ms            MetaStore | ||||
| 	mountOptions  []string | ||||
| 	remapIds      bool | ||||
| 	remapIDs      bool | ||||
| 	slowChown     bool | ||||
| } | ||||
|  | ||||
| @@ -94,8 +94,8 @@ func WithMetaStore(ms MetaStore) Opt { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func WithRemapIds(config *SnapshotterConfig) error { | ||||
| 	config.remapIds = true | ||||
| func WithRemapIDs(config *SnapshotterConfig) error { | ||||
| 	config.remapIDs = true | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| @@ -110,7 +110,7 @@ type snapshotter struct { | ||||
| 	asyncRemove   bool | ||||
| 	upperdirLabel bool | ||||
| 	options       []string | ||||
| 	remapIds      bool | ||||
| 	remapIDs      bool | ||||
| 	slowChown     bool | ||||
| } | ||||
|  | ||||
| @@ -167,7 +167,7 @@ func NewSnapshotter(root string, opts ...Opt) (snapshots.Snapshotter, error) { | ||||
| 		asyncRemove:   config.asyncRemove, | ||||
| 		upperdirLabel: config.upperdirLabel, | ||||
| 		options:       config.mountOptions, | ||||
| 		remapIds:      config.remapIds, | ||||
| 		remapIDs:      config.remapIDs, | ||||
| 		slowChown:     config.slowChown, | ||||
| 	}, nil | ||||
| } | ||||
| @@ -573,7 +573,7 @@ func (o *snapshotter) prepareDirectory(ctx context.Context, snapshotDir string, | ||||
| func (o *snapshotter) mounts(s storage.Snapshot, info snapshots.Info) []mount.Mount { | ||||
| 	var options []string | ||||
|  | ||||
| 	if o.remapIds { | ||||
| 	if o.remapIDs { | ||||
| 		if v, ok := info.Labels[snapshots.LabelSnapshotUIDMapping]; ok { | ||||
| 			options = append(options, fmt.Sprintf("uidmap=%s", v)) | ||||
| 		} | ||||
|   | ||||
| @@ -54,7 +54,7 @@ func TestOverlay(t *testing.T) { | ||||
| 		// default in init() | ||||
| 		"AsynchronousRemove": {AsynchronousRemove}, | ||||
| 		// idmapped mounts enabled | ||||
| 		"WithRemapIds": {WithRemapIds}, | ||||
| 		"WithRemapIDs": {WithRemapIDs}, | ||||
| 	} | ||||
|  | ||||
| 	for optsName, opts := range optTestCases { | ||||
| @@ -211,7 +211,7 @@ func testOverlayRemappedBind(t *testing.T, newSnapshotter testsuite.SnapshotterF | ||||
| 		t.Fatal(err) | ||||
| 	} | ||||
|  | ||||
| 	if sn, ok := o.(*snapshotter); !ok || !sn.remapIds { | ||||
| 	if sn, ok := o.(*snapshotter); !ok || !sn.remapIDs { | ||||
| 		t.Skip("overlayfs doesn't support idmapped mounts") | ||||
| 	} | ||||
|  | ||||
| @@ -316,7 +316,7 @@ func testOverlayRemappedActive(t *testing.T, newSnapshotter testsuite.Snapshotte | ||||
| 		t.Fatal(err) | ||||
| 	} | ||||
|  | ||||
| 	if sn, ok := o.(*snapshotter); !ok || !sn.remapIds { | ||||
| 	if sn, ok := o.(*snapshotter); !ok || !sn.remapIDs { | ||||
| 		t.Skip("overlayfs doesn't support idmapped mounts") | ||||
| 	} | ||||
|  | ||||
| @@ -390,7 +390,7 @@ func testOverlayRemappedInvalidMapping(t *testing.T, newSnapshotter testsuite.Sn | ||||
| 		t.Fatal(err) | ||||
| 	} | ||||
|  | ||||
| 	if sn, ok := o.(*snapshotter); !ok || !sn.remapIds { | ||||
| 	if sn, ok := o.(*snapshotter); !ok || !sn.remapIDs { | ||||
| 		t.Skip("overlayfs doesn't support idmapped mounts") | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -30,8 +30,8 @@ import ( | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	capaRemapIds     = "remap-ids" | ||||
| 	capaOnlyRemapIds = "only-remap-ids" | ||||
| 	capaRemapIDs     = "remap-ids" | ||||
| 	capaOnlyRemapIDs = "only-remap-ids" | ||||
| ) | ||||
|  | ||||
| // Config represents configuration for the overlay plugin. | ||||
| @@ -80,16 +80,16 @@ func init() { | ||||
| 				oOpts = append(oOpts, overlay.WithMountOptions(config.MountOptions)) | ||||
| 			} | ||||
| 			if ok, err := overlayutils.SupportsIDMappedMounts(); err == nil && ok { | ||||
| 				oOpts = append(oOpts, overlay.WithRemapIds) | ||||
| 				ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaRemapIds) | ||||
| 				oOpts = append(oOpts, overlay.WithRemapIDs) | ||||
| 				ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaRemapIDs) | ||||
| 			} | ||||
|  | ||||
| 			if config.SlowChown { | ||||
| 				oOpts = append(oOpts, overlay.WithSlowChown) | ||||
| 			} else { | ||||
| 				// If slowChown is false, we use capaOnlyRemapIds to signal we only | ||||
| 				// If slowChown is false, we use capaOnlyRemapIDs to signal we only | ||||
| 				// allow idmap mounts. | ||||
| 				ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaOnlyRemapIds) | ||||
| 				ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaOnlyRemapIDs) | ||||
| 			} | ||||
|  | ||||
| 			ic.Meta.Exports["root"] = root | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Austin Vazquez
					Austin Vazquez