Skip to content

Commit

Permalink
Merge "main.go: make --namespace a global var"
Browse files Browse the repository at this point in the history
  • Loading branch information
Microzuul CI authored and Gerrit Code Review committed Dec 11, 2023
2 parents 519db10 + 727c7a0 commit d076fb4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/developer/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Any change on the applied resource re-trigger the reconcile.
Run the operator with the following command:

```sh
go run ./main.go standalone --cr playbooks/files/sf.yaml --namespace sf
go run ./main.go --namespace sf standalone --cr playbooks/files/sf.yaml
```

> The command returns when the expected state is applied.
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ func main() {
rootCmd.Flags().BoolVar(&enableLeaderElection, "leader-elect", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
rootCmd.Flags().StringVar(&ns, "namespace", "", "The namespace to listen to.")
rootCmd.PersistentFlags().StringVarP(&ns, "namespace", "n", "sf", "The namespace to listen to.")

// Flags for the standalone command
standaloneCmd.Flags().StringVar(&ns, "namespace", "sf", "The namespace where to reconcile the deployment.")
standaloneCmd.Flags().StringVar(&sfResource, "cr", "", "The path to the CR to reconcile.")

// Add sub commands
Expand Down
2 changes: 1 addition & 1 deletion roles/run-operator-standalone/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- name: Run the operator in standalone mode
ansible.builtin.shell: |
set -o pipefail
go run ./main.go standalone --cr {{ cr_path }} --namespace sf 2>&1 | tee -a ~/zuul-output/logs/sf-operator.log
go run ./main.go --namespace sf standalone --cr {{ cr_path }} 2>&1 | tee -a ~/zuul-output/logs/sf-operator.log
args:
chdir: "{{ zuul.project.src_dir }}"

Expand Down

0 comments on commit d076fb4

Please sign in to comment.