Skip to content

Commit

Permalink
fix: Truncating hub membership ID when greater than 63 character (#1429)
Browse files Browse the repository at this point in the history
* Truncating Membership ID when greater than 63 character

* Correcting Linting

* Modifying If Logic and Adding Trim Suffix

Co-authored-by: Akshay Bathija <[email protected]>
Co-authored-by: Bharath KKB <[email protected]>
  • Loading branch information
3 people authored Oct 19, 2022
1 parent a6c63f4 commit 0c5660d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/fleet-membership/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
*/

locals {
hub_project_id = var.hub_project_id == "" ? var.project_id : var.hub_project_id
gke_hub_membership_name = var.membership_name != "" ? var.membership_name : "${var.project_id}-${var.location}-${var.cluster_name}"
hub_project_id = var.hub_project_id == "" ? var.project_id : var.hub_project_id
gke_hub_membership_name_complete = var.membership_name != "" ? var.membership_name : "${var.project_id}-${var.location}-${var.cluster_name}"
gke_hub_membership_name = trimsuffix(substr(local.gke_hub_membership_name_complete, 0, 63), "-")
}

# Retrieve GKE cluster info
Expand Down

0 comments on commit 0c5660d

Please sign in to comment.