Skip to content

Commit

Permalink
Merge pull request #6941 from drekle/openstack_subnet_member_comparison
Browse files Browse the repository at this point in the history
Subnet Update Consistency
  • Loading branch information
k8s-ci-robot authored May 13, 2019
2 parents ddddeac + 59fb887 commit 5ad4272
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions pkg/model/openstackmodel/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
for _, sp := range b.Cluster.Spec.Subnets {
subnetName := sp.Name + "." + b.ClusterName()
t := &openstacktasks.Subnet{
Name: s(subnetName),
Network: b.LinkToNetwork(),
CIDR: s(sp.CIDR),
Lifecycle: b.Lifecycle,
Name: s(subnetName),
Network: b.LinkToNetwork(),
CIDR: s(sp.CIDR),
DNSServers: make([]*string, 0),
Lifecycle: b.Lifecycle,
}
if b.Cluster.Spec.CloudConfig.Openstack.Router.DNSServers != nil {
dnsSplitted := strings.Split(fi.StringValue(b.Cluster.Spec.CloudConfig.Openstack.Router.DNSServers), ",")
Expand Down
6 changes: 3 additions & 3 deletions upup/pkg/fi/cloudup/openstacktasks/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ func (_ *Subnet) CheckChanges(a, e, changes *Subnet) error {
if changes.Name != nil {
return fi.CannotChangeField("Name")
}
if e.DNSServers != nil {
if changes.DNSServers != nil {
return fi.CannotChangeField("DNSServers")
}
if e.Network != nil {
if changes.Network != nil {
return fi.CannotChangeField("Network")
}
if e.CIDR != nil {
if changes.CIDR != nil {
return fi.CannotChangeField("CIDR")
}
}
Expand Down

0 comments on commit 5ad4272

Please sign in to comment.