-
Notifications
You must be signed in to change notification settings - Fork 688
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
verifying EnvironmentID before creating infrastructure #4484
Changes from all commits
ba3d31a
1d333f2
a735840
a355fd5
321b4dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -86,6 +86,11 @@ func (in *infraService) RegisterInfra(c context.Context, projectID string, input | |||||||||
return nil, errors.New("infra already exists in this project with the same name") | ||||||||||
} | ||||||||||
|
||||||||||
// Check if EnvironmentID is valid | ||||||||||
if _, err := in.envOperator.GetEnvironmentDetails(c, input.EnvironmentID, projectID); err != nil { | ||||||||||
return nil, errors.New("Invalid EnvironmentID") | ||||||||||
Comment on lines
+90
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Dhanush0369 have you tested these changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I have attached the graphql playground pic |
||||||||||
} | ||||||||||
|
||||||||||
if (*input.InfraNsExists && input.InfraNamespace == nil) || (*input.InfraNsExists && *input.InfraNamespace == "") { | ||||||||||
return nil, errors.New("InfraNamespace parameter is required if InfraNsExists is true") | ||||||||||
} | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid EnvironmentID - > environment does not exist.