chore: fix some comments to improve readability

Signed-off-by: solunolab <solunolab@outlook.com>
This commit is contained in:
solunolab 2026-06-07 11:56:20 +08:00 committed by Guillaume Lours
parent a4ec1dcd89
commit be0c713ca5
4 changed files with 7 additions and 7 deletions

View file

@ -214,7 +214,7 @@ func (s *composeService) pullServiceImage(ctx context.Context, service types.Ser
return "", nil
}
// check if has error and the service has a build section
// check if it has an error and the service has a build section
// then the status should be warning instead of error
if err != nil && service.Build != nil {
s.events.On(api.Resource{

View file

@ -47,7 +47,7 @@ func (s *composeService) RunOneOffContainer(ctx context.Context, project *types.
return 0, err
}
// remove cancellable context signal handler so we can forward signals to container without compose from exiting
// remove cancellable context signal handler so we can forward signals to container without compose exiting
signal.Reset()
sigc := make(chan os.Signal, 128)

View file

@ -247,7 +247,7 @@ func (s *composeService) watch(ctx context.Context, project *types.Project, opti
}
if shouldInitialSync && isSync(trigger) {
// Need to check initial files are in container that are meant to be synced from watch action
// Need to check that initial files meant to be synced from the watch action are in the container
err := s.initialSync(ctx, project, service, trigger, syncer)
if err != nil {
return nil, err
@ -761,7 +761,7 @@ func (s *composeService) initialSync(ctx context.Context, project *types.Project
return syncer.Sync(ctx, service.Name, pathsToCopy)
}
// Syncs files from develop.watch.path if thy have been modified after the image has been created
// Syncs files from develop.watch.path if they have been modified after the image has been created
//
//nolint:gocyclo
func (s *composeService) initialSyncFiles(ctx context.Context, project *types.Project, service types.ServiceConfig, trigger types.Trigger, ignore watch.PathMatcher) ([]*sync.PathMapping, error) {

View file

@ -45,7 +45,7 @@ const (
)
// validatePathInBase ensures a file path is contained within the base directory,
// as OCI artifacts resources must all live within the same folder.
// as OCI artifact resources must all live within the same folder.
func validatePathInBase(base, unsafePath string) error {
// Reject paths with path separators regardless of OS
if strings.ContainsAny(unsafePath, "\\/") {
@ -149,7 +149,7 @@ func (g *ociRemoteLoader) Load(ctx context.Context, path string) (string, error)
local = filepath.Join(cache, descriptor.Digest.Hex())
if _, err = os.Stat(local); os.IsNotExist(err) {
// a Compose application bundle is published as image index
// a Compose application bundle is published as an image index
if images.IsIndexType(descriptor.MediaType) {
var index spec.Index
err = json.Unmarshal(content, &index)
@ -184,7 +184,7 @@ func (g *ociRemoteLoader) Load(ctx context.Context, path string) (string, error)
err = g.pullComposeFiles(ctx, local, manifest, ref, resolver)
if err != nil {
// we need to clean up the directory to be sure we won't let empty files present
// we need to clean up the directory to be sure we won't leave empty files behind
_ = os.RemoveAll(local)
return "", err
}