Skip to content

Commit 88828f0

Browse files
committed
change to CustomControllerManagerConfiguration
1 parent 6a32a3d commit 88828f0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

testdata/project-v4-config/cmd/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import (
2020
"flag"
2121
"os"
2222

23+
"sigs.k8s.io/controller-runtime/examples/configfile/custom/v1alpha1"
24+
"sigs.k8s.io/controller-runtime/pkg/config"
25+
2326
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
2427
// to ensure that exec-entrypoint and run can make use of them.
2528
_ "k8s.io/client-go/plugin/pkg/client/auth"
@@ -65,7 +68,8 @@ func main() {
6568
var err error
6669
options := ctrl.Options{Scheme: scheme}
6770
if configFile != "" {
68-
options, err = options.AndFrom(ctrl.ConfigFile().AtPath(configFile))
71+
ctrlConfig := v1alpha1.CustomControllerManagerConfiguration{}
72+
options, err = options.AndFrom(config.File().AtPath(configFile).OfKind(&ctrlConfig))
6973
if err != nil {
7074
setupLog.Error(err, "unable to load the config file")
7175
os.Exit(1)

testdata/project-v4-config/config/manager/controller_manager_config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ webhook:
1616
port: 9443
1717
leaderElection:
1818
leaderElect: true
19+
resourceNamespace: testproject.org
1920
resourceName: 89f7a333.testproject.org
2021
# leaderElectionReleaseOnCancel defines if the leader should step down volume
2122
# when the Manager ends. This requires the binary to immediately end when the

0 commit comments

Comments
 (0)