Skip to content

Commit

Permalink
remove dumpYaml - was not a good idea anyway
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Aug 19, 2023
1 parent b51aff2 commit 4842e41
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
6 changes: 1 addition & 5 deletions controllers/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ var (
)

// SetupControllers sets up all controllers.
func SetupControllers(mgr ctrl.Manager, restClient rest.Interface, dumpYaml string) (string, error) {
func SetupControllers(mgr ctrl.Manager, restClient rest.Interface) (string, error) {

jobReconciler := controllers.NewMiniClusterReconciler(
mgr.GetClient(),
mgr.GetScheme(),
*(mgr.GetConfig()),
restClient,

// Directory to write namespaced yaml to
dumpYaml,

// other watching reconcilers could be added here!
)

Expand Down
3 changes: 0 additions & 3 deletions controllers/flux/minicluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ type MiniClusterReconciler struct {
client.Client
Scheme *runtime.Scheme
Manager ctrl.Manager
DumpYaml string
log logr.Logger
watchers []MiniClusterUpdateWatcher
RESTClient rest.Interface
Expand All @@ -51,14 +50,12 @@ func NewMiniClusterReconciler(
scheme *runtime.Scheme,
restConfig rest.Config,
restClient rest.Interface,
dumpYaml string,
watchers ...MiniClusterUpdateWatcher,
) *MiniClusterReconciler {

return &MiniClusterReconciler{
log: ctrl.Log.WithName("minicluster-reconciler"),
Client: client,
DumpYaml: dumpYaml,
Scheme: scheme,
watchers: watchers,
RESTClient: restClient,
Expand Down
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ func main() {
var probeAddr string

// Don't actually create resources, just dump the yaml configs
var dumpYaml string
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.StringVar(&dumpYaml, "dump-yaml", "", "dump minicluster contents (Job, ConfigMap, etc.) to a YAML files in this directory (must exist)")

flag.BoolVar(&enableLeaderElection, "leader-elect", false,
"Enable leader election for controller manager. "+
Expand Down Expand Up @@ -108,7 +106,7 @@ func main() {
setupLog.Error(err, "unable to create REST client", "controller", restClient)
}

if failedCtrl, err := core.SetupControllers(mgr, restClient, dumpYaml); err != nil {
if failedCtrl, err := core.SetupControllers(mgr, restClient); err != nil {
setupLog.Error(err, "Unable to create controller", "controller", failedCtrl)
os.Exit(1)
}
Expand Down

0 comments on commit 4842e41

Please sign in to comment.