Skip to content

Commit

Permalink
Merge pull request #93 from BuddhiWathsala/master
Browse files Browse the repository at this point in the history
Resolve the failure of the stateful app when PVC not specified
  • Loading branch information
mohanvive authored Sep 10, 2019
2 parents 4b18b34 + e8b197a commit ccaae28
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/apis/siddhi/v1alpha2/siddhiprocess_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ import (

// EqualsPVCSpec function of PVC check the equality of two PV structs
func EqualsPVCSpec(p *corev1.PersistentVolumeClaimSpec, q *corev1.PersistentVolumeClaimSpec) bool {
vmEq := p.VolumeMode == q.VolumeMode
vmEq := false
if p.VolumeMode != nil && q.VolumeMode != nil {
vmEq = *p.VolumeMode == *q.VolumeMode
} else if p.VolumeMode == nil && q.VolumeMode == nil {
vmEq = true
}
classEq := false
if p.StorageClassName != nil && q.StorageClassName != nil {
classEq = *p.StorageClassName == *q.StorageClassName
} else if p.StorageClassName == nil && q.StorageClassName == nil {
classEq = true
}
resourceEq := reflect.DeepEqual(p.Resources, q.Resources)
if len(p.AccessModes) != len(q.AccessModes) {
Expand Down Expand Up @@ -75,7 +82,7 @@ func (p *SiddhiProcessSpec) Equals(q *SiddhiProcessSpec) bool {
if !p.MessagingSystem.Equals(&q.MessagingSystem) {
return false
}
if EqualsPVCSpec(&p.PVC, &q.PVC) {
if !EqualsPVCSpec(&p.PVC, &q.PVC) {
return false
}
if p.ImagePullSecret != q.ImagePullSecret {
Expand Down

0 comments on commit ccaae28

Please sign in to comment.