mirror of https://github.com/kubernetes/kops.git
kops-change-main
This commit is contained in:
parent
ebb111d23a
commit
3273e55c0d
|
|
@ -37,27 +37,21 @@ const (
|
|||
func main() {
|
||||
klog.InitFlags(nil)
|
||||
|
||||
gitVersion := ""
|
||||
var flagConf, flagCacheDir, flagRootFS, gitVersion string
|
||||
var flagRetries int
|
||||
var dryrun, installSystemdUnit bool
|
||||
target := "direct"
|
||||
|
||||
if kops.GitVersion != "" {
|
||||
gitVersion = fmt.Sprintf(" (git-%s)", kops.GitVersion)
|
||||
}
|
||||
fmt.Printf("nodeup version %s%s\n", kops.Version, gitVersion)
|
||||
|
||||
var flagConf string
|
||||
flag.StringVar(&flagConf, "conf", "node.yaml", "configuration location")
|
||||
var flagCacheDir string
|
||||
flag.StringVar(&flagCacheDir, "cache", "/var/cache/nodeup", "the location for the local asset cache")
|
||||
var flagRootFS string
|
||||
flag.StringVar(&flagRootFS, "rootfs", "/", "the location of the machine root (for running in a container)")
|
||||
var flagRetries int
|
||||
flag.IntVar(&flagRetries, "retries", -1, "maximum number of retries on failure: -1 means retry forever")
|
||||
|
||||
dryrun := false
|
||||
flag.BoolVar(&dryrun, "dryrun", false, "Don't create cloud resources; just show what would be done")
|
||||
target := "direct"
|
||||
flag.StringVar(&target, "target", target, "Target - direct, cloudinit")
|
||||
|
||||
installSystemdUnit := false
|
||||
flag.BoolVar(&installSystemdUnit, "install-systemd-unit", installSystemdUnit, "If true, will install a systemd unit instead of running directly")
|
||||
|
||||
if dryrun {
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ import (
|
|||
|
||||
// FindSubnet returns the subnet with the specified name, or returns nil
|
||||
func FindSubnet(c *kops.Cluster, subnetName string) *kops.ClusterSubnetSpec {
|
||||
for i := range c.Spec.Subnets {
|
||||
if c.Spec.Subnets[i].Name == subnetName {
|
||||
return &c.Spec.Subnets[i]
|
||||
for _, subnet := range c.Spec.Subnets {
|
||||
if subnet.Name == subnetName {
|
||||
return &subnet
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue