Skip to content

Commit

Permalink
Merge pull request #15422 from kargakis/fix-rwo-warning
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Jul 25, 2017
2 parents 49df2d6 + d00a7fe commit 970dc61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/api/graph/test/dc-with-claim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ items:
replicas: 1
strategy:
rollingParams:
maxSurge: 1
maxSurge: 25%
type: Rolling
template:
metadata:
Expand Down
10 changes: 7 additions & 3 deletions pkg/deploy/graph/analysis/dc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/gonum/graph"

kapi "k8s.io/kubernetes/pkg/api"
kdeplutil "k8s.io/kubernetes/pkg/controller/deployment/util"

osgraph "github.com/openshift/origin/pkg/api/graph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
Expand Down Expand Up @@ -162,10 +163,13 @@ func pvcMarker(g osgraph.Graph, f osgraph.Namer, dcNode *deploygraph.DeploymentC
}

dc := dcNode.DeploymentConfig
rollingParams := dc.Spec.Strategy.RollingParams
isBlockedBySize := dc.Spec.Replicas > 1
isBlockedRolling := rollingParams != nil && rollingParams.MaxSurge.IntValue() > 0

isBlockedRolling := false
rollingParams := dc.Spec.Strategy.RollingParams
if rollingParams != nil {
maxSurge, _, _ := kdeplutil.ResolveFenceposts(&rollingParams.MaxSurge, &rollingParams.MaxUnavailable, dc.Spec.Replicas)
isBlockedRolling = maxSurge > 0
}
// If the claim is not RWO or deployments will not have more than a pod running at any time
// then they should be fine.
if !hasRWOAccess(pvcNode) || (!isBlockedRolling && !isBlockedBySize) {
Expand Down

0 comments on commit 970dc61

Please sign in to comment.