Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Aug 17, 2024
1 parent 183b439 commit 068866e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pkg/composer/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (c *Composer) Run(ctx context.Context, ro RunOptions) error {
if ro.User != "" {
targetSvc.User = ro.User
}
if ro.Volume != nil && len(ro.Volume) > 0 {
if len(ro.Volume) > 0 {
for _, v := range ro.Volume {
vc, err := format.ParseVolume(v)
if err != nil {
Expand All @@ -138,15 +138,15 @@ func (c *Composer) Run(ctx context.Context, ro RunOptions) error {
targetSvc.Volumes = append(targetSvc.Volumes, vc)
}
}
if ro.Entrypoint != nil && len(ro.Entrypoint) > 0 {
if len(ro.Entrypoint) > 0 {
targetSvc.Entrypoint = make([]string, len(ro.Entrypoint))
copy(targetSvc.Entrypoint, ro.Entrypoint)
}
if ro.Env != nil && len(ro.Env) > 0 {
if len(ro.Env) > 0 {
envs := types.NewMappingWithEquals(ro.Env)
targetSvc.Environment.OverrideBy(envs)
}
if ro.Label != nil && len(ro.Label) > 0 {
if len(ro.Label) > 0 {
label := types.NewMappingWithEquals(ro.Label)
for k, v := range label {
if v != nil {
Expand All @@ -163,7 +163,7 @@ func (c *Composer) Run(ctx context.Context, ro RunOptions) error {
for k := range svcs {
svcs[k].Ports = []types.ServicePortConfig{}
}
if ro.Publish != nil && len(ro.Publish) > 0 {
if len(ro.Publish) > 0 {
for _, p := range ro.Publish {
pc, err := types.ParsePortConfig(p)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/containerutil/container_network_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (m *containerNetworkManager) VerifyNetworkOptions(_ context.Context) error
return errors.New("container networking mode is currently only supported on Linux")
}

if m.netOpts.NetworkSlice != nil && len(m.netOpts.NetworkSlice) > 1 {
if len(m.netOpts.NetworkSlice) > 1 {
return errors.New("conflicting options: only one network specification is allowed when using '--network=container:<container>'")
}

Expand Down

0 comments on commit 068866e

Please sign in to comment.