mirror of https://github.com/kubernetes/kops.git
Merge pull request #2172 from waldman/feature/issue-2171
Add AWS CloudConfig DisableSecurityGroupIngress Configuration Parameter
This commit is contained in:
commit
7ba283f5e3
|
|
@ -37,18 +37,28 @@ func (b *CloudConfigBuilder) Build(c *fi.ModelBuilderContext) error {
|
|||
// Add cloud config file if needed
|
||||
var lines []string
|
||||
|
||||
cloudProvider := b.Cluster.Spec.CloudProvider
|
||||
cloudConfig := b.Cluster.Spec.CloudConfig
|
||||
|
||||
if cloudConfig == nil {
|
||||
cloudConfig = &kops.CloudConfiguration{}
|
||||
}
|
||||
if cloudConfig.NodeTags != nil {
|
||||
lines = append(lines, "node-tags = "+*cloudConfig.NodeTags)
|
||||
}
|
||||
if cloudConfig.NodeInstancePrefix != nil {
|
||||
lines = append(lines, "node-instance-prefix = "+*cloudConfig.NodeInstancePrefix)
|
||||
}
|
||||
if cloudConfig.Multizone != nil {
|
||||
lines = append(lines, fmt.Sprintf("multizone = %t", *cloudConfig.Multizone))
|
||||
|
||||
switch cloudProvider {
|
||||
case "gce":
|
||||
if cloudConfig.NodeTags != nil {
|
||||
lines = append(lines, "node-tags = "+*cloudConfig.NodeTags)
|
||||
}
|
||||
if cloudConfig.NodeInstancePrefix != nil {
|
||||
lines = append(lines, "node-instance-prefix = "+*cloudConfig.NodeInstancePrefix)
|
||||
}
|
||||
if cloudConfig.Multizone != nil {
|
||||
lines = append(lines, fmt.Sprintf("multizone = %t", *cloudConfig.Multizone))
|
||||
}
|
||||
case "aws":
|
||||
if cloudConfig.DisableSecurityGroupIngress != nil {
|
||||
lines = append(lines, fmt.Sprintf("DisableSecurityGroupIngress = %t", *cloudConfig.DisableSecurityGroupIngress))
|
||||
}
|
||||
}
|
||||
|
||||
config := "[global]\n" + strings.Join(lines, "\n") + "\n"
|
||||
|
|
|
|||
|
|
@ -686,7 +686,9 @@ type LeaderElectionConfiguration struct {
|
|||
|
||||
type CloudConfiguration struct {
|
||||
// GCE cloud-config options
|
||||
Multizone *bool `json:"multizone,omitempty"`
|
||||
NodeTags *string `json:"nodeTags,omitempty"`
|
||||
NodeInstancePrefix *string `json:"nodeInstancePrefix,omitempty"`
|
||||
Multizone *bool `json:"multizone,omitempty"`
|
||||
NodeTags *string `json:"nodeTags,omitempty"`
|
||||
NodeInstancePrefix *string `json:"nodeInstancePrefix,omitempty"`
|
||||
// AWS cloud-config options
|
||||
DisableSecurityGroupIngress *bool `json:"disableSecurityGroupIngress,omitempty"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue