Skip to content

Commit

Permalink
fix: remove deprecated componentConfig and controller manager options
Browse files Browse the repository at this point in the history
  • Loading branch information
redhatrises committed Jan 11, 2024
1 parent 0cf59a4 commit 3ac6dba
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 107 deletions.
1 change: 0 additions & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
componentConfig: true
domain: crowdstrike.com
layout:
- go.kubebuilder.io/v4
Expand Down
13 changes: 0 additions & 13 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,8 @@ func main() {
var profileAddr string
var enableProfiling bool
var ver bool
var configFile string
var err error

flag.StringVar(&configFile, "config", "config.yaml",
"The controller will load its initial configuration from this file. "+
"Omit this flag to use the default configuration values. "+
"Command-line flags override configuration from this file.")
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(&profileAddr, "profile-bind-address", "localhost:8082", "The address the profiling endpoint binds to.")
Expand Down Expand Up @@ -147,14 +142,6 @@ func main() {
),
}

if configFile != "" {
options, err = options.AndFrom(ctrl.ConfigFile().AtPath(configFile))
if err != nil {
setupLog.Error(err, "unable to load the config file")
os.Exit(1)
}
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), options)
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down
20 changes: 0 additions & 20 deletions config/default/manager_config_patch.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions config/manager/controller_manager_config.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ resources:
generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- files:
- controller_manager_config.yaml
name: manager-config
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
Expand Down
10 changes: 0 additions & 10 deletions config/non-olm/patches/manager_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,5 @@ spec:
env:
- name: WATCH_NAMESPACE
value: null
args:
- "--config=controller_manager_config.yaml"
volumeMounts:
- name: manager-config
mountPath: /controller_manager_config.yaml
subPath: controller_manager_config.yaml
securityContext:
fsGroup: 65534
volumes:
- name: manager-config
configMap:
name: manager-config
39 changes: 1 addition & 38 deletions deploy/falcon-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3694,35 +3694,6 @@ subjects:
name: falcon-operator-controller-manager
namespace: falcon-operator
---
apiVersion: v1
data:
controller_manager_config.yaml: |
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
kind: ControllerManagerConfig
health:
healthProbeBindAddress: :8081
metrics:
bindAddress: 127.0.0.1:8080
webhook:
port: 9443
leaderElection:
leaderElect: true
resourceName: 70435a7a.crowdstrike.com
# leaderElectionReleaseOnCancel defines if the leader should step down volume
# when the Manager ends. This requires the binary to immediately end when the
# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
# speeds up voluntary leader transitions as the new leader don't have to wait
# LeaseDuration time first.
# In the default scaffold provided, the program ends immediately after
# the manager stops, so would be fine to enable this option. However,
# if you are doing or is intended to do any operation such as perform cleanups
# after the manager stops then its usage might be unsafe.
# leaderElectionReleaseOnCancel: true
kind: ConfigMap
metadata:
name: falcon-operator-manager-config
namespace: falcon-operator
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -3767,7 +3738,7 @@ spec:
- linux
containers:
- args:
- --config=controller_manager_config.yaml
- --leader-elect
command:
- /manager
env:
Expand Down Expand Up @@ -3803,16 +3774,8 @@ spec:
drop:
- ALL
privileged: false
volumeMounts:
- mountPath: /controller_manager_config.yaml
name: manager-config
subPath: controller_manager_config.yaml
securityContext:
fsGroup: 65534
runAsNonRoot: true
serviceAccountName: falcon-operator-controller-manager
terminationGracePeriodSeconds: 10
volumes:
- configMap:
name: falcon-operator-manager-config
name: manager-config

0 comments on commit 3ac6dba

Please sign in to comment.