Skip to content

Commit

Permalink
remove defaults for image cleaner parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
stephybun committed Mar 18, 2024
1 parent cbc78f7 commit c3d3a5a
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions internal/services/containers/kubernetes_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,11 @@ func resourceKubernetesCluster() *pluginsdk.Resource {
"image_cleaner_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
Default: false,
},

"image_cleaner_interval_hours": {
Type: pluginsdk.TypeInt,
Optional: true,
Default: 48,
ValidateFunc: validation.IntBetween(24, 2160),
},

Expand Down Expand Up @@ -1578,6 +1576,17 @@ func resourceKubernetesCluster() *pluginsdk.Resource {
Sensitive: true,
ValidateFunc: validation.StringLenBetween(8, 123),
}
resource.Schema["image_cleaner_enabled"] = &pluginsdk.Schema{
Type: pluginsdk.TypeBool,
Optional: true,
Default: false,
}
resource.Schema["image_cleaner_interval_hours"] = &pluginsdk.Schema{
Type: pluginsdk.TypeInt,
Optional: true,
Default: 48,
ValidateFunc: validation.IntBetween(24, 2160),
}
}

return resource
Expand Down Expand Up @@ -1714,9 +1723,11 @@ func resourceKubernetesClusterCreate(d *pluginsdk.ResourceData, meta interface{}
}
}

securityProfile.ImageCleaner = &managedclusters.ManagedClusterSecurityProfileImageCleaner{
Enabled: utils.Bool(d.Get("image_cleaner_enabled").(bool)),
IntervalHours: utils.Int64(int64(d.Get("image_cleaner_interval_hours").(int))),
if d.Get("image_cleaner_enabled").(bool) {
securityProfile.ImageCleaner = &managedclusters.ManagedClusterSecurityProfileImageCleaner{
Enabled: utils.Bool(d.Get("image_cleaner_enabled").(bool)),
IntervalHours: utils.Int64(int64(d.Get("image_cleaner_interval_hours").(int))),
}
}

azureKeyVaultKmsRaw := d.Get("key_management_service").([]interface{})
Expand Down

0 comments on commit c3d3a5a

Please sign in to comment.