mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 08:33:04 +02:00
things are working now
This commit is contained in:
@@ -11,7 +11,7 @@ type ExposeCommand struct {
|
||||
}
|
||||
|
||||
func (r *ExposeCommand) ExecuteCommand(config *manifest.Schema2Config) error {
|
||||
return updateExposedPorts(r.Ports, config)
|
||||
return updateExposedPorts(r.cmd.Ports, config)
|
||||
}
|
||||
|
||||
func updateExposedPorts(ports []string, config *manifest.Schema2Config) error {
|
||||
@@ -24,7 +24,8 @@ func updateExposedPorts(ports []string, config *manifest.Schema2Config) error {
|
||||
if !strings.Contains(p, "/") {
|
||||
p = p + "/tcp"
|
||||
}
|
||||
existingPorts[p] = {}
|
||||
var x struct{}
|
||||
existingPorts[manifest.Schema2Port(p)] = x
|
||||
}
|
||||
config.ExposedPorts = existingPorts
|
||||
return nil
|
||||
@@ -36,5 +37,5 @@ func (r *ExposeCommand) FilesToSnapshot() []string {
|
||||
|
||||
func (r *ExposeCommand) CreatedBy() string {
|
||||
s := []string{"/bin/sh", "-c"}
|
||||
return strings.Join(append(s, r.Ports...), " ")
|
||||
return strings.Join(append(s, r.cmd.Ports...), " ")
|
||||
}
|
||||
|
||||
@@ -17,12 +17,14 @@ func TestUpdateExposedPorts(t *testing.T) {
|
||||
"8080",
|
||||
"8081/tcp",
|
||||
"8082",
|
||||
"8083/udp",
|
||||
}
|
||||
|
||||
expectedPorts := manifest.Schema2PortSet{
|
||||
"8080/tcp": {},
|
||||
"8081/tcp": {},
|
||||
"8082/tcp": {},
|
||||
"8083/udp": {},
|
||||
}
|
||||
|
||||
updateExposedPorts(ports, cfg)
|
||||
|
||||
Reference in New Issue
Block a user