Skip to content

Commit

Permalink
always set application Relationships in application resource
Browse files Browse the repository at this point in the history
  • Loading branch information
gmllt committed Jan 31, 2025
1 parent 0f9f273 commit d63f6b2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions resources/application_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,14 @@ func (a Application) MarshalJSON() ([]byte, error) {
Metadata: a.Metadata,
}

relationShips := Relationships{}
ccApp.Relationships = Relationships{}

if a.SpaceGUID != "" {
relationShips[constant.RelationshipTypeSpace] = Relationship{GUID: a.SpaceGUID}
ccApp.Relationships[constant.RelationshipTypeSpace] = Relationship{GUID: a.SpaceGUID}
}

if a.CurrentDropletGUID != "" {
relationShips[constant.RelationshipTypeCurrentDroplet] = Relationship{GUID: a.CurrentDropletGUID}
}

if len(relationShips) > 0 {
ccApp.Relationships = relationShips
ccApp.Relationships[constant.RelationshipTypeCurrentDroplet] = Relationship{GUID: a.CurrentDropletGUID}
}

if a.LifecycleType == constant.AppLifecycleTypeDocker {
Expand Down

0 comments on commit d63f6b2

Please sign in to comment.