Skip to content
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

Sync common Makefile #299

Merged
merged 2 commits into from
Sep 24, 2024
Merged
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
12 changes: 6 additions & 6 deletions build/common/Makefile.common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
# https://github.com/kubernetes-sigs/controller-tools/releases/latest
CONTROLLER_GEN_VERSION := v0.16.3
# https://github.com/kubernetes-sigs/kustomize/releases/latest
KUSTOMIZE_VERSION := v5.3.0
KUSTOMIZE_VERSION := v5.4.3
# https://github.com/golangci/golangci-lint/releases/latest
GOLANGCI_VERSION := v1.52.2
# https://github.com/mvdan/gofumpt/releases/latest
GOFUMPT_VERSION := v0.6.0
GOFUMPT_VERSION := v0.7.0
# https://github.com/daixiang0/gci/releases/latest
GCI_VERSION := v0.13.4
GCI_VERSION := v0.13.5
# https://github.com/securego/gosec/releases/latest
GOSEC_VERSION := v2.19.0
GOSEC_VERSION := v2.21.3
# https://github.com/kubernetes-sigs/kubebuilder/releases/latest
KBVERSION := 3.14.1
KBVERSION := 3.15.1
# https://github.com/kubernetes/kubernetes/releases/latest
ENVTEST_K8S_VERSION := 1.29.x
ENVTEST_K8S_VERSION := 1.30.x

LOCAL_BIN ?= $(error LOCAL_BIN is not set.)
ifneq ($(findstring $(LOCAL_BIN), $(PATH)), $(LOCAL_BIN))
Expand Down
4 changes: 2 additions & 2 deletions controllers/configurationpolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func init() {

// SetupWithManager sets up the controller with the Manager.
func (r *ConfigurationPolicyReconciler) SetupWithManager(
mgr ctrl.Manager, evaluationConcurrency uint8, rawSources ...source.TypedSource[reconcile.Request],
mgr ctrl.Manager, evaluationConcurrency uint16, rawSources ...source.TypedSource[reconcile.Request],
) error {
builder := ctrl.NewControllerManagedBy(mgr).
Named(ControllerName).
Expand Down Expand Up @@ -199,7 +199,7 @@ type ConfigurationPolicyReconciler struct {
UninstallMode bool
// The number of seconds before a policy is eligible for reevaluation in watch mode (throttles frequently evaluated
// policies)
EvalBackoffSeconds uint
EvalBackoffSeconds uint32
// lastEvaluatedCache contains the value of ConfigurationPolicyStatus.LastEvaluated per ConfigurationPolicy UID.
// This is a workaround to account for race conditions where the status is updated but the controller-runtime cache
// has not updated yet.
Expand Down
18 changes: 9 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ type ctrlOpts struct {
probeAddr string
operatorPolDefaultNS string
clientQPS float32
clientBurst uint
evalBackoffSeconds uint
clientBurst uint16
evalBackoffSeconds uint32
decryptionConcurrency uint8
evaluationConcurrency uint8
evaluationConcurrency uint16
enableLease bool
enableLeaderElection bool
enableMetrics bool
Expand Down Expand Up @@ -668,7 +668,7 @@ func handleTriggerUninstall() {
triggerUninstallFlagSet := pflag.NewFlagSet("trigger-uninstall", pflag.ExitOnError)

var deploymentName, deploymentNamespace, policyNamespace string
var timeoutSeconds uint
var timeoutSeconds uint32

triggerUninstallFlagSet.StringVar(
&deploymentName, "deployment-name", "config-policy-controller", "The name of the controller Deployment object",
Expand All @@ -682,7 +682,7 @@ func handleTriggerUninstall() {
triggerUninstallFlagSet.StringVar(
&policyNamespace, "policy-namespace", "", "The namespace of where ConfigurationPolicy objects are stored",
)
triggerUninstallFlagSet.UintVar(
triggerUninstallFlagSet.Uint32Var(
&timeoutSeconds, "timeout-seconds", 300, "The number of seconds before the operation is canceled",
)
triggerUninstallFlagSet.AddGoFlagSet(flag.CommandLine)
Expand Down Expand Up @@ -721,7 +721,7 @@ func handleTriggerUninstall() {
func parseOpts(flags *pflag.FlagSet, args []string) *ctrlOpts {
opts := &ctrlOpts{}

flags.UintVar(
flags.Uint32Var(
&opts.evalBackoffSeconds,
"evaluation-backoff",
10,
Expand Down Expand Up @@ -793,7 +793,7 @@ func parseOpts(flags *pflag.FlagSet, args []string) *ctrlOpts {
"The max number of concurrent policy template decryptions",
)

flags.Uint8Var(
flags.Uint16Var(
&opts.evaluationConcurrency,
"evaluation-concurrency",
// Set a low default to not add too much load to the Kubernetes API server in resource constrained deployments.
Expand All @@ -816,7 +816,7 @@ func parseOpts(flags *pflag.FlagSet, args []string) *ctrlOpts {
"Will scale with concurrency, if not explicitly set.",
)

flags.UintVar(
flags.Uint16Var(
&opts.clientBurst,
"client-burst",
45, // the controller-runtime defaults are 20:30 (qps:burst) - this matches that ratio
Expand Down Expand Up @@ -854,7 +854,7 @@ func parseOpts(flags *pflag.FlagSet, args []string) *ctrlOpts {
}

if !flags.Changed("client-burst") {
opts.clientBurst = uint(opts.evaluationConcurrency)*22 + 1
opts.clientBurst = opts.evaluationConcurrency*22 + 1
}
}

Expand Down