Skip to content

Commit 949c60c

Browse files
fixing host gen file
1 parent 97f8b01 commit 949c60c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/container_runtime/host.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package runtime
33
import (
44
"fmt"
55
"os"
6+
"strings"
67

78
"container-registry.com/harbor-satellite/internal/config"
89
"container-registry.com/harbor-satellite/internal/utils"
@@ -92,6 +93,9 @@ func GenerateContainerdHostConfig(containerdCertPath, genPath string, log *zerol
9293
pathTOWrite := fmt.Sprintf("%s/%s", mirrorGenPath, HostToml)
9394
log.Info().Msgf("Writing the host.toml file at path: %s", pathTOWrite)
9495
hostData, err := toml.Marshal(dockerContainerdHostConfig)
96+
hostStr := string(hostData)
97+
hostStr = strings.Replace(hostStr, "[host]\n", "", 1)
98+
hostData = []byte(hostStr)
9599
if err != nil {
96100
log.Err(err).Msg("Error marshalling the host.toml file")
97101
return fmt.Errorf("error marshalling the host.toml file: %v", err)

0 commit comments

Comments
 (0)