Skip to content

Commit 4d32167

Browse files
committed
changed some stuff
Signed-off-by: Mihai Sarbulescu <mihai.sarbulescu@gmail.com>
1 parent d01e3ef commit 4d32167

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

controllers/agentaction_controller.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,6 @@ func (r *AgentActionReconciler) createAgentJob(ctx context.Context, log logr.Log
483483
func (r *AgentActionReconciler) resolveAgentConfig(ctx context.Context, log logr.Logger, action *porterv1.AgentAction) (porterv1.AgentConfigSpecAdapter, error) {
484484
log.V(Log5Trace).Info("Resolving porter agent configuration")
485485

486-
operatorNamespace := operatorNamespaceDefault
487-
488486
logConfig := func(level string, config *porterv1.AgentConfig) {
489487
if config == nil || config.Name == "" {
490488
return
@@ -495,8 +493,6 @@ func (r *AgentActionReconciler) resolveAgentConfig(ctx context.Context, log logr
495493
"namespace", config.Namespace,
496494
"name", config.Name,
497495
"plugin", config.Spec.PluginConfigFile)
498-
499-
operatorNamespace = config.Namespace
500496
}
501497

502498
// Read agent configuration defined at the system level
@@ -554,8 +550,6 @@ func (r *AgentActionReconciler) resolveAgentConfig(ctx context.Context, log logr
554550
func (r *AgentActionReconciler) resolvePorterConfig(ctx context.Context, log logr.Logger, action *porterv1.AgentAction) (porterv1.PorterConfigSpec, error) {
555551
log.V(Log5Trace).Info("Resolving porter configuration file")
556552

557-
operatorNamespace := operatorNamespaceDefault
558-
559553
logConfig := func(level string, config *porterv1.PorterConfig) {
560554
if config == nil || config.Name == "" {
561555
return
@@ -564,8 +558,6 @@ func (r *AgentActionReconciler) resolvePorterConfig(ctx context.Context, log log
564558
"level", level,
565559
"namespace", config.Namespace,
566560
"name", config.Name)
567-
568-
operatorNamespace = config.Namespace
569561
}
570562

571563
// Provide a safe default config in case nothing is defined anywhere

controllers/agentaction_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ func TestAgentActionReconciler_NoPluginsSpecified(t *testing.T) {
928928

929929
func TestAgentActionReconciler_resolveAgentConfig(t *testing.T) {
930930
systemCfg := porterv1.AgentConfig{
931-
ObjectMeta: metav1.ObjectMeta{Name: "default", Namespace: operatorNamespaceDefault},
931+
ObjectMeta: metav1.ObjectMeta{Name: "default", Namespace: operatorNamespace},
932932
Status: porterv1.AgentConfigStatus{
933933
Ready: true,
934934
},

controllers/installation_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package controllers
22

33
import (
44
"context"
5+
"os"
56
"reflect"
67

78
porterv1 "get.porter.sh/operator/api/v1"
@@ -17,8 +18,8 @@ import (
1718
"sigs.k8s.io/controller-runtime/pkg/client"
1819
)
1920

20-
const (
21-
operatorNamespaceDefault = "porter-operator-system"
21+
var (
22+
operatorNamespace = os.Getenv("POD_NAMESPACE")
2223
)
2324

2425
// InstallationReconciler calls porter to execute changes made to an Installation CRD

docs/content/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ porter credentials generate porterops -r ghcr.io/getporter/porter-operator:v0.8.
9595
```
9696

9797
Install the operator into the porter-operator-system namespace:
98-
* NOTE: Use your custom namespace if you want to install to a different one by adding **--param operatorNamespace=your-namespace-name**
98+
* NOTE: Use your alternate namespace if you want to install to a different one by adding **--param operatorNamespace=your-namespace-name**
9999
```
100100
porter install porterops -c porterops -r ghcr.io/getporter/porter-operator:v0.8.0
101101
```

docs/content/quickstart/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The bundle includes a custom action that prepares a namespace for you:
4040
porter invoke porterops --action configureNamespace --param namespace=quickstart -c porterops
4141
```
4242

43-
The Porter Operator is now installed on your cluster in the porter-operator-system (or your custom namespace) namespace, along with a Mongodb server.
43+
The Porter Operator is now installed on your cluster in the porter-operator-system namespace, along with a Mongodb server.
4444
This database is not secured with a username/password, so do not use this default installation configuration with production secrets!
4545
The cluster has a namespace, quickstart, where we will create resources and Porter will create jobs to run Porter.
4646

0 commit comments

Comments
 (0)