Skip to content

Commit

Permalink
Merge branch 'devel' into devel_29092023
Browse files Browse the repository at this point in the history
  • Loading branch information
RavinderReddyF5 committed Sep 29, 2023
2 parents 72c12b6 + 644d868 commit 7cec485
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions bigip/resource_bigip_ltm_cipher_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func resourceBigipLtmCipherGroup() *schema.Resource {
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Description: "Specifies the configuration of the restrict groups of ciphers. You can select a cipher rule from the Available Cipher Rules list",
},
},

Check failure on line 61 in bigip/resource_bigip_ltm_cipher_group.go

View workflow job for this annotation

GitHub Actions / golint

File is not `gofmt`-ed with `-s` (gofmt)
},
}
}
Expand Down Expand Up @@ -106,7 +106,6 @@ func resourceBigipLtmCipherGroupRead(ctx context.Context, d *schema.ResourceData
client := meta.(*bigip.BigIP)
name := d.Id()
log.Printf("[INFO] Fetching Cipher group :%+v", name)

cipherGroup, err := client.GetLtmCipherGroup(name)
if err != nil {
log.Printf("[ERROR] Unable to retrieve cipher group %s %v :", name, err)
Expand All @@ -124,7 +123,6 @@ func resourceBigipLtmCipherGroupUpdate(ctx context.Context, d *schema.ResourceDa
cipherGrouptmp := &bigip.CipherGroupReq{}
cipherGrouptmp.Name = name
cipherGroupconfig := getCipherGroupConfig(d, cipherGrouptmp)

if err := client.ModifyLtmCipherGroup(name, cipherGroupconfig); err != nil {
return diag.FromErr(fmt.Errorf("error modifying cipher group %s: %v", name, err))
}
Expand All @@ -147,6 +145,7 @@ func resourceBigipLtmCipherGroupDelete(ctx context.Context, d *schema.ResourceDa
return nil
}


func getCipherGroupConfig(d *schema.ResourceData, cipherGroup *bigip.CipherGroupReq) *bigip.CipherGroupReq {
cipherGroup.Ordering = d.Get("ordering").(string)
if p, ok := d.GetOk("allow"); ok {
Expand All @@ -158,6 +157,6 @@ func getCipherGroupConfig(d *schema.ResourceData, cipherGroup *bigip.CipherGroup
for _, r := range p.(*schema.Set).List() {
cipherGroup.Require = append(cipherGroup.Require, r.(string))
}
}
return cipherGroup
}
return cipherGroup
}
5 changes: 3 additions & 2 deletions bigip/resource_bigip_ltm_cipher_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func resourceBigipLtmCipherRuleCreate(ctx context.Context, d *schema.ResourceDat

cipherRuletmp := &bigip.CipherRuleReq{}
cipherRuletmp.Name = name

cipherRule := getCipherRuleConfig(d, cipherRuletmp)

log.Printf("[INFO] cipherRule config :%+v", cipherRule)
Expand Down Expand Up @@ -117,14 +118,13 @@ func resourceBigipLtmCipherRuleRead(ctx context.Context, d *schema.ResourceData,

func resourceBigipLtmCipherRuleUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
client := meta.(*bigip.BigIP)

name := d.Id()
cipherRuletmp := &bigip.CipherRuleReq{}
cipherRuletmp.Name = name
cipheRuleconfig := getCipherRuleConfig(d, cipherRuletmp)
if err := client.ModifyLtmCipherRule(name, cipheRuleconfig); err != nil {
return diag.FromErr(fmt.Errorf("error modifying cipher rule %s: %v", name, err))
}
}

Check failure on line 127 in bigip/resource_bigip_ltm_cipher_rule.go

View workflow job for this annotation

GitHub Actions / golint

File is not `gofmt`-ed with `-s` (gofmt)
return resourceBigipLtmCipherRuleRead(ctx, d, meta)
}

Expand All @@ -140,6 +140,7 @@ func resourceBigipLtmCipherRuleDelete(ctx context.Context, d *schema.ResourceDat
d.SetId("")
return nil
}

func getCipherRuleConfig(d *schema.ResourceData, cipherRule *bigip.CipherRuleReq) *bigip.CipherRuleReq {
cipherRule.Cipher = d.Get("cipher").(string)
cipherRule.DhGroups = d.Get("dh_groups").(string)
Expand Down

0 comments on commit 7cec485

Please sign in to comment.