Skip to content

Commit 0ddc902

Browse files
fix(project): prevent empty billingReference value and add unit tests
1 parent 64f9234 commit 0ddc902

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/cmd/project/create/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel,
135135
}
136136

137137
if scope, hasScope := (*labels)["scope"]; hasScope && scope == "PUBLIC" {
138-
_, hasBilling := (*labels)["billingReference"]
138+
billingReference, hasBilling := (*labels)["billingReference"]
139139

140-
if networkAreaId == nil && !hasBilling {
140+
if networkAreaId == nil && (!hasBilling || billingReference == "") {
141141
return nil, &errors.FlagValidationError{
142142
Flag: labelFlag,
143143
Details: "creating a standalone public project (without a network area) requires a 'billingReference' label (e.g., --label billingReference=<value>)",

0 commit comments

Comments
 (0)