Skip to content

Commit d0e64a1

Browse files
deepaksibmhkantare
authored andcommitted
fix(VSI-Profile-patch): Remove validation for VSI profile patching
1 parent 1d5a276 commit d0e64a1

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

ibm/flex/structures.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,22 +2746,6 @@ func ResourceVolumeAttachmentValidate(diff *schema.ResourceDiff) error {
27462746
return nil
27472747
}
27482748

2749-
func InstanceProfileValidate(diff *schema.ResourceDiff) error {
2750-
if diff.Id() != "" && diff.HasChange("profile") {
2751-
o, n := diff.GetChange("profile")
2752-
old := o.(string)
2753-
new := n.(string)
2754-
log.Println("old profile : ", old)
2755-
log.Println("new profile : ", new)
2756-
if !strings.Contains(old, "d") && strings.Contains(new, "d") {
2757-
diff.ForceNew("profile")
2758-
} else if strings.Contains(old, "d") && !strings.Contains(new, "d") {
2759-
diff.ForceNew("profile")
2760-
}
2761-
}
2762-
return nil
2763-
}
2764-
27652749
func ResourceIPSecPolicyValidate(diff *schema.ResourceDiff) error {
27662750

27672751
newEncAlgo := diff.Get("encryption_algorithm").(string)

ibm/service/vpc/resource_ibm_is_instance.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,6 @@ func ResourceIBMISInstance() *schema.Resource {
174174
},
175175

176176
CustomizeDiff: customdiff.All(
177-
customdiff.Sequence(
178-
func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error {
179-
return flex.InstanceProfileValidate(diff)
180-
}),
181177
customdiff.Sequence(
182178
func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error {
183179
return flex.ResourceTagsCustomizeDiff(diff)

website/docs/r/is_instance.html.markdown

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,7 @@ Review the argument references that you can specify for your resource.
522522
When the `profile` is changed, the VSI is restarted. The new profile must:
523523
1. Have matching instance disk support. Any disks associated with the current profile will be deleted, and any disks associated with the requested profile will be created.
524524
2. Be compatible with any placement_target(`dedicated_host`, `dedicated_host_group`, `placement_group`) constraints. For example, if the instance is placed on a dedicated host, the requested profile family must be the same as the dedicated host family.
525-
526-
~> **NOTE**
527-
Changing a `profile` without disk to a `profile` with disk or vise versa will result in recreating(forcenew) the resource.
525+
528526
- `resource_group` - (Optional, Forces new resource, String) The ID of the resource group where you want to create the instance.
529527
- `instance_template` - (Optional, String) ID of the instance template to create the instance from. To create an instance template, use `ibm_is_instance_template` resource.
530528

0 commit comments

Comments
 (0)