|
|
@@ -36,13 +36,19 @@ func NewValidatePorterAppHandler(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// ServiceDeletions are deletions to apply to a specific service
|
|
|
+type ServiceDeletions struct {
|
|
|
+ DomainNames []string `json:"domain_names"`
|
|
|
+ IngressAnnotationKeys []string `json:"ingress_annotation_keys"`
|
|
|
+}
|
|
|
+
|
|
|
// Deletions are the names of services and env variables to delete
|
|
|
type Deletions struct {
|
|
|
- ServiceNames []string `json:"service_names"`
|
|
|
- Predeploy []string `json:"predeploy"`
|
|
|
- EnvVariableNames []string `json:"env_variable_names"`
|
|
|
- EnvGroupNames []string `json:"env_group_names"`
|
|
|
- DomainNameDeletions map[string][]string `json:"domain_name_deletions"`
|
|
|
+ ServiceNames []string `json:"service_names"`
|
|
|
+ Predeploy []string `json:"predeploy"`
|
|
|
+ EnvVariableNames []string `json:"env_variable_names"`
|
|
|
+ EnvGroupNames []string `json:"env_group_names"`
|
|
|
+ ServiceDeletions map[string]ServiceDeletions `json:"service_deletions"`
|
|
|
}
|
|
|
|
|
|
// ValidatePorterAppRequest is the request object for the /apps/validate endpoint
|
|
|
@@ -144,12 +150,13 @@ func (c *ValidatePorterAppHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ
|
|
|
telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "validated-with-overrides", Value: true})
|
|
|
}
|
|
|
|
|
|
- var ServiceDomainsDeletions map[string]*porterv1.DomainNameList
|
|
|
- if request.Deletions.DomainNameDeletions != nil {
|
|
|
- ServiceDomainsDeletions = make(map[string]*porterv1.DomainNameList)
|
|
|
- for k, v := range request.Deletions.DomainNameDeletions {
|
|
|
- ServiceDomainsDeletions[k] = &porterv1.DomainNameList{
|
|
|
- DomainNames: v,
|
|
|
+ var serviceDeletions map[string]*porterv1.ServiceDeletions
|
|
|
+ if request.Deletions.ServiceDeletions != nil {
|
|
|
+ serviceDeletions = make(map[string]*porterv1.ServiceDeletions)
|
|
|
+ for k, v := range request.Deletions.ServiceDeletions {
|
|
|
+ serviceDeletions[k] = &porterv1.ServiceDeletions{
|
|
|
+ DomainNames: v.DomainNames,
|
|
|
+ IngressAnnotations: v.IngressAnnotationKeys,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -165,7 +172,7 @@ func (c *ValidatePorterAppHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ
|
|
|
PredeployNames: request.Deletions.Predeploy,
|
|
|
EnvVariableNames: request.Deletions.EnvVariableNames,
|
|
|
EnvGroupNames: request.Deletions.EnvGroupNames,
|
|
|
- ServiceDomains: ServiceDomainsDeletions,
|
|
|
+ ServiceDeletions: serviceDeletions,
|
|
|
},
|
|
|
})
|
|
|
ccpResp, err := c.Config().ClusterControlPlaneClient.ValidatePorterApp(ctx, validateReq)
|