Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLT-690: Fixed add-on deployment for cluster day2 operations #348

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions spectrocloud/cluster_common_profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,21 @@ func toProfiles(c *client.V1Client, d *schema.ResourceData, clusterContext strin
}

func toAddonDeplProfiles(c *client.V1Client, d *schema.ResourceData) ([]*models.V1SpectroClusterProfileEntity, error) {
clusterUid := d.Get("cluster_uid").(string)
clusterContext := d.Get("cluster_context").(string)
clusterUid := ""
clusterContext := ""
// handling cluster attachment flow for cluster created outside terraform and attaching addon profile to it
if uid, ok := d.GetOk("cluster_uid"); ok && uid != nil {
clusterUid = uid.(string) //d.Get("cluster_uid").(string)
}
if ct, ok := d.GetOk("cluster_context"); ok && c != nil {
clusterUid = ct.(string) //d.Get("cluster_context").(string)
SivaanandM marked this conversation as resolved.
Show resolved Hide resolved
}
// handling cluster day 2 addon profile operation flow
if clusterUid == "" && clusterContext == "" {
SivaanandM marked this conversation as resolved.
Show resolved Hide resolved
clusterUid = d.Id()
clusterContext = d.Get("context").(string)
}

return toProfilesCommon(c, d, clusterUid, clusterContext)
}

Expand Down