-
Notifications
You must be signed in to change notification settings - Fork 1
/
deployment.go
32 lines (27 loc) · 934 Bytes
/
deployment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package v1
import (
data "github.com/arangodb-managed/apis/data/v1"
)
//CanDeploymentBeUpgraded returns whenever the deployment spec differs from PrepaidDeployment specs
func (pd *PrepaidDeployment) CanDeploymentBeUpgraded(depl *data.Deployment) bool {
if pd == nil {
return false
}
if depl == nil {
return false
}
return pd.GetSupportPlanId() != depl.GetSupportPlanId() ||
pd.GetModel().GetModel() != depl.GetModel().GetModel() ||
pd.GetModel().GetNodeCount() != depl.GetModel().GetNodeCount() ||
pd.GetModel().GetNodeDiskSize() != depl.GetModel().GetNodeDiskSize() ||
pd.GetModel().GetNodeSizeId() != depl.GetModel().GetNodeSizeId()
}
// IsAddonAvailable validates if the provided addon is part of the prepaid deployment
func (pd *PrepaidDeployment) IsAddonAvailable(addon string) bool {
for _, a := range pd.GetAddons() {
if a == data.AddonIDPrivateEndpointService {
return true
}
}
return false
}