Skip to content

Commit

Permalink
changed some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
SubZer0MS committed Mar 30, 2023
1 parent 96d6fb8 commit 2cca919
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 13 deletions.
8 changes: 0 additions & 8 deletions controllers/agentaction_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,6 @@ func (r *AgentActionReconciler) createAgentJob(ctx context.Context, log logr.Log
func (r *AgentActionReconciler) resolveAgentConfig(ctx context.Context, log logr.Logger, action *porterv1.AgentAction) (porterv1.AgentConfigSpecAdapter, error) {
log.V(Log5Trace).Info("Resolving porter agent configuration")

operatorNamespace := operatorNamespaceDefault

logConfig := func(level string, config *porterv1.AgentConfig) {
if config == nil || config.Name == "" {
return
Expand All @@ -495,8 +493,6 @@ func (r *AgentActionReconciler) resolveAgentConfig(ctx context.Context, log logr
"namespace", config.Namespace,
"name", config.Name,
"plugin", config.Spec.PluginConfigFile)

operatorNamespace = config.Namespace
}

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

operatorNamespace := operatorNamespaceDefault

logConfig := func(level string, config *porterv1.PorterConfig) {
if config == nil || config.Name == "" {
return
Expand All @@ -564,8 +558,6 @@ func (r *AgentActionReconciler) resolvePorterConfig(ctx context.Context, log log
"level", level,
"namespace", config.Namespace,
"name", config.Name)

operatorNamespace = config.Namespace
}

// Provide a safe default config in case nothing is defined anywhere
Expand Down
2 changes: 1 addition & 1 deletion controllers/agentaction_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ func TestAgentActionReconciler_NoPluginsSpecified(t *testing.T) {

func TestAgentActionReconciler_resolveAgentConfig(t *testing.T) {
systemCfg := porterv1.AgentConfig{
ObjectMeta: metav1.ObjectMeta{Name: "default", Namespace: operatorNamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "default", Namespace: operatorNamespace},
Status: porterv1.AgentConfigStatus{
Ready: true,
},
Expand Down
5 changes: 3 additions & 2 deletions controllers/installation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controllers

import (
"context"
"os"
"reflect"

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

const (
operatorNamespaceDefault = "porter-operator-system"
var (
operatorNamespace = os.Getenv("POD_NAMESPACE")
)

// InstallationReconciler calls porter to execute changes made to an Installation CRD
Expand Down
2 changes: 1 addition & 1 deletion docs/content/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ porter credentials generate porterops -r ghcr.io/getporter/porter-operator:v0.8.
```

Install the operator into the porter-operator-system namespace:
* NOTE: Use your custom namespace if you want to install to a different one by adding **--param operatorNamespace=your-namespace-name**
* NOTE: Use your alternate namespace if you want to install to a different one by adding **--param operatorNamespace=your-namespace-name**
```
porter install porterops -c porterops -r ghcr.io/getporter/porter-operator:v0.8.0
```
Expand Down
2 changes: 1 addition & 1 deletion docs/content/quickstart/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The bundle includes a custom action that prepares a namespace for you:
porter invoke porterops --action configureNamespace --param namespace=quickstart -c porterops
```

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

Expand Down

0 comments on commit 2cca919

Please sign in to comment.