Skip to content

🌱 Bump sigs.k8s.io/kubebuilder/v3 from 3.14.0 to 3.15.1 #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type MemcachedBackupSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

//+kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Minimum=0
// Size is the size of the memcached deployment
Size int32 `json:"size"`
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
k8s.io/client-go v0.30.3
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/kubebuilder/v3 v3.14.2
sigs.k8s.io/kubebuilder/v3 v3.15.1
sigs.k8s.io/yaml v1.4.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,8 @@ sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHv
sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/kubebuilder/v3 v3.14.2 h1:LMZW8Y5eItnP4kh9tpp4Gs2Gd5V3DgLgzbNnXfMAShY=
sigs.k8s.io/kubebuilder/v3 v3.14.2/go.mod h1:gEZM8SUkewOQnpRDiewh4gmbQ1FMkT/CDlMddOg053M=
sigs.k8s.io/kubebuilder/v3 v3.15.1 h1:a01OIfeZOew3gB2T65D97UxLC5zeEHy8FrNIgx349BE=
sigs.k8s.io/kubebuilder/v3 v3.15.1/go.mod h1:/QwYUyLicWiNcdMAmV5lfWoslWz9Ro9L+AK8UQrQxbI=
sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0=
sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3/go.mod h1:9n16EZKMhXBNSiUC5kSdFQJkdH3zbxS/JoO619G1VAY=
sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM7vh3b7HvGNfXrJ/xL6BDMS0v1V/HHg5U=
Expand Down
10 changes: 2 additions & 8 deletions pkg/plugins/helm/v1/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,10 @@ func addInitCustomizations(projectName string) error {
// todo: we ought to use afero instead. Replace this methods to insert/update
// by https://github.com/kubernetes-sigs/kubebuilder/pull/2119

// Add leader election arg in config/manager/manager.yaml and in config/default/manager_auth_proxy_patch.yaml
// Add leader election arg in config/manager/manager.yaml
err := kbutils.InsertCode(managerFile,
"--leader-elect",
fmt.Sprintf("\n - --leader-election-id=%s", projectName))
if err != nil {
return err
}
err = kbutils.InsertCode(filepath.Join("config", "default", "manager_auth_proxy_patch.yaml"),
"- \"--leader-elect\"",
fmt.Sprintf("\n - \"--leader-election-id=%s\"", projectName))
fmt.Sprintf("\n - --leader-election-id=%s", projectName))
if err != nil {
return err
}
Expand Down
10 changes: 2 additions & 8 deletions pkg/plugins/hybrid/v1alpha/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,10 @@ func addInitCustomizations(projectName string) error {
// todo: we ought to use afero instead. Replace this methods to insert/update
// by https://github.com/kubernetes-sigs/kubebuilder/pull/2119

// Add leader election arg in config/manager/manager.yaml and in config/default/manager_auth_proxy_patch.yaml
// Add leader election arg in config/manager/manager.yaml
err := util.InsertCode(managerFile,
"--leader-elect",
fmt.Sprintf("\n - --leader-election-id=%s", projectName))
if err != nil {
return err
}
err = util.InsertCode(filepath.Join("config", "default", "manager_auth_proxy_patch.yaml"),
"- \"--leader-elect\"",
fmt.Sprintf("\n - \"--leader-election-id=%s\"", projectName))
fmt.Sprintf("\n - --leader-election-id=%s", projectName))
if err != nil {
return err
}
Expand Down
22 changes: 0 additions & 22 deletions pkg/plugins/hybrid/v1alpha/scaffolds/internal/templates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ func init() {
}

func main() {
{{- if not .ComponentConfig }}
var (
metricsAddr string
leaderElectionID string
Expand All @@ -249,13 +248,6 @@ func main() {
"Whether or not the metrics endpoint should be served securely")
flag.BoolVar(&enableHTTP2, "enable-http2", false,
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
{{- else }}
var configFile string
flag.StringVar(&configFile, "config", "",
"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.")
{{- end }}
opts := zap.Options{
Development: true,
}
Expand All @@ -264,7 +256,6 @@ func main() {

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

{{ if not .ComponentConfig }}
disableHTTP2 := func(c *tls.Config) {
setupLog.Info("disabling http/2")
c.NextProtos = []string{"http/1.1"}
Expand All @@ -291,19 +282,6 @@ func main() {
LeaderElection: enableLeaderElection,
LeaderElectionID: leaderElectionID,
})
{{- else }}
var err error
options := ctrl.Options{Scheme: scheme}
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)
{{- end }}
if err != nil {
setupLog.Error(err, "unable to start manager")
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func SkipDependentWatches(skip bool) Option {
// Example for using a custom type for the GVK scheme instead of unstructured.Unstructured:
//
// // Define custom type for GVK scheme.
// //+kubebuilder:object:root=true
// // +kubebuilder:object:root=true
// type Custom struct {
// // [...]
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ resources:
- ../manager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
# [METRICS] To enable the controller manager metrics service, uncomment the following line.
#- metrics_service.yaml

patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- path: manager_auth_proxy_patch.yaml
# Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager
#patches:
# [METRICS] The following patch will enable the metrics endpoint. Ensure that you also protect this endpoint.
# More info: https://book.kubebuilder.io/reference/metrics
# If you want to expose the metric endpoint of your controller-manager uncomment the following line.
#- path: manager_metrics_patch.yaml
# target:
# kind: Deployment

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This patch adds the args to allow exposing the metrics endpoint securely
- op: add
path: /spec/template/spec/containers/0/args/0
value: --metrics-bind-address=:8080
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ metadata:
namespace: system
spec:
ports:
- name: https
port: 8443
- name: http
port: 8080
protocol: TCP
targetPort: https
targetPort: 8080
selector:
control-plane: controller-manager
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ spec:
# type: RuntimeDefault
containers:
- args:
- --leader-elect
- --leader-election-id=memcached-operator
- --leader-elect
- --leader-election-id=memcached-operator
- --health-probe-bind-address=:8081
image: controller:latest
name: manager
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ metadata:
spec:
endpoints:
- path: /metrics
port: https
scheme: https
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
tlsConfig:
insecureSkipVerify: true
port: http # Ensure this is the name of the port that exposes HTTP metrics
scheme: http
selector:
matchLabels:
control-plane: controller-manager

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,3 @@ resources:
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml
2 changes: 2 additions & 0 deletions testdata/hybrid/memcached-operator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module github.com/example/memcached-operator

go 1.22.0

toolchain go1.22.5

require (
github.com/onsi/ginkgo/v2 v2.19.1
github.com/onsi/gomega v1.34.1
Expand Down
Loading