Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/exec/stages/disks/disks.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
)

const (
name = "disks"
Name = "disks"
)

func init() {
Expand All @@ -52,7 +52,7 @@ func (creator) Create(logger *log.Logger, root string, f resource.Fetcher) stage
}

func (creator) Name() string {
return name
return Name
}

type stage struct {
Expand All @@ -62,7 +62,7 @@ type stage struct {
}

func (stage) Name() string {
return name
return Name
}

func (s stage) Run(config types.Config) error {
Expand Down
8 changes: 4 additions & 4 deletions internal/exec/stages/fetch/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// arrays, formatting partitions, writing files, writing systemd units, and
// writing network units.

package disks
package fetch

import (
"github.com/coreos/ignition/v2/config/v3_1_experimental/types"
Expand All @@ -27,7 +27,7 @@ import (
)

const (
name = "fetch"
Name = "fetch"
)

func init() {
Expand All @@ -46,15 +46,15 @@ func (creator) Create(logger *log.Logger, root string, _ resource.Fetcher) stage
}

func (creator) Name() string {
return name
return Name
}

type stage struct {
util.Util
}

func (stage) Name() string {
return name
return Name
}

func (s stage) Run(_ types.Config) error {
Expand Down
6 changes: 3 additions & 3 deletions internal/exec/stages/files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

const (
name = "files"
Name = "files"
)

var (
Expand All @@ -52,7 +52,7 @@ func (creator) Create(logger *log.Logger, root string, f resource.Fetcher) stage
}

func (creator) Name() string {
return name
return Name
}

type stage struct {
Expand All @@ -61,7 +61,7 @@ type stage struct {
}

func (stage) Name() string {
return name
return Name
}

func (s stage) Run(config types.Config) error {
Expand Down
8 changes: 4 additions & 4 deletions internal/exec/stages/mount/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// arrays, formatting partitions, writing files, writing systemd units, and
// writing network units.

package disks
package mount

import (
"fmt"
Expand All @@ -35,7 +35,7 @@ import (
)

const (
name = "mount"
Name = "mount"
)

func init() {
Expand All @@ -54,15 +54,15 @@ func (creator) Create(logger *log.Logger, root string, f resource.Fetcher) stage
}

func (creator) Name() string {
return name
return Name
}

type stage struct {
util.Util
}

func (stage) Name() string {
return name
return Name
}

func (s stage) Run(config types.Config) error {
Expand Down
8 changes: 4 additions & 4 deletions internal/exec/stages/umount/umount.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// arrays, formatting partitions, writing files, writing systemd units, and
// writing network units.

package disks
package umount

import (
"sort"
Expand All @@ -31,7 +31,7 @@ import (
)

const (
name = "umount"
Name = "umount"
)

func init() {
Expand All @@ -50,15 +50,15 @@ func (creator) Create(logger *log.Logger, root string, f resource.Fetcher) stage
}

func (creator) Name() string {
return name
return Name
}

type stage struct {
util.Util
}

func (stage) Name() string {
return name
return Name
}

func (s stage) Run(config types.Config) error {
Expand Down
8 changes: 8 additions & 0 deletions internal/providers/packet/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"strings"

"github.com/coreos/ignition/v2/config/v3_1_experimental/types"
"github.com/coreos/ignition/v2/internal/exec/stages/umount"
"github.com/coreos/ignition/v2/internal/providers/util"
"github.com/coreos/ignition/v2/internal/resource"

Expand Down Expand Up @@ -69,6 +70,13 @@ func FetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {

// PostStatus posts a message that will show on the Packet Instance Timeline
func PostStatus(stageName string, f resource.Fetcher, errMsg error) error {
if stageName == umount.Name {
// Don't report umount status. It's unlikely to fail as a
// result of anything in the config, and ignition-dracut
// may have already torn down networking.
return nil
}

f.Logger.Info("POST message to Packet Timeline")
// fetch JSON from https://metadata.packet.net/metadata
headers := make(http.Header)
Expand Down