Skip to content

Commit 8dcb895

Browse files
committed
Merge remote-tracking branch 'origin' into adding_kubvernor_implementor_v2
2 parents 426f4c0 + 40fdedb commit 8dcb895

File tree

117 files changed

+6346
-2465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+6346
-2465
lines changed

.custom-gcl.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: v2.3.1
2+
name: golangci-kube-api-linter
3+
destination: ./bin
4+
plugins:
5+
- module: 'sigs.k8s.io/kube-api-linter'
6+
version: 'v0.0.0-20250808120943-48643eb2563d' # Pin to a commit while there's no tag

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!-- Thanks for sending a pull request! Here are some tips for you:
2+
3+
1. If this is your first time contributing to Gateway API Inference Extension, please read our
4+
developer guide (https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/main/docs/dev.md)
5+
and our community page (https://gateway-api-inference-extension.sigs.k8s.io/contributing/).
6+
2. If this is your first time contributing to a Kubernetes project, please read
7+
our contributor guidelines:
8+
https://git.k8s.io/community/contributors/guide/first-contribution.md#your-first-contribution
9+
3. Please label this pull request according to what type of issue you are
10+
addressing, especially if this is a release targeted pull request. For
11+
reference on required PR/issue labels, read here:
12+
https://git.k8s.io/community/contributors/devel/sig-release/release.md#issuepr-kind-label
13+
4. If you want *faster* PR reviews, read how:
14+
https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
15+
5. If the PR is unfinished, see how to mark it:
16+
https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
17+
6. If this PR is a new design proposal, please review existing design docs for guidance:
18+
https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/docs/proposals
19+
-->
20+
21+
**What type of PR is this?**
22+
<!--
23+
Add one of the following kinds:
24+
/kind bug
25+
/kind cleanup
26+
/kind documentation
27+
/kind feature
28+
/kind gep
29+
/kind test
30+
31+
Optionally add one or more of the following kinds if applicable:
32+
/kind deprecation
33+
/kind failing-test
34+
/kind flake
35+
/kind regression
36+
/area conformance-test
37+
/area conformance-machinery
38+
-->
39+
40+
**What this PR does / why we need it**:
41+
42+
**Which issue(s) this PR fixes**:
43+
<!--
44+
*Automatically closes linked issue when PR is merged.
45+
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
46+
-->
47+
Fixes #
48+
49+
**Does this PR introduce a user-facing change?**:
50+
<!--
51+
If no, just write "NONE" in the release-note block below.
52+
If yes, please enter a release note below:
53+
-->
54+
```release-note
55+
56+
```

.github/workflows/kal.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: PR golangci-lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
# Remove all permissions from GITHUB_TOKEN except metadata.
8+
permissions: {}
9+
10+
jobs:
11+
golangci:
12+
name: kube-api-lint
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
18+
name: Checkout code
19+
with:
20+
persist-credentials: false
21+
- name: Set up Go
22+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
23+
- name: Install Golang CI Lint
24+
run: go install github.com/golangci/golangci-lint/v2/cmd/[email protected]
25+
- name: Build KAL
26+
run: golangci-lint custom
27+
- name: run api linter
28+
run: ./bin/golangci-kube-api-linter run -c ./.golangci-kal.yml ./...

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ go.work.sum
3030

3131
# generated docs
3232
site
33+
34+
# MacOS generated files
35+
**/.DS_Store

.golangci-kal.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: "2"
2+
linters:
3+
default: none
4+
enable:
5+
- kubeapilinter
6+
settings:
7+
custom:
8+
kubeapilinter:
9+
type: module
10+
description: Kube API LInter lints Kube like APIs based on API conventions and best practices.
11+
settings:
12+
linters:
13+
enable:
14+
- "*"
15+
disable:
16+
- "commentstart"
17+
lintersConfig:
18+
conflictingmarkers:
19+
conflicts:
20+
- name: "default_vs_required"
21+
sets:
22+
- ["default", "kubebuilder:default"]
23+
- ["required", "kubebuilder:validation:Required", "k8s:required"]
24+
description: "A field with a default value cannot be required"
25+
conditions:
26+
isFirstField: Warn # Require conditions to be the first field in the status struct.
27+
usePatchStrategy: Forbid # Forbid patchStrategy markers on the Conditions field.
28+
useProtobuf: Forbid # We don't use protobuf, so protobuf tags are not required.
29+
optionalfields:
30+
pointers:
31+
preference: WhenRequired # Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`.
32+
policy: SuggestFix # SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`.
33+
omitempty:
34+
policy: SuggestFix # SuggestFix | Warn | Ignore # The policy for omitempty in optional fields. Defaults to `SuggestFix`.
35+
omitzero:
36+
policy: Forbid # Enforce the `omitempty` route with a pointer for all optional structs.
37+
exclusions:
38+
generated: strict
39+
paths:
40+
- conformance/
41+
paths-except:
42+
- api/
43+
issues:
44+
max-issues-per-linter: 0
45+
max-same-issues: 0
46+
run:
47+
timeout: 5m
48+
tests: false

Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,16 @@ live-docs:
298298
docker run --rm -it -p 3000:3000 -v ${PWD}:/docs gaie/mkdocs
299299

300300
.PHONY: apix-ref-docs
301-
apix-ref-docs:
302-
crd-ref-docs \
301+
apix-ref-docs: crd-ref-docs
302+
${CRD_REF_DOCS} \
303303
--source-path=${PWD}/apix/v1alpha2 \
304304
--config=crd-ref-docs.yaml \
305305
--renderer=markdown \
306306
--output-path=${PWD}/site-src/reference/x-spec.md
307307

308308
.PHONY: api-ref-docs
309-
api-ref-docs:
310-
crd-ref-docs \
309+
api-ref-docs: crd-ref-docs
310+
${CRD_REF_DOCS} \
311311
--source-path=${PWD}/api \
312312
--config=crd-ref-docs.yaml \
313313
--renderer=markdown \
@@ -328,11 +328,11 @@ uninstall: generate kustomize ## Uninstall CRDs from the K8s cluster specified i
328328
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
329329

330330
##@ Helm
331-
PHONY: inferencepool-helm-chart-push
331+
.PHONY: inferencepool-helm-chart-push
332332
inferencepool-helm-chart-push: yq helm
333333
CHART=inferencepool EXTRA_TAG="$(EXTRA_TAG)" IMAGE_REGISTRY="$(IMAGE_REGISTRY)" YQ="$(YQ)" HELM="$(HELM)" ./hack/push-chart.sh
334334

335-
PHONY: bbr-helm-chart-push
335+
.PHONY: bbr-helm-chart-push
336336
bbr-helm-chart-push: yq helm
337337
CHART=body-based-routing EXTRA_TAG="$(EXTRA_TAG)" IMAGE_REGISTRY="$(IMAGE_REGISTRY)" YQ="$(YQ)" HELM="$(HELM)" ./hack/push-chart.sh
338338

@@ -364,6 +364,7 @@ KUBECTL ?= kubectl
364364
KUSTOMIZE ?= $(LOCALBIN)/kustomize
365365
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
366366
ENVTEST ?= $(LOCALBIN)/setup-envtest
367+
CRD_REF_DOCS ?= $(LOCALBIN)/crd-ref-docs
367368
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
368369
HELM = $(PROJECT_DIR)/bin/helm
369370
YQ = $(PROJECT_DIR)/bin/yq
@@ -374,10 +375,12 @@ GCI = $(LOCALBIN)/gci
374375
KUSTOMIZE_VERSION ?= v5.4.3
375376
CONTROLLER_TOOLS_VERSION ?= v0.16.1
376377
ENVTEST_VERSION ?= release-0.19
378+
CRD_REF_DOCS_VERSION ?= v0.2.0
377379
GOLANGCI_LINT_VERSION ?= v2.3.0
378380
HELM_VERSION ?= v3.17.1
379381
KUBECTL_VALIDATE_VERSION ?= v0.0.4
380382
GCI_VERSION ?= v0.13.6
383+
YQ_VERSION ?= v4.45.1
381384

382385
.PHONY: kustomize
383386
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -389,6 +392,11 @@ controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessar
389392
$(CONTROLLER_GEN): $(LOCALBIN)
390393
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen,$(CONTROLLER_TOOLS_VERSION))
391394

395+
.PHONY: crd-ref-docs
396+
crd-ref-docs: $(CRD_REF_DOCS) ## Download crd-ref-docs locally if necessary.
397+
$(CRD_REF_DOCS): $(LOCALBIN)
398+
$(call go-install-tool,$(CRD_REF_DOCS),github.com/elastic/crd-ref-docs,$(CRD_REF_DOCS_VERSION))
399+
392400
.PHONY: envtest
393401
envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
394402
$(ENVTEST): $(LOCALBIN)
@@ -401,7 +409,7 @@ $(GOLANGCI_LINT): $(LOCALBIN)
401409

402410
.PHONY: yq
403411
yq: ## Download yq locally if necessary.
404-
GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on go install github.com/mikefarah/yq/v4@v4.45.1
412+
GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on go install github.com/mikefarah/yq/v4@$(YQ_VERSION)
405413

406414
.PHONY: helm
407415
helm: ## Download helm locally if necessary.

OWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
approvers:
44
- gateway-api-inference-extension-maintainers
5-
- wg-serving-leads
65

76
reviewers:
87
- gateway-api-inference-extension-reviewers

OWNERS_ALIASES

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,3 @@ aliases:
1212
- liu-cong
1313
- robscott
1414
- shaneutt
15-
16-
17-
wg-serving-leads:
18-
- ArangoGutierrez
19-
- Jeffwan
20-
- SergeyKanzhelev
21-
- terrytangyuan

0 commit comments

Comments
 (0)