Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

{{ $plugin := flag "instance-plugin" "string" "Name of plugin" | prompt "What instance plugin to target?" "string" "instance-hyperkit" }}

infrakit instance --name {{ $plugin }} describe -q | awk '{print $1}' | xargs infrakit instance --name {{ $plugin }} destroy
infrakit {{ $plugin }} describe -q | awk '{print $1}' | xargs infrakit instance --name {{ $plugin }} destroy
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{/* =% sh %= */}}

infrakit instance --name instance-hyperkit describe
infrakit instance-hyperkit describe
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

{{ $plugin := flag "instance-plugin" "string" "Name of plugin" | prompt "What instance plugin to target?" "string" "instance-packet" }}

infrakit instance --name {{ $plugin }} describe -q | awk '{print $1}' | xargs infrakit instance --name {{ $plugin }} destroy
infrakit {{ $plugin }} describe -q | awk '{print $1}' | xargs infrakit instance --name {{ $plugin }} destroy
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{/* =% sh %= */}}

infrakit instance --name instance-packet describe
infrakit instance-packet describe
4 changes: 2 additions & 2 deletions docs/playbooks/linuxkit/examples/sshd/packet/scale-group.ikt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
facility: {{ $facility }}
operating_system: custom_ipxe
billing_cycle: hourly
hostname_prefix: infrakit-{{ $groupName }}
checksum: {{ $checksum }}
userdata: |
#!ipxe

Expand All @@ -42,5 +44,3 @@
kernel ${base-url}/{{$bundle}}-kernel ${kernel-params}
initrd ${base-url}/{{$bundle}}-initrd.img
boot
hostname_prefix: infrakit-demo
checksum: {{ $checksum }}
4 changes: 2 additions & 2 deletions docs/playbooks/linuxkit/start-infrakit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ docker run -d --volumes-from infrakit --name manager \
echo "Updating hosts file"
{{ $hostsFile := list (env `INFRAKIT_HOME`) `/hosts` | join `` }}
{{ $hosts := include (list `file://` $hostsFile | join ``) | yamlDecode }}
{{ $_ := set $hosts `localhost` (list `localhost` $port | join `:`) }}
{{ $_ := set $hosts `docker4mac` (list `localhost` $port | join `:`) }}
echo "{{ $hosts | yamlEncode }}" > {{ $hostsFile }}
echo "Updated hosts file. You are using the host `localhost` as defined in your hosts file in INFRAKIT_HOME/hosts"
echo "Updated hosts file. You are using the remote `docker4mac` as defined in your hosts file in INFRAKIT_HOME/hosts"

echo "Started hyperkit: {{ var `started-hyperkit` }}"
echo "Started gcp: {{ var `started-gcp` }}"
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ func getPluginObjects(hs rpc.Handshaker, major string) map[string][]spi.Interfac
// The spi this object implements (e.g. Instance/0.5.0)
spis, err := hs.Implements()
if err != nil {
log.Warn("error getting interface", "name", major, "err", err)
log.Debug("error getting interface", "name", major, "err", err)
return objects
}

// For each spi, eg. Instance/0.5.0 a list of object names
typesBySpi, err := hs.Types()
if err != nil {
log.Warn("error getting typed objects in this plugin", "name", major, "err", err)
log.Debug("error getting typed objects in this plugin", "name", major, "err", err)

// Here we assume there are no lower level objects
objects[major] = spis
Expand Down Expand Up @@ -108,7 +108,7 @@ func LoadAll(services *Services) ([]*cobra.Command, error) {
for major, entry := range running {
hs, err := client.NewHandshaker(entry.Address)
if err != nil {
log.Warn("handshaker error", "err", err, "addr", entry.Address)
log.Debug("handshaker error", "err", err, "addr", entry.Address)
continue
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ loop:
moduleURL = SourceURL(u.String())

} else {
log.Warn("cannot resolve", "op", op, "url", moduleURL, "parent", parentURL)
log.Debug("cannot resolve", "op", op, "url", moduleURL, "parent", parentURL)
continue loop
}
}
Expand All @@ -142,7 +142,7 @@ loop:
copy := moduleURL
subs, err := list(plugins, mods, input, cmd, &copy)
if err != nil {
log.Warn("cannot list", "op", op, "url", moduleURL, "err", err)
log.Debug("cannot list", "op", op, "url", moduleURL, "err", err)
continue loop
}
for _, sub := range subs {
Expand All @@ -158,7 +158,7 @@ loop:
}
err := ctx.BuildFlags()
if err != nil {
log.Warn("cannot build flags", "op", op, "url", moduleURL, "err", err)
log.Debug("cannot build flags", "op", op, "url", moduleURL, "err", err)
continue loop
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/instance/packet/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/packethost/packngo"
)

var log = logutil.New("module", "plugin/instance/packetnet")
var log = logutil.New("module", "plugin/instance/packet")

func init() {
rand.Seed(time.Now().UTC().UnixNano())
Expand Down
4 changes: 4 additions & 0 deletions pkg/template/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func doHTTPGet(u *url.URL, customize func(*http.Request), client *http.Client) (
if err != nil {
return nil, err
}

if resp.StatusCode != http.StatusOK {
return []byte{}, fmt.Errorf("error %s", resp.Status)
}
defer resp.Body.Close()
return ioutil.ReadAll(resp.Body)
}
Expand Down