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 #153

Merged
merged 3 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
14 changes: 7 additions & 7 deletions build/common/Makefile.common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@

## CLI versions (with links to the latest releases)
# https://github.com/kubernetes-sigs/controller-tools/releases/latest
CONTROLLER_GEN_VERSION := v0.14.0
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/uninstall/triggeruninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
deploymentName string
deploymentNamespace string
policyNamespace string
timeoutSeconds uint
timeoutSeconds uint32
)

var triggerLog = ctrl.Log.WithName("trigger-uninstall")
Expand Down Expand Up @@ -95,7 +95,7 @@ func parseUninstallFlags(args []string) error {
triggerUninstallFlagSet.StringVar(
&policyNamespace, "policy-namespace", "", "The namespace where the Policy 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
85 changes: 37 additions & 48 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,100 +36,89 @@ metadata:
name: governance-policy-framework-addon
rules:
- apiGroups:
- admissionregistration.k8s.io
resourceNames:
- gatekeeper-validating-webhook-configuration
- ""
resources:
- validatingwebhookconfigurations
- events
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apiextensions.k8s.io
- ""
resources:
- customresourcedefinitions
- pods
verbs:
- get
- list
- watch
- apiGroups:
- apps
resourceNames:
- governance-policy-framework-addon
- ""
resources:
- deployments
- secrets
verbs:
- get
- list
- patch
- update
- watch
- create
- apiGroups:
- cluster.open-cluster-management.io
- ""
resourceNames:
- id.k8s.io
- open-cluster-management-compliance-history-api-recorder
resources:
- clusterclaims
- secrets
verbs:
- get
- apiGroups:
- constraints.gatekeeper.sh
- ""
resourceNames:
- policy-encryption-key
resources:
- '*'
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
- admissionregistration.k8s.io
resourceNames:
- gatekeeper-validating-webhook-configuration
resources:
- events
- validatingwebhookconfigurations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
- apiextensions.k8s.io
resources:
- pods
- customresourcedefinitions
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- apiGroups:
- ""
- apps
resourceNames:
- open-cluster-management-compliance-history-api-recorder
- governance-policy-framework-addon
resources:
- secrets
- deployments
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
- cluster.open-cluster-management.io
resourceNames:
- policy-encryption-key
- id.k8s.io
resources:
- secrets
- clusterclaims
verbs:
- delete
- get
- list
- update
- watch
- apiGroups:
- constraints.gatekeeper.sh
- policy.open-cluster-management.io
resources:
- '*'
Expand Down
85 changes: 37 additions & 48 deletions deploy/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,100 +5,89 @@ metadata:
name: governance-policy-framework-addon
rules:
- apiGroups:
- admissionregistration.k8s.io
resourceNames:
- gatekeeper-validating-webhook-configuration
- ""
resources:
- validatingwebhookconfigurations
- events
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apiextensions.k8s.io
- ""
resources:
- customresourcedefinitions
- pods
verbs:
- get
- list
- watch
- apiGroups:
- apps
resourceNames:
- governance-policy-framework-addon
- ""
resources:
- deployments
- secrets
verbs:
- get
- list
- patch
- update
- watch
- create
- apiGroups:
- cluster.open-cluster-management.io
- ""
resourceNames:
- id.k8s.io
- open-cluster-management-compliance-history-api-recorder
resources:
- clusterclaims
- secrets
verbs:
- get
- apiGroups:
- constraints.gatekeeper.sh
- ""
resourceNames:
- policy-encryption-key
resources:
- '*'
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
- admissionregistration.k8s.io
resourceNames:
- gatekeeper-validating-webhook-configuration
resources:
- events
- validatingwebhookconfigurations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
- apiextensions.k8s.io
resources:
- pods
- customresourcedefinitions
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- apiGroups:
- ""
- apps
resourceNames:
- open-cluster-management-compliance-history-api-recorder
- governance-policy-framework-addon
resources:
- secrets
- deployments
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
- cluster.open-cluster-management.io
resourceNames:
- policy-encryption-key
- id.k8s.io
resources:
- secrets
- clusterclaims
verbs:
- delete
- get
- list
- update
- watch
- apiGroups:
- constraints.gatekeeper.sh
- policy.open-cluster-management.io
resources:
- '*'
Expand Down
6 changes: 3 additions & 3 deletions tool/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type SyncerOptions struct {
DeploymentName string
EvaluationConcurrency uint8
ClientQPS float32
ClientBurst uint
ClientBurst uint32
ComplianceAPIURL string
}

Expand Down Expand Up @@ -135,7 +135,7 @@ func ProcessFlags() {
"Will scale with concurrency, if not explicitly set.",
)

flag.UintVar(
flag.Uint32Var(
&Options.ClientBurst,
"client-burst",
45, // the controller-runtime defaults are 20:30 (qps:burst) - this matches that ratio
Expand All @@ -156,7 +156,7 @@ func ProcessFlags() {
}

if !flag.Changed("client-burst") {
Options.ClientBurst = uint(Options.EvaluationConcurrency)*22 + 1
Options.ClientBurst = uint32(Options.EvaluationConcurrency)*22 + 1
}
}

Expand Down