Skip to content

Commit d03e32c

Browse files
committed
fix: correct typos and handle swallowed json.Marshal error
- Fix typo 'remobe' -> 'remove' in rootfs.go error message - Fix typo 'socker' -> 'socket' in create.go error message - Replace 'runc' with 'urunc' in user-facing strings - Handle swallowed json.Marshal error in firecracker.go Signed-off-by: vinayakjeet <vinayakjeetog@gmail.com>
1 parent f8ef37c commit d03e32c

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

cmd/urunc/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func createUnikontainer(cmd *cli.Command, uruncCfg *unikontainers.UruncConfig) (
183183
consoleSocket := cmd.String("console-socket")
184184
conn, err := net.Dial("unix", consoleSocket)
185185
if err != nil {
186-
err = fmt.Errorf("failed to dial console socker: %w", err)
186+
err = fmt.Errorf("failed to dial console socket: %w", err)
187187
return err
188188
}
189189
defer conn.Close()

cmd/urunc/delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ var deleteCommand = &cli.Command{
3333
Where "<container-id>" is the name for the instance of the container.
3434
3535
EXAMPLE:
36-
For example, if the container id is "ubuntu01" and runc list currently shows the
36+
For example, if the container id is "ubuntu01" and urunc list currently shows the
3737
status of "ubuntu01" as "stopped" the following will delete resources held for
38-
"ubuntu01" removing "ubuntu01" from the runc list of containers:
38+
"ubuntu01" removing "ubuntu01" from the urunc list of containers:
3939
4040
# urunc delete ubuntu01`,
4141
Flags: []cli.Flag{

cmd/urunc/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func main() {
8686
&cli.StringFlag{
8787
Name: "log",
8888
Value: "",
89-
Usage: "set the log file to write runc logs to (default is '/dev/stderr')",
89+
Usage: "set the log file to write urunc logs to (default is '/dev/stderr')",
9090
},
9191
&cli.StringFlag{
9292
Name: "log-format",

cmd/urunc/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ filesystem.
3636
The specification file includes an args parameter. The args parameter is used
3737
to specify command(s) that get run when the container is started. To change the
3838
command(s) that get executed on start, edit the args parameter of the spec. See
39-
"runc spec --help" for more explanation.`
39+
"urunc spec --help" for more explanation.`
4040

4141
var runCommand = &cli.Command{
4242
Name: "run",

pkg/unikontainers/hypervisors/firecracker.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ func (fc *Firecracker) BuildExecCmd(args types.ExecArgs, ukernel types.Unikernel
186186
NetIfs: FCNet,
187187
VSock: FCVSockDev,
188188
}
189-
FCConfigJSON, _ := json.Marshal(FCConfig)
190-
if err := os.WriteFile(JSONConfigFile, FCConfigJSON, 0o644); err != nil { //nolint: gosec
189+
FCConfigJSON, err := json.Marshal(FCConfig)
190+
if err != nil {
191+
return nil, fmt.Errorf("failed to marshal Firecracker config: %w", err)
192+
}
193+
if err = os.WriteFile(JSONConfigFile, FCConfigJSON, 0o644); err != nil { //nolint: gosec
191194
return nil, fmt.Errorf("failed to save Firecracker json config: %w", err)
192195
}
193196
vmmLog.WithField("Json", string(FCConfigJSON)).Debug("Firecracker json config")

pkg/unikontainers/rootfs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func pivotRootfs(newRoot string) error {
274274
// We no longer need the old rootfs
275275
err = os.RemoveAll("old_root")
276276
if err != nil {
277-
return fmt.Errorf("failed to remobe old_root: %w", err)
277+
return fmt.Errorf("failed to remove old_root: %w", err)
278278
}
279279

280280
return nil

0 commit comments

Comments
 (0)