Skip to content

Commit

Permalink
merge branch 'pr-124'
Browse files Browse the repository at this point in the history
LGTMs: @cyphar
Closes #124
  • Loading branch information
cyphar committed May 17, 2017
2 parents 0348467 + 2a8db49 commit 2827f27
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions oci/config/convert/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ import (
"github.com/pkg/errors"
)

// Annotations described by the OCI image-spec document (these represent fields
// in an image configuration that do not have a native representation in the
// runtime-spec).
const (
authorAnnotation = "org.opencontainers.image.author"
createdAnnotation = "org.opencontainers.image.created"
stopSignalAnnotation = "org.opencontainers.image.StopSignal"
authorAnnotation = "org.opencontainers.image.author"
createdAnnotation = "org.opencontainers.image.created"
stopSignalAnnotation = "org.opencontainers.image.StopSignal"
exposedPortsAnnotation = "org.opencontainers.image.exposedPorts"
)

// ToRuntimeSpec converts the given OCI image configuration to a runtime
Expand Down Expand Up @@ -149,7 +153,7 @@ func MutateRuntimeSpec(g rgen.Generator, rootfs string, image ispec.Image) error
ports = append(ports, port)
}
sort.Strings(ports)
g.AddAnnotation("org.opencontainers.image.exposedPorts", strings.Join(ports, ","))
g.AddAnnotation(exposedPortsAnnotation, strings.Join(ports, ","))

for vol := range image.Config.Volumes {
// XXX: This is _fine_ but might cause some issues in the future.
Expand Down

0 comments on commit 2827f27

Please sign in to comment.