Compare commits

...

14 Commits

Author SHA1 Message Date
Alex Crawford
cd1994b007 Merge pull request #403 from mdlayher/digitalocean_anchor_gateway
network: do not assign gateway for DigitalOcean anchor IP address
2015-10-27 09:10:34 -07:00
Matt Layher
1fd780befc network: do not assign gateway for DigitalOcean anchor IP address 2015-10-27 10:49:05 -04:00
Rob Szumski
8847a471c5 Merge pull request #393 from endocode/kayrus/vmware
Updated vmware info / Fixed help help message
2015-10-21 09:20:59 -07:00
kayrus
c0c144bd56 Added additional vmware info, fixed cli help 2015-10-19 10:33:27 +02:00
Alex Crawford
1d962916b9 Merge pull request #402 from xiang90/etcd2_wal
config: add wal_dir into etcd2.go
2015-10-15 12:29:49 -07:00
Xiang Li
bda6668f00 config: add wal_dir into etcd2.go 2015-10-15 09:36:48 -07:00
Alex Crawford
0f828db9a3 Merge pull request #401 from mischief/update-fleet-options
config: sync fleet options
2015-10-14 11:05:17 -07:00
Nick Owens
5970000589 config: sync fleet options 2015-10-14 11:02:59 -07:00
Alex Crawford
7870fa8c9d Merge pull request #399 from mdlayher/digitalocean_floatingip
datasource, network: add support for DigitalOcean floating IPs
2015-10-13 11:59:46 -07:00
Matt Layher
b4d45306b2 datasource, network: add support for DigitalOcean floating IPs 2015-10-09 10:52:05 -04:00
Michael Marineau
3c2b5e6636 Merge pull request #398 from marineam/gomax
main: default to GOMAXPROCS=1
2015-09-30 20:43:03 -07:00
Michael Marineau
bf743b3060 main: default to GOMAXPROCS=1 2015-09-30 17:23:40 -07:00
Jonathan Boulle
3b98be7788 Merge pull request #396 from crawford/bugs
readme: add link to coreos/bugs
2015-09-24 19:44:48 -07:00
Alex Crawford
746685023f readme: add link to coreos/bugs 2015-09-24 17:50:06 -07:00
10 changed files with 126 additions and 9 deletions

View File

@@ -9,8 +9,13 @@ Location | Description
|Kernel command line: `cloud-config-url=http://example.com/user_data`.| You can find this string using this command `cat /proc/cmdline`. Usually used in [PXE](/os/docs/latest/booting-with-pxe.html) or [iPXE](/os/docs/latest/booting-with-ipxe.html) boots.|
|`/var/lib/coreos-install/user_data`| When you install CoreOS manually using the [coreos-install](/os/docs/latest/installing-to-disk.html) tool. Usually used in bare metal installations.|
|`/usr/share/oem/cloud-config.yml`| Path for OEM images.|
|`/var/lib/coreos-vagrant/vagrantfile-user-data`| Vagrant OEM scripts automatically store Cloud-Config into this path. |
|`/var/lib/waagent/CustomData`| Azure platform uses OEM path for first Cloud-Config initialization and then `/var/lib/waagent/CustomData` to apply your settings.|
|`http://169.254.169.254/metadata/v1/user-data` `http://169.254.169.254/2009-04-04/user-data` `https://metadata.packet.net/userdata`|DigitalOcean, EC2 and Packet cloud providers correspondingly use these URLs to download Cloud-Config.|
|`/usr/share/oem/bin/vmtoolsd --cmd "info-get guestinfo.coreos.config.data"`|Cloud-Config provided by [VMware Backdoor][VMware Backdoor]|
|`/usr/share/oem/bin/vmtoolsd --cmd "info-get guestinfo.coreos.config.url"`|Cloud-Config URL provided by [VMware Backdoor][VMware Backdoor]|
[VMware Backdoor]: vmware-backdoor.md
You can also run the `coreos-cloudinit` tool manually and provide a path to your custom Cloud-Config file:

View File

@@ -1,7 +1,9 @@
# VMware Backdoor #
# VMware Backdoor
## Cloud-Config Options List
coreos-cloudinit is capable of reading userdata and metadata from the VMware
backdoor. This datasource can be enable with the `--from-vmware-backdoor` flag.
backdoor. This datasource can be enabled with the `--from-vmware-backdoor` flag.
Userdata and metadata are passed from the hypervisor to the virtual machine
through guest variables. The following guest variables and their expected types
are supported by coreos-cloudinit:
@@ -24,3 +26,7 @@ are supported by coreos-cloudinit:
Note: "n", "m", "l", and "x" are 0-indexed, incrementing integers. The
identifier for the interfaces does not correspond to anything outside of this
configuration; it is merely for mapping configuration values to each interface.
Please refer to [link][vmware] to know more how to run CoreOS on VMware.
[vmware]: https://github.com/coreos/docs/blob/master/os/booting-on-vmware.md

View File

@@ -76,4 +76,11 @@ coreos:
etcd:
addr: 203.0.113.29:4001
peer-addr: 192.0.2.13:7001
```
```
## Bugs
Please use the [CoreOS issue tracker][bugs] to report all bugs, issues, and feature requests.
[bugs]: https://github.com/coreos/bugs/issues/new?labels=component/cloud-init

View File

@@ -53,4 +53,5 @@ type Etcd2 struct {
ProxyWriteTimeout int `yaml:"proxy_write_timeout" env:"ETCD_PROXY_WRITE_TIMEOUT"`
SnapshotCount int `yaml:"snapshot_count" env:"ETCD_SNAPSHOT_COUNT"`
TrustedCAFile string `yaml:"trusted_ca_file" env:"ETCD_TRUSTED_CA_FILE"`
WalDir string `yaml:"wal_dir" env:"ETCD_WAL_DIR"`
}

View File

@@ -16,6 +16,8 @@ package config
type Fleet struct {
AgentTTL string `yaml:"agent_ttl" env:"FLEET_AGENT_TTL"`
AuthorizedKeysFile string `yaml:"authorized_keys_file" env:"FLEET_AUTHORIZED_KEYS_FILE"`
DisableEngine bool `yaml:"disable_engine" env:"FLEET_DISABLE_ENGINE"`
EngineReconcileInterval float64 `yaml:"engine_reconcile_interval" env:"FLEET_ENGINE_RECONCILE_INTERVAL"`
EtcdCAFile string `yaml:"etcd_cafile" env:"FLEET_ETCD_CAFILE"`
EtcdCertFile string `yaml:"etcd_certfile" env:"FLEET_ETCD_CERTFILE"`
@@ -25,5 +27,7 @@ type Fleet struct {
EtcdServers string `yaml:"etcd_servers" env:"FLEET_ETCD_SERVERS"`
Metadata string `yaml:"metadata" env:"FLEET_METADATA"`
PublicIP string `yaml:"public_ip" env:"FLEET_PUBLIC_IP"`
TokenLimit int `yaml:"token_limit" env:"FLEET_TOKEN_LIMIT"`
Verbosity int `yaml:"verbosity" env:"FLEET_VERBOSITY"`
VerifyUnits bool `yaml:"verify_units" env:"FLEET_VERIFY_UNITS"`
}

View File

@@ -19,6 +19,7 @@ import (
"fmt"
"log"
"os"
"runtime"
"sync"
"time"
@@ -129,6 +130,12 @@ var (
func main() {
failure := false
// Conservative Go 1.5 upgrade strategy:
// keep GOMAXPROCS' default at 1 for now.
if os.Getenv("GOMAXPROCS") == "" {
runtime.GOMAXPROCS(1)
}
flag.Parse()
if c, ok := oemConfigs[flags.oem]; ok {
@@ -162,7 +169,7 @@ func main() {
dss := getDatasources()
if len(dss) == 0 {
fmt.Println("Provide at least one of --from-file, --from-configdrive, --from-ec2-metadata, --from-cloudsigma-metadata, --from-packet-metadata, --from-url or --from-proc-cmdline")
fmt.Println("Provide at least one of --from-file, --from-configdrive, --from-ec2-metadata, --from-cloudsigma-metadata, --from-packet-metadata, --from-vmware-backdoor, --from-digitalocean-metadata, --from-vmware-backdoor, --from-waagent, --from-url or --from-proc-cmdline")
os.Exit(2)
}

View File

@@ -38,10 +38,11 @@ type Address struct {
}
type Interface struct {
IPv4 *Address `json:"ipv4"`
IPv6 *Address `json:"ipv6"`
MAC string `json:"mac"`
Type string `json:"type"`
IPv4 *Address `json:"ipv4"`
IPv6 *Address `json:"ipv6"`
AnchorIPv4 *Address `json:"anchor_ipv4"`
MAC string `json:"mac"`
Type string `json:"type"`
}
type Interfaces struct {

View File

@@ -126,6 +126,28 @@ func parseInterface(iface digitalocean.Interface, nameservers []net.IP, useRoute
})
}
}
if iface.AnchorIPv4 != nil {
var ip, mask net.IP
if ip = net.ParseIP(iface.AnchorIPv4.IPAddress); ip == nil {
return nil, fmt.Errorf("could not parse %q as anchor IPv4 address", iface.AnchorIPv4.IPAddress)
}
if mask = net.ParseIP(iface.AnchorIPv4.Netmask); mask == nil {
return nil, fmt.Errorf("could not parse %q as anchor IPv4 mask", iface.AnchorIPv4.Netmask)
}
addresses = append(addresses, net.IPNet{
IP: ip,
Mask: net.IPMask(mask),
})
if useRoute {
routes = append(routes, route{
destination: net.IPNet{
IP: net.IPv4zero,
Mask: net.IPMask(net.IPv4zero),
},
})
}
}
hwaddr, err := net.ParseMAC(iface.MAC)
if err != nil {

View File

@@ -258,6 +258,70 @@ func TestParseInterface(t *testing.T) {
},
},
},
{
cfg: digitalocean.Interface{
MAC: "01:23:45:67:89:AB",
AnchorIPv4: &digitalocean.Address{
IPAddress: "bad",
Netmask: "255.255.0.0",
},
},
nss: []net.IP{},
err: errors.New("could not parse \"bad\" as anchor IPv4 address"),
},
{
cfg: digitalocean.Interface{
MAC: "01:23:45:67:89:AB",
AnchorIPv4: &digitalocean.Address{
IPAddress: "1.2.3.4",
Netmask: "bad",
},
},
nss: []net.IP{},
err: errors.New("could not parse \"bad\" as anchor IPv4 mask"),
},
{
cfg: digitalocean.Interface{
MAC: "01:23:45:67:89:AB",
IPv4: &digitalocean.Address{
IPAddress: "1.2.3.4",
Netmask: "255.255.0.0",
Gateway: "5.6.7.8",
},
AnchorIPv4: &digitalocean.Address{
IPAddress: "7.8.9.10",
Netmask: "255.255.0.0",
},
},
useRoute: true,
nss: []net.IP{},
iface: &logicalInterface{
hwaddr: net.HardwareAddr([]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab}),
config: configMethodStatic{
addresses: []net.IPNet{
{
IP: net.ParseIP("1.2.3.4"),
Mask: net.IPMask(net.ParseIP("255.255.0.0")),
},
{
IP: net.ParseIP("7.8.9.10"),
Mask: net.IPMask(net.ParseIP("255.255.0.0")),
},
},
nameservers: []net.IP{},
routes: []route{
{
destination: net.IPNet{IP: net.IPv4zero, Mask: net.IPMask(net.IPv4zero)},
gateway: net.ParseIP("5.6.7.8"),
},
{
destination: net.IPNet{IP: net.IPv4zero, Mask: net.IPMask(net.IPv4zero)},
},
},
},
},
},
} {
iface, err := parseInterface(tt.cfg, tt.nss, tt.useRoute)
if !errorsEqual(tt.err, err) {

2
test
View File

@@ -31,7 +31,7 @@ gofmt -d -e $SRC
# split SRC into an array and prepend REPO_PATH to each local package for go vet
split_vet=(${SRC// / })
VET_TEST=${split_vet[@]/#/${REPO_PATH}/}
VET_TEST="${REPO_PATH} ${split_vet[@]/#/${REPO_PATH}/}"
echo "Checking govet..."
go vet $VET_TEST