Add a leading space after the comment sign

Fix coding standards

Signed-off-by: Tony Fang <nhfang@amazon.com>
This commit is contained in:
Tony Fang
2023-02-26 01:41:47 +00:00
parent f53417921d
commit 8a47c6910f
5 changed files with 20 additions and 20 deletions

View File

@@ -89,7 +89,7 @@ func (ts *localTransferService) importStream(ctx context.Context, i transfer.Ima
handler = images.Handlers(handlerFunc)
// First find suitable platforms to unpack into
//If image storer is also an unpacker type, i.e implemented UnpackPlatforms() func
// If image storer is also an unpacker type, i.e implemented UnpackPlatforms() func
if iu, ok := is.(transfer.ImageUnpacker); ok {
unpacks := iu.UnpackPlatforms()
if len(unpacks) > 0 {

View File

@@ -116,7 +116,7 @@ func (ts *localTransferService) pull(ctx context.Context, ir transfer.ImageFetch
return err
}
//Set up baseHandlers from service configuration if present or create a new one
// Set up baseHandlers from service configuration if present or create a new one
if ts.config.BaseHandlers != nil {
baseHandlers = ts.config.BaseHandlers
} else {
@@ -151,12 +151,12 @@ func (ts *localTransferService) pull(ctx context.Context, ir transfer.ImageFetch
)...)
// First find suitable platforms to unpack into
//If image storer is also an unpacker type, i.e implemented UnpackPlatforms() func
// If image storer is also an unpacker type, i.e implemented UnpackPlatforms() func
if iu, ok := is.(transfer.ImageUnpacker); ok {
unpacks := iu.UnpackPlatforms()
if len(unpacks) > 0 {
uopts := []unpack.UnpackerOpt{}
//Only unpack if requested unpackconfig matches default/supported unpackconfigs
// Only unpack if requested unpackconfig matches default/supported unpackconfigs
for _, u := range unpacks {
matched, mu := getSupportedPlatform(u, ts.config.UnpackPlatforms)
if matched {
@@ -254,11 +254,11 @@ func fetchHandler(ingester content.Ingester, fetcher remotes.Fetcher, pt *Progre
func getSupportedPlatform(uc transfer.UnpackConfiguration, supportedPlatforms []unpack.Platform) (bool, unpack.Platform) {
var u unpack.Platform
for _, sp := range supportedPlatforms {
//If both platform and snapshotter match, return the supportPlatform
//If platform matched and SnapshotterKey is empty, we assume client didn't pass SnapshotterKey
//use default Snapshotter
// If both platform and snapshotter match, return the supportPlatform
// If platform matched and SnapshotterKey is empty, we assume client didn't pass SnapshotterKey
// use default Snapshotter
if sp.Platform.Match(uc.Platform) {
//assuming sp.SnapshotterKey is not empty
// Assume sp.SnapshotterKey is not empty
if uc.Snapshotter == sp.SnapshotterKey {
return true, sp
} else if uc.Snapshotter == "" && sp.SnapshotterKey == containerd.DefaultSnapshotter {

View File

@@ -39,9 +39,9 @@ type localTransferService struct {
leases leases.Manager
content content.Store
images images.Store
//limiter for upload
// limiter for upload
limiterU *semaphore.Weighted
//limiter for download operation
// limiter for download operation
limiterD *semaphore.Weighted
config TransferConfig
}
@@ -168,7 +168,7 @@ type TransferConfig struct {
// handlers.
BaseHandlers []images.Handler
//UnpackPlatforms are used to specify supported combination of platforms and snapshotters
// UnpackPlatforms are used to specify supported combination of platforms and snapshotters
UnpackPlatforms []unpack.Platform `toml:"unpack_platforms"`
// RegistryConfigPath is a path to the root directory containing registry-specific configurations