Skip to content
Merged
Changes from all 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
5 changes: 4 additions & 1 deletion internal/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,10 @@ func (s *Server) createDeployment(c *gin.Context) {

}

if req.Metadata != nil && (credentialID != "" || len(req.ServiceCredentials) > 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By initializing req.Metadata when it's nil but credentials exist, we ensure that registry associations are persisted. This fixes the bug where deployments without networking metadata would lose their credential links. Ensure models.ServiceMetadata does not require additional mandatory fields other than Name.

Suggested change
if req.Metadata != nil && (credentialID != "" || len(req.ServiceCredentials) > 0) {
+ if credentialID != "" || len(req.ServiceCredentials) > 0 {
+ if req.Metadata == nil {
+ req.Metadata = &models.ServiceMetadata{Name: req.Name}
+ }

if credentialID != "" || len(req.ServiceCredentials) > 0 {
if req.Metadata == nil {
req.Metadata = &models.ServiceMetadata{Name: req.Name}
}
if credentialID != "" {
req.Metadata.CredentialID = credentialID
}
Expand Down
Loading