Skip to content

Commit

Permalink
Merge pull request #360 from kinvolk/surajssd/revert-operator-scope
Browse files Browse the repository at this point in the history
RBAC: revert the scope of operator to clusterwide
  • Loading branch information
krnowak authored Sep 14, 2018
2 parents bf94c75 + be078eb commit 81ca292
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion helm/habitat-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Parameter | Description | Default
`nodeSelector` | Node labels for pod assignment | `{}`
`rbacEnable` | If true, create & use RBAC resources | `true`
`resources` | Pod resource requests & limits | `{}`
`operatorNamespaced` | If this operator should run scoped to Single namespace | `true`
`operatorNamespaced` | If this operator should run scoped to Single namespace | `false`
`namespace` | Namespace this operator should run inside | `habitat-operator`

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
Expand Down
2 changes: 1 addition & 1 deletion helm/habitat-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nodeSelector: {}
rbacEnable: true

## Decide if habitat-operator runs at cluster or namespaced scope
operatorNamespaced: true
operatorNamespaced: false
namespace: habitat-operator

## Habitat-operator resource limits & requests
Expand Down
6 changes: 3 additions & 3 deletions test/sync/rbac/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ func extractRulesFromHelm(path string, isItClusterRole bool) ([]rbacv1.PolicyRul
return nil, errors.Wrapf(err, "loading chart %s failed", path)
}

// make sure that the ClusterRole is generated
if isItClusterRole {
chart.Values.Raw = strings.Replace(chart.Values.Raw, "operatorNamespaced: true", "operatorNamespaced: false", 1)
// If it is Role then we need to replace the value of `operatorNamespaced` to true
if !isItClusterRole {
chart.Values.Raw = strings.Replace(chart.Values.Raw, "operatorNamespaced: false", "operatorNamespaced: true", 1)
}

renderedFiles, err := renderutil.Render(chart, chart.Values, renderutil.Options{})
Expand Down

0 comments on commit 81ca292

Please sign in to comment.