@@ -631,6 +631,7 @@ func (p *Provider) Sync(name string) error {
631
631
632
632
func (p * Provider ) SystemUpdate (opts structs.SystemUpdateOptions ) error {
633
633
changes := map [string ]string {}
634
+ hasOtherChange := false
634
635
635
636
// carry forward values from original custom topic resources
636
637
params := map [string ]string {
@@ -646,21 +647,25 @@ func (p *Provider) SystemUpdate(opts structs.SystemUpdateOptions) error {
646
647
for k , v := range opts .Parameters {
647
648
params [k ] = v
648
649
}
650
+ hasOtherChange = true
649
651
}
650
652
651
653
if v , has := params ["WhiteList" ]; has {
652
654
p .WhiteListSpecified = len (v ) > 0
653
655
p .SyncInstancesIpInSecurityGroup ()
656
+ hasOtherChange = true
654
657
}
655
658
656
659
if opts .Count != nil {
657
660
params ["InstanceCount" ] = strconv .Itoa (* opts .Count )
658
661
changes ["count" ] = strconv .Itoa (* opts .Count )
662
+ hasOtherChange = true
659
663
}
660
664
661
665
if opts .Type != nil {
662
666
params ["InstanceType" ] = * opts .Type
663
667
changes ["type" ] = * opts .Type
668
+ hasOtherChange = true
664
669
}
665
670
666
671
var template []byte
@@ -695,6 +700,17 @@ func (p *Provider) SystemUpdate(opts structs.SystemUpdateOptions) error {
695
700
696
701
// if there is a version update then record it
697
702
if v , ok := changes ["version" ]; ok {
703
+ if ! hasOtherChange {
704
+ rDetails , err := p .SystemGet ()
705
+ if err != nil {
706
+ return err
707
+ }
708
+
709
+ // check rack already in that version or not
710
+ if rDetails .Version == v {
711
+ return nil
712
+ }
713
+ }
698
714
_ , err := p .dynamodb ().PutItem (& dynamodb.PutItemInput {
699
715
Item : map [string ]* dynamodb.AttributeValue {
700
716
"id" : {S : aws .String (v )},
0 commit comments