Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
  • Loading branch information
apostasie authored and Shubhranshu153 committed Sep 9, 2024
1 parent 2df0c94 commit 02d73cc
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 @@ -127,7 +127,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 := loader.ParseVolume(v)
if err != nil {
Expand All @@ -136,15 +136,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 @@ -161,7 +161,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 @@ -195,7 +195,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 02d73cc

Please # to comment.