-
Notifications
You must be signed in to change notification settings - Fork 948
Regression: environments cannot have : charcaters #3105
Copy link
Copy link
Closed
Labels
Type: BugSomething isn't working as documentedSomething isn't working as documented
Milestone
Description
Our environments have the : character, and since update v6.10.0 we can no longer use the provider to provision our environments.
We have the following error message:
Error: unexpected ID format ("some-repository:my:environment")
Where we have one environment named my:environment.
I can probably do a fix, but the issue is that everything relies on the parseID method which ensures that it properly split into a given count.
terraform-provider-github/github/util.go
Lines 57 to 68 in 15fff78
| func parseID(id string, count int) ([]string, error) { | |
| if len(id) == 0 { | |
| return nil, fmt.Errorf("id is empty") | |
| } | |
| parts := strings.Split(id, idSeparator) | |
| if len(parts) != count { | |
| return nil, fmt.Errorf("unexpected ID format (%q); expected %d parts separated by %q", id, count, idSeparator) | |
| } | |
| return parts, nil | |
| } |
I would fix this by ensuring that parseID2 splits in at least 2, and collect all the remaining splits in the second argument. Same for 3. Or by using a different separator but I'm not sure what the implications would be.
I'll do a PR and you'll give me some feedback.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't working as documentedSomething isn't working as documented